size=0.7) context.circular_text(text=text[language]['copyright'], centre_x=0, centre_y=0, radius=r_2 - 1.3 * unit_cm, azimuth=270, spacing=1, size=0.7) context.circular_text(text=text[language]['climate_latitude'].format( latitude, north_letter if not is_southern else south_letter), centre_x=0, centre_y=0, radius=r_2 - 1.0 * unit_cm, azimuth=270, spacing=1, size=0.7) # Do it right away if we're run as a script if __name__ == "__main__": # Fetch command line arguments passed to us arguments = fetch_command_line_arguments( default_filename=Climate().default_filename()) # Render the climate Climate(settings={ 'latitude': arguments['latitude'], 'language': 'en' }).render_to_file(filename=arguments['filename'], img_format=arguments['img_format'])
rt_1 = r_1 * 0.55 + r_2 * 0.45 for i, t in enumerate(["\u2720", "A", "B", "C", "D", "E", "F", "G", "H", "I", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "X", "Y", "Z"]): theta = i / 24 * unit_rev # Letters are reversed in the southern hemisphere if is_southern: theta = -theta context.set_font_size(2.0 if i > 0 else 2.8) context.text(text=t, x=rt_1 * sin(theta), y=-rt_1 * cos(theta), h_align=0, v_align=0, gap=0, rotation=theta) # Do it right away if we're run as a script if __name__ == "__main__": # Fetch command line arguments passed to us arguments = fetch_command_line_arguments(default_filename=MotherFront().default_filename()) # Render the front of the mother MotherFront(settings={ 'latitude': arguments['latitude'], 'language': 'en' }).render_to_file( filename=arguments['filename'], img_format=arguments['img_format'] )
context.text(text=text[language]["glue_here"], x=p['x'], y=p['y'], h_align=0, v_align=1, gap=unit_mm, rotation=tr) # Write the text "Glue here" at various points around the horizon context.set_font_style(bold=True) context.set_color(color=(0, 0, 0, 1)) make_gluing_label(azimuth=0) make_gluing_label(azimuth=90) make_gluing_label(azimuth=180) make_gluing_label(azimuth=270) # Do it right away if we're run as a script if __name__ == "__main__": # Fetch command line arguments passed to us arguments = fetch_command_line_arguments( default_filename=AltAzGrid().default_filename()) # Render the alt-az grid AltAzGrid(settings={ 'latitude': arguments['latitude'], 'language': 'en' }).render_to_file(filename=arguments['filename'], img_format=arguments['img_format'])
v_align=0, gap=0, rotation=0) context.set_font_size(0.9) context.text(text=txt, x=0, y=0.5 * unit_cm, h_align=0, v_align=0, gap=0, rotation=pi) # Draw central hole context.begin_path() context.circle(centre_x=0, centre_y=h, radius=central_hole_size) context.stroke() # Do it right away if we're run as a script if __name__ == "__main__": # Fetch command line arguments passed to us arguments = fetch_command_line_arguments( default_filename=Holder().default_filename()) # Render the holder for the planisphere Holder(settings={ 'latitude': arguments['latitude'], 'language': 'en' }).render_to_file(filename=arguments['filename'], img_format=arguments['img_format'])
context.text(text="%d" % (d % 10), x=r_6 * cos(theta2), y=-r_6 * sin(theta2), h_align=-1, v_align=0, gap=0, rotation=-theta + pi / 2) # Draw the dividing line between the date scale and the star chart context.begin_path() context.circle(centre_x=0, centre_y=0, radius=r_2) context.stroke(color=theme['date'], line_width=1, dotted=False) # Do it right away if we're run as a script if __name__ == "__main__": # Fetch command line arguments passed to us arguments = fetch_command_line_arguments( default_filename=StarWheel().default_filename()) # Render the star wheel for the planisphere StarWheel( settings={ 'latitude': arguments['latitude'], 'language': 'en', 'theme': arguments['theme'], }).render_to_file( filename=arguments['filename'], img_format=arguments['img_format'], )
import time import text from climate import Climate from graphics_context import GraphicsPage, CompositeComponent from mother_back import MotherBack from mother_front import MotherFront from rete import Rete from rule import Rule from settings import fetch_command_line_arguments # Create clean output directory os.system("rm -Rf output") os.system("mkdir -p output/astrolabes output/astrolabe_parts") arguments = fetch_command_line_arguments() theme = arguments['theme'] # Render astrolabe in all available languages for language in text.text: # Render simplified and full astrolabes for astrolabe_type in ["full", "simplified"]: # Render climates for latitudes at 5-degree spacings from 10 deg -- 85 deg, plus 52N for latitude in list(range(-80, 90, 5)) + [52]: # Do not make equatorial astrolabes, as they don't really work if -10 < latitude < 10: continue