rn123 / Calendrical-Tools

Calendrical tools for reckoning time.
https://rn123.github.io/Calendrical-Tools/
0 stars 0 forks source link

astrolabe display #4

Open rn123 opened 4 years ago

rn123 commented 4 years ago

Especially for the time of a new moon, generate astrolabe diagram for the location (default TBD).

rn123 commented 4 years ago
image
rn123 commented 4 years ago

Sigh, lost the python code to generate the (animated) svg. The one generated file that I still have does have pretty good structure to show the logic. The python code

rn123 commented 4 years ago

Basic requirements:

rn123 commented 4 years ago

Back plate

rn123 commented 4 years ago

Rete

rn123 commented 4 years ago

Currently, Astrolabe object computes the basic elements (centers and radii) and fills in a jinja2 template for the svg output. Started using svgpathtools to compute intersections of paths. Also, cairosvg is used to generate a png output. The cairosvg package also provides access to an xml parse tree object.

with open('ecliptic_division.svg') as fp:
    tree = cairosvg.parser.Tree(file_obj=fp)

for elem in tree.xml_tree:
    print(elem)

A more expressive representation would be a minimal svg boilerplate, parsed into an xml_tree and svgpathtools path representations that can be mixed and matched to generate a custom astrolabe output.

rn123 commented 4 years ago

Currently, Astrolabe object computes the basic elements (centers and radii) and fills in a jinja2 template for the svg output. @rn123 Note: Should compare liquid vs jinja2 templates. Also, what templates are used in DASH?