From 40a39e6b4a7c76b10e056eb7966f7d0378e4027a Mon Sep 17 00:00:00 2001 From: Jim Carr Date: Sun, 21 Apr 2024 12:29:14 -0400 Subject: [PATCH] Refactor for PyPI, docs regen --- .gitignore | 3 + LICENSE | 19 + Makefile | 36 +- README.md | 147 +- cli-test.sh | 14 - cli_lib/.gitignore | 1 - cli_lib/pa_cli_datetime.py | 127 - docs-gen/Doxyfile | 4 +- docs-gen/Makefile | 5 +- docs-gen/src/README.md | 5 - .../lib_2README_8md.html => README_8md.html} | 18 +- ...2README_8md.html => ____init_____8py.html} | 26 +- docs/{python => }/bc_s.png | Bin docs/{python => }/bdwn.png | Bin docs/{python => }/closed.png | Bin ...dir_45978790aec87fba6f3407586a078612.html} | 20 +- ...> dir_45978790aec87fba6f3407586a078612.js} | 3 +- ...dir_68267d1309a1af8e8297ef4c3efbcdba.html} | 24 +- docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js | 4 + .../dir_8ebb4883bd5210c1437544ca4cb0df32.html | 10 +- docs/{python => }/doc.png | Bin docs/{python => }/doxygen.css | 154 +- docs/doxygen.svg | 26 + docs/{python => }/dynsections.js | 33 +- docs/files.html | 118 + docs/files_dup.js | 5 + docs/{python => }/folderclosed.png | Bin docs/{python => }/folderopen.png | Bin docs/{python => }/glossary_8md.html | 10 +- docs/index.html | 255 +- docs/{python => }/jquery.js | 0 docs/{python => }/md_src_glossary.html | 10 +- docs/{python => }/menu.js | 37 +- docs/{python => }/menudata.js | 32 +- docs/{python => }/namespacemembers.html | 26 +- docs/{python => }/namespacemembers_b.html | 14 +- docs/{python => }/namespacemembers_c.html | 34 +- docs/{python => }/namespacemembers_d.html | 46 +- docs/{python => }/namespacemembers_dup.js | 0 docs/{python => }/namespacemembers_e.html | 58 +- docs/{python => }/namespacemembers_f.html | 18 +- docs/{python => }/namespacemembers_func.html | 26 +- docs/{python => }/namespacemembers_func.js | 0 .../{python => }/namespacemembers_func_b.html | 12 +- .../{python => }/namespacemembers_func_c.html | 30 +- .../{python => }/namespacemembers_func_d.html | 46 +- .../{python => }/namespacemembers_func_e.html | 58 +- .../{python => }/namespacemembers_func_f.html | 18 +- .../{python => }/namespacemembers_func_g.html | 41 +- .../{python => }/namespacemembers_func_h.html | 24 +- .../{python => }/namespacemembers_func_i.html | 14 +- .../{python => }/namespacemembers_func_j.html | 29 +- .../{python => }/namespacemembers_func_k.html | 12 +- .../{python => }/namespacemembers_func_l.html | 40 +- docs/namespacemembers_func_m.html | 200 ++ .../{python => }/namespacemembers_func_n.html | 20 +- .../{python => }/namespacemembers_func_o.html | 12 +- .../{python => }/namespacemembers_func_p.html | 40 +- .../{python => }/namespacemembers_func_r.html | 28 +- .../{python => }/namespacemembers_func_s.html | 64 +- .../{python => }/namespacemembers_func_t.html | 22 +- .../{python => }/namespacemembers_func_u.html | 64 +- .../{python => }/namespacemembers_func_v.html | 12 +- docs/{python => }/namespacemembers_g.html | 41 +- docs/{python => }/namespacemembers_h.html | 24 +- docs/{python => }/namespacemembers_i.html | 14 +- docs/{python => }/namespacemembers_j.html | 29 +- docs/{python => }/namespacemembers_k.html | 12 +- docs/{python => }/namespacemembers_l.html | 40 +- docs/namespacemembers_m.html | 200 ++ docs/{python => }/namespacemembers_n.html | 20 +- docs/{python => }/namespacemembers_o.html | 12 +- docs/{python => }/namespacemembers_p.html | 42 +- docs/{python => }/namespacemembers_r.html | 28 +- docs/{python => }/namespacemembers_s.html | 64 +- docs/{python => }/namespacemembers_t.html | 22 +- docs/{python => }/namespacemembers_u.html | 64 +- docs/{python => }/namespacemembers_v.html | 12 +- docs/{python => }/namespacemembers_vars.html | 18 +- docs/namespacepractical__astronomy.html | 130 + docs/namespacepractical__astronomy.js | 256 ++ ...cepractical__astronomy_1_1pa__binary.html} | 47 +- ...tical__astronomy_1_1pa__binary__data.html} | 61 +- ...acepractical__astronomy_1_1pa__comet.html} | 112 +- ...ctical__astronomy_1_1pa__comet__data.html} | 102 +- ...actical__astronomy_1_1pa__coordinate.html} | 407 ++- ...practical__astronomy_1_1pa__datetime.html} | 331 ++- ...practical__astronomy_1_1pa__eclipses.html} | 202 +- ...acepractical__astronomy_1_1pa__macro.html} | 2458 ++++++++--------- ...pacepractical__astronomy_1_1pa__moon.html} | 298 +- ...cepractical__astronomy_1_1pa__planet.html} | 163 +- ...tical__astronomy_1_1pa__planet__data.html} | 57 +- ...spacepractical__astronomy_1_1pa__sun.html} | 305 +- ...pacepractical__astronomy_1_1pa__util.html} | 54 +- docs/namespaces.html | 115 + docs/namespaces_dup.js | 4 + docs/{python => }/nav_f.png | Bin docs/{python => }/nav_g.png | Bin docs/{python => }/nav_h.png | Bin docs/{python => }/navtree.css | 0 docs/{python => }/navtree.js | 32 +- docs/{python => }/navtreedata.js | 50 +- docs/{python => }/navtreeindex0.js | 142 +- docs/navtreeindex1.js | 253 ++ docs/navtreeindex2.js | 179 ++ docs/{python => }/open.png | Bin docs/{python => }/pa__binary_8py.html | 20 +- docs/pa__binary_8py.js | 4 + docs/{python => }/pa__binary__data_8py.html | 22 +- docs/{python => }/pa__binary__data_8py.js | 2 +- docs/{python => }/pa__comet_8py.html | 24 +- docs/pa__comet_8py.js | 5 + docs/{python => }/pa__comet__data_8py.html | 28 +- docs/{python => }/pa__comet__data_8py.js | 4 +- docs/pa__coordinate_8py.html | 154 ++ docs/pa__coordinate_8py.js | 25 + docs/pa__datetime_8py.html | 148 + docs/pa__datetime_8py.js | 22 + docs/{python => }/pa__eclipses_8py.html | 32 +- docs/pa__eclipses_8py.js | 7 + docs/pa__macro_8py.html | 414 +++ docs/pa__macro_8py.js | 155 ++ docs/{python => }/pa__moon_8py.html | 40 +- docs/pa__moon_8py.js | 9 + docs/{python => }/pa__planet_8py.html | 28 +- docs/pa__planet_8py.js | 6 + docs/{python => }/pa__planet__data_8py.html | 22 +- docs/{python => }/pa__planet__data_8py.js | 2 +- docs/{python => }/pa__sun_8py.html | 44 +- docs/pa__sun_8py.js | 10 + docs/{python => }/pa__util_8py.html | 28 +- docs/pa__util_8py.js | 6 + docs/{python => }/pages.html | 10 +- .../dir_3e90ebb34b98c37ddce7af954e777053.js | 4 - docs/python/doxygen.png | Bin 3779 -> 0 bytes docs/python/files.html | 120 - docs/python/files_dup.js | 6 - docs/python/index.html | 102 - docs/python/namespacemembers_func_m.html | 202 -- docs/python/namespacemembers_m.html | 202 -- docs/python/namespacepa__cli__datetime.html | 443 --- docs/python/namespaces.html | 117 - docs/python/namespaces_dup.js | 17 - docs/python/navtreeindex1.js | 205 -- docs/python/pa__binary_8py.js | 4 - docs/python/pa__cli__datetime_8py.html | 136 - docs/python/pa__cli__datetime_8py.js | 15 - docs/python/pa__comet_8py.js | 5 - docs/python/pa__coordinate_8py.html | 156 -- docs/python/pa__coordinate_8py.js | 25 - docs/python/pa__datetime_8py.html | 150 - docs/python/pa__datetime_8py.js | 22 - docs/python/pa__eclipses_8py.js | 7 - docs/python/pa__macro_8py.html | 416 --- docs/python/pa__macro_8py.js | 155 -- docs/python/pa__moon_8py.js | 9 - docs/python/pa__planet_8py.js | 6 - docs/python/pa__sun_8py.js | 10 - docs/python/pa__util_8py.js | 6 - docs/python/search/all_0.js | 11 - docs/python/search/all_1.js | 5 - docs/python/search/all_10.js | 13 - docs/python/search/all_11.js | 29 - docs/python/search/all_12.js | 9 - docs/python/search/all_13.js | 29 - docs/python/search/all_14.js | 4 - docs/python/search/all_15.js | 4 - docs/python/search/all_2.js | 14 - docs/python/search/all_3.js | 20 - docs/python/search/all_4.js | 27 - docs/python/search/all_5.js | 7 - docs/python/search/all_6.js | 19 - docs/python/search/all_7.js | 10 - docs/python/search/all_8.js | 5 - docs/python/search/all_9.js | 12 - docs/python/search/all_a.js | 4 - docs/python/search/all_b.js | 16 - docs/python/search/all_c.js | 37 - docs/python/search/all_d.js | 8 - docs/python/search/all_e.js | 4 - docs/python/search/all_f.js | 47 - docs/python/search/close.png | Bin 273 -> 0 bytes docs/python/search/files_0.js | 4 - docs/python/search/files_1.js | 17 - docs/python/search/files_2.js | 4 - docs/python/search/functions_0.js | 11 - docs/python/search/functions_1.js | 4 - docs/python/search/functions_10.js | 12 - docs/python/search/functions_11.js | 29 - docs/python/search/functions_12.js | 9 - docs/python/search/functions_13.js | 29 - docs/python/search/functions_14.js | 4 - docs/python/search/functions_2.js | 12 - docs/python/search/functions_3.js | 20 - docs/python/search/functions_4.js | 27 - docs/python/search/functions_5.js | 7 - docs/python/search/functions_6.js | 17 - docs/python/search/functions_7.js | 10 - docs/python/search/functions_8.js | 5 - docs/python/search/functions_9.js | 12 - docs/python/search/functions_a.js | 4 - docs/python/search/functions_b.js | 16 - docs/python/search/functions_c.js | 37 - docs/python/search/functions_d.js | 8 - docs/python/search/functions_e.js | 4 - docs/python/search/functions_f.js | 18 - docs/python/search/mag_sel.png | Bin 465 -> 0 bytes docs/python/search/namespaces_0.js | 17 - docs/python/search/pages_0.js | 4 - docs/python/search/pages_1.js | 4 - docs/python/search/variables_0.js | 4 - docs/python/search/variables_1.js | 5 - docs/python/search/variables_2.js | 4 - docs/{python => }/resize.js | 37 +- docs/{python => }/search/all_0.html | 19 +- docs/search/all_0.js | 4 + docs/{python => }/search/all_1.html | 19 +- docs/search/all_1.js | 11 + docs/{python => }/search/all_10.html | 19 +- docs/search/all_10.js | 47 + docs/{python => }/search/all_11.html | 19 +- docs/search/all_11.js | 13 + docs/{python => }/search/all_12.html | 19 +- docs/search/all_12.js | 29 + docs/{python => }/search/all_13.html | 19 +- docs/search/all_13.js | 9 + docs/{python => }/search/all_14.html | 19 +- docs/search/all_14.js | 27 + docs/{python => }/search/all_15.html | 19 +- docs/search/all_15.js | 4 + docs/{python => }/search/all_2.html | 19 +- docs/search/all_2.js | 5 + docs/{python => }/search/all_3.html | 19 +- docs/search/all_3.js | 12 + docs/{python => }/search/all_4.html | 19 +- docs/search/all_4.js | 18 + docs/{python => }/search/all_5.html | 19 +- docs/search/all_5.js | 27 + docs/{python => }/search/all_6.html | 19 +- docs/search/all_6.js | 7 + docs/{python => }/search/all_7.html | 19 +- docs/search/all_7.js | 16 + docs/{python => }/search/all_8.html | 19 +- docs/search/all_8.js | 10 + docs/{python => }/search/all_9.html | 19 +- docs/search/all_9.js | 5 + docs/{python => }/search/all_a.html | 19 +- docs/search/all_a.js | 11 + docs/{python => }/search/all_b.html | 19 +- docs/search/all_b.js | 4 + docs/{python => }/search/all_c.html | 19 +- docs/search/all_c.js | 14 + docs/{python => }/search/all_d.html | 19 +- docs/search/all_d.js | 37 + docs/{python => }/search/all_e.html | 19 +- docs/search/all_e.js | 8 + docs/{python => }/search/all_f.html | 19 +- docs/search/all_f.js | 4 + docs/search/close.svg | 31 + docs/{python => }/search/files_0.html | 19 +- docs/search/files_0.js | 4 + docs/{python => }/search/files_1.html | 19 +- docs/search/files_1.js | 4 + docs/{python => }/search/files_2.html | 19 +- docs/search/files_2.js | 16 + docs/search/files_3.html | 37 + docs/search/files_3.js | 4 + docs/{python => }/search/functions_0.html | 19 +- docs/search/functions_0.js | 11 + docs/{python => }/search/functions_1.html | 19 +- docs/search/functions_1.js | 4 + docs/{python => }/search/functions_10.html | 19 +- docs/search/functions_10.js | 12 + docs/{python => }/search/functions_11.html | 19 +- docs/search/functions_11.js | 29 + docs/{python => }/search/functions_12.html | 19 +- docs/search/functions_12.js | 9 + docs/{python => }/search/functions_13.html | 19 +- docs/search/functions_13.js | 27 + docs/{python => }/search/functions_14.html | 19 +- docs/search/functions_14.js | 4 + docs/{python => }/search/functions_2.html | 19 +- docs/search/functions_2.js | 10 + docs/{python => }/search/functions_3.html | 19 +- docs/search/functions_3.js | 18 + docs/{python => }/search/functions_4.html | 19 +- docs/search/functions_4.js | 27 + docs/{python => }/search/functions_5.html | 19 +- docs/search/functions_5.js | 7 + docs/{python => }/search/functions_6.html | 19 +- docs/search/functions_6.js | 14 + docs/{python => }/search/functions_7.html | 19 +- docs/search/functions_7.js | 10 + docs/{python => }/search/functions_8.html | 19 +- docs/search/functions_8.js | 5 + docs/{python => }/search/functions_9.html | 19 +- docs/search/functions_9.js | 11 + docs/{python => }/search/functions_a.html | 19 +- docs/search/functions_a.js | 4 + docs/{python => }/search/functions_b.html | 19 +- docs/search/functions_b.js | 14 + docs/{python => }/search/functions_c.html | 19 +- docs/search/functions_c.js | 37 + docs/{python => }/search/functions_d.html | 19 +- docs/search/functions_d.js | 8 + docs/{python => }/search/functions_e.html | 19 +- docs/search/functions_e.js | 4 + docs/{python => }/search/functions_f.html | 19 +- docs/search/functions_f.js | 18 + docs/search/mag_sel.svg | 74 + docs/{python => }/search/namespaces_0.html | 19 +- docs/search/namespaces_0.js | 17 + docs/{python => }/search/nomatches.html | 3 +- docs/{python => }/search/pages_0.html | 19 +- docs/search/pages_0.js | 4 + docs/{python => }/search/pages_1.html | 19 +- docs/search/pages_1.js | 4 + docs/{python => }/search/search.css | 104 +- docs/{python => }/search/search.js | 52 +- docs/{python => }/search/search_l.png | Bin docs/{python => }/search/search_m.png | Bin docs/{python => }/search/search_r.png | Bin docs/{python => }/search/searchdata.js | 6 +- docs/{python => }/search/variables_0.html | 19 +- docs/search/variables_0.js | 4 + docs/{python => }/search/variables_1.html | 19 +- docs/search/variables_1.js | 5 + docs/{python => }/search/variables_2.html | 19 +- docs/search/variables_2.js | 4 + docs/{python => }/splitbar.png | Bin docs/{python => }/sync_off.png | Bin docs/{python => }/sync_on.png | Bin docs/{python => }/tab_a.png | Bin docs/{python => }/tab_b.png | Bin docs/{python => }/tab_h.png | Bin docs/{python => }/tab_s.png | Bin docs/{python => }/tabs.css | 0 docs/w3.css | 232 -- lib/.gitignore | 1 - lib/README.md | 74 - pa-cli.py | 149 - pyproject.toml | 21 + src/practical_astronomy/__init__.py | 0 {lib => src/practical_astronomy}/pa_binary.py | 4 +- .../practical_astronomy}/pa_binary_data.py | 0 {lib => src/practical_astronomy}/pa_comet.py | 0 .../practical_astronomy}/pa_comet_data.py | 0 .../practical_astronomy}/pa_coordinate.py | 0 .../practical_astronomy}/pa_datetime.py | 0 .../practical_astronomy}/pa_eclipses.py | 0 {lib => src/practical_astronomy}/pa_macro.py | 0 {lib => src/practical_astronomy}/pa_moon.py | 0 {lib => src/practical_astronomy}/pa_planet.py | 0 .../practical_astronomy}/pa_planet_data.py | 0 {lib => src/practical_astronomy}/pa_sun.py | 0 {lib => src/practical_astronomy}/pa_util.py | 0 test.py | 20 - test-coordinate.py => test_coordinate.py | 4 +- ...ate-of-easter.py => test_date_of_easter.py | 4 +- test-day-number.py => test_day_number.py | 4 +- test-eclipses.py => test_eclipses.py | 4 +- test-julian.py => test_julian.py | 4 +- test-moon.py => test_moon.py | 4 +- ...t-binary.py => test_planet_comet_binary.py | 8 +- test-sun.py => test_sun.py | 4 +- test-time.py => test_time.py | 4 +- 366 files changed, 7684 insertions(+), 7917 deletions(-) create mode 100644 .gitignore create mode 100644 LICENSE delete mode 100755 cli-test.sh delete mode 100644 cli_lib/.gitignore delete mode 100644 cli_lib/pa_cli_datetime.py delete mode 100644 docs-gen/src/README.md rename docs/{python/lib_2README_8md.html => README_8md.html} (81%) rename docs/{python/docs-gen_2src_2README_8md.html => ____init_____8py.html} (69%) rename docs/{python => }/bc_s.png (100%) rename docs/{python => }/bdwn.png (100%) rename docs/{python => }/closed.png (100%) rename docs/{python/dir_97aefd0d527b934f1d99a682da8fe6a9.html => dir_45978790aec87fba6f3407586a078612.html} (86%) rename docs/{python/dir_97aefd0d527b934f1d99a682da8fe6a9.js => dir_45978790aec87fba6f3407586a078612.js} (90%) rename docs/{python/dir_3e90ebb34b98c37ddce7af954e777053.html => dir_68267d1309a1af8e8297ef4c3efbcdba.html} (77%) create mode 100644 docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js rename docs/{python => }/dir_8ebb4883bd5210c1437544ca4cb0df32.html (92%) rename docs/{python => }/doc.png (100%) rename docs/{python => }/doxygen.css (95%) create mode 100644 docs/doxygen.svg rename docs/{python => }/dynsections.js (71%) create mode 100644 docs/files.html create mode 100644 docs/files_dup.js rename docs/{python => }/folderclosed.png (100%) rename docs/{python => }/folderopen.png (100%) rename docs/{python => }/glossary_8md.html (92%) rename docs/{python => }/jquery.js (100%) rename docs/{python => }/md_src_glossary.html (99%) rename docs/{python => }/menu.js (54%) rename docs/{python => }/menudata.js (68%) rename docs/{python => }/namespacemembers.html (73%) rename docs/{python => }/namespacemembers_b.html (86%) rename docs/{python => }/namespacemembers_c.html (70%) rename docs/{python => }/namespacemembers_d.html (62%) rename docs/{python => }/namespacemembers_dup.js (100%) rename docs/{python => }/namespacemembers_e.html (54%) rename docs/{python => }/namespacemembers_f.html (81%) rename docs/{python => }/namespacemembers_func.html (72%) rename docs/{python => }/namespacemembers_func.js (100%) rename docs/{python => }/namespacemembers_func_b.html (89%) rename docs/{python => }/namespacemembers_func_c.html (74%) rename docs/{python => }/namespacemembers_func_d.html (61%) rename docs/{python => }/namespacemembers_func_e.html (53%) rename docs/{python => }/namespacemembers_func_f.html (80%) rename docs/{python => }/namespacemembers_func_g.html (67%) rename docs/{python => }/namespacemembers_func_h.html (74%) rename docs/{python => }/namespacemembers_func_i.html (86%) rename docs/{python => }/namespacemembers_func_j.html (72%) rename docs/{python => }/namespacemembers_func_k.html (89%) rename docs/{python => }/namespacemembers_func_l.html (65%) create mode 100644 docs/namespacemembers_func_m.html rename docs/{python => }/namespacemembers_func_n.html (78%) rename docs/{python => }/namespacemembers_func_o.html (89%) rename docs/{python => }/namespacemembers_func_p.html (62%) rename docs/{python => }/namespacemembers_func_r.html (70%) rename docs/{python => }/namespacemembers_func_s.html (50%) rename docs/{python => }/namespacemembers_func_t.html (76%) rename docs/{python => }/namespacemembers_func_u.html (54%) rename docs/{python => }/namespacemembers_func_v.html (89%) rename docs/{python => }/namespacemembers_g.html (67%) rename docs/{python => }/namespacemembers_h.html (74%) rename docs/{python => }/namespacemembers_i.html (86%) rename docs/{python => }/namespacemembers_j.html (72%) rename docs/{python => }/namespacemembers_k.html (89%) rename docs/{python => }/namespacemembers_l.html (66%) create mode 100644 docs/namespacemembers_m.html rename docs/{python => }/namespacemembers_n.html (79%) rename docs/{python => }/namespacemembers_o.html (89%) rename docs/{python => }/namespacemembers_p.html (61%) rename docs/{python => }/namespacemembers_r.html (71%) rename docs/{python => }/namespacemembers_s.html (51%) rename docs/{python => }/namespacemembers_t.html (77%) rename docs/{python => }/namespacemembers_u.html (54%) rename docs/{python => }/namespacemembers_v.html (89%) rename docs/{python => }/namespacemembers_vars.html (79%) create mode 100644 docs/namespacepractical__astronomy.html create mode 100644 docs/namespacepractical__astronomy.js rename docs/{python/namespacepa__binary.html => namespacepractical__astronomy_1_1pa__binary.html} (71%) rename docs/{python/namespacepa__binary__data.html => namespacepractical__astronomy_1_1pa__binary__data.html} (70%) rename docs/{python/namespacepa__comet.html => namespacepractical__astronomy_1_1pa__comet.html} (65%) rename docs/{python/namespacepa__comet__data.html => namespacepractical__astronomy_1_1pa__comet__data.html} (68%) rename docs/{python/namespacepa__coordinate.html => namespacepractical__astronomy_1_1pa__coordinate.html} (68%) rename docs/{python/namespacepa__datetime.html => namespacepractical__astronomy_1_1pa__datetime.html} (56%) rename docs/{python/namespacepa__eclipses.html => namespacepractical__astronomy_1_1pa__eclipses.html} (55%) rename docs/{python/namespacepa__macro.html => namespacepractical__astronomy_1_1pa__macro.html} (66%) rename docs/{python/namespacepa__moon.html => namespacepractical__astronomy_1_1pa__moon.html} (56%) rename docs/{python/namespacepa__planet.html => namespacepractical__astronomy_1_1pa__planet.html} (61%) rename docs/{python/namespacepa__planet__data.html => namespacepractical__astronomy_1_1pa__planet__data.html} (71%) rename docs/{python/namespacepa__sun.html => namespacepractical__astronomy_1_1pa__sun.html} (58%) rename docs/{python/namespacepa__util.html => namespacepractical__astronomy_1_1pa__util.html} (64%) create mode 100644 docs/namespaces.html create mode 100644 docs/namespaces_dup.js rename docs/{python => }/nav_f.png (100%) rename docs/{python => }/nav_g.png (100%) rename docs/{python => }/nav_h.png (100%) rename docs/{python => }/navtree.css (100%) rename docs/{python => }/navtree.js (91%) rename docs/{python => }/navtreedata.js (83%) rename docs/{python => }/navtreeindex0.js (56%) create mode 100644 docs/navtreeindex1.js create mode 100644 docs/navtreeindex2.js rename docs/{python => }/open.png (100%) rename docs/{python => }/pa__binary_8py.html (74%) create mode 100644 docs/pa__binary_8py.js rename docs/{python => }/pa__binary__data_8py.html (75%) rename docs/{python => }/pa__binary__data_8py.js (55%) rename docs/{python => }/pa__comet_8py.html (68%) create mode 100644 docs/pa__comet_8py.js rename docs/{python => }/pa__comet__data_8py.html (71%) rename docs/{python => }/pa__comet__data_8py.js (51%) create mode 100644 docs/pa__coordinate_8py.html create mode 100644 docs/pa__coordinate_8py.js create mode 100644 docs/pa__datetime_8py.html create mode 100644 docs/pa__datetime_8py.js rename docs/{python => }/pa__eclipses_8py.html (61%) create mode 100644 docs/pa__eclipses_8py.js create mode 100644 docs/pa__macro_8py.html create mode 100644 docs/pa__macro_8py.js rename docs/{python => }/pa__moon_8py.html (56%) create mode 100644 docs/pa__moon_8py.js rename docs/{python => }/pa__planet_8py.html (64%) create mode 100644 docs/pa__planet_8py.js rename docs/{python => }/pa__planet__data_8py.html (75%) rename docs/{python => }/pa__planet__data_8py.js (55%) rename docs/{python => }/pa__sun_8py.html (55%) create mode 100644 docs/pa__sun_8py.js rename docs/{python => }/pa__util_8py.html (69%) create mode 100644 docs/pa__util_8py.js rename docs/{python => }/pages.html (93%) delete mode 100644 docs/python/dir_3e90ebb34b98c37ddce7af954e777053.js delete mode 100644 docs/python/doxygen.png delete mode 100644 docs/python/files.html delete mode 100644 docs/python/files_dup.js delete mode 100644 docs/python/index.html delete mode 100644 docs/python/namespacemembers_func_m.html delete mode 100644 docs/python/namespacemembers_m.html delete mode 100644 docs/python/namespacepa__cli__datetime.html delete mode 100644 docs/python/namespaces.html delete mode 100644 docs/python/namespaces_dup.js delete mode 100644 docs/python/navtreeindex1.js delete mode 100644 docs/python/pa__binary_8py.js delete mode 100644 docs/python/pa__cli__datetime_8py.html delete mode 100644 docs/python/pa__cli__datetime_8py.js delete mode 100644 docs/python/pa__comet_8py.js delete mode 100644 docs/python/pa__coordinate_8py.html delete mode 100644 docs/python/pa__coordinate_8py.js delete mode 100644 docs/python/pa__datetime_8py.html delete mode 100644 docs/python/pa__datetime_8py.js delete mode 100644 docs/python/pa__eclipses_8py.js delete mode 100644 docs/python/pa__macro_8py.html delete mode 100644 docs/python/pa__macro_8py.js delete mode 100644 docs/python/pa__moon_8py.js delete mode 100644 docs/python/pa__planet_8py.js delete mode 100644 docs/python/pa__sun_8py.js delete mode 100644 docs/python/pa__util_8py.js delete mode 100644 docs/python/search/all_0.js delete mode 100644 docs/python/search/all_1.js delete mode 100644 docs/python/search/all_10.js delete mode 100644 docs/python/search/all_11.js delete mode 100644 docs/python/search/all_12.js delete mode 100644 docs/python/search/all_13.js delete mode 100644 docs/python/search/all_14.js delete mode 100644 docs/python/search/all_15.js delete mode 100644 docs/python/search/all_2.js delete mode 100644 docs/python/search/all_3.js delete mode 100644 docs/python/search/all_4.js delete mode 100644 docs/python/search/all_5.js delete mode 100644 docs/python/search/all_6.js delete mode 100644 docs/python/search/all_7.js delete mode 100644 docs/python/search/all_8.js delete mode 100644 docs/python/search/all_9.js delete mode 100644 docs/python/search/all_a.js delete mode 100644 docs/python/search/all_b.js delete mode 100644 docs/python/search/all_c.js delete mode 100644 docs/python/search/all_d.js delete mode 100644 docs/python/search/all_e.js delete mode 100644 docs/python/search/all_f.js delete mode 100644 docs/python/search/close.png delete mode 100644 docs/python/search/files_0.js delete mode 100644 docs/python/search/files_1.js delete mode 100644 docs/python/search/files_2.js delete mode 100644 docs/python/search/functions_0.js delete mode 100644 docs/python/search/functions_1.js delete mode 100644 docs/python/search/functions_10.js delete mode 100644 docs/python/search/functions_11.js delete mode 100644 docs/python/search/functions_12.js delete mode 100644 docs/python/search/functions_13.js delete mode 100644 docs/python/search/functions_14.js delete mode 100644 docs/python/search/functions_2.js delete mode 100644 docs/python/search/functions_3.js delete mode 100644 docs/python/search/functions_4.js delete mode 100644 docs/python/search/functions_5.js delete mode 100644 docs/python/search/functions_6.js delete mode 100644 docs/python/search/functions_7.js delete mode 100644 docs/python/search/functions_8.js delete mode 100644 docs/python/search/functions_9.js delete mode 100644 docs/python/search/functions_a.js delete mode 100644 docs/python/search/functions_b.js delete mode 100644 docs/python/search/functions_c.js delete mode 100644 docs/python/search/functions_d.js delete mode 100644 docs/python/search/functions_e.js delete mode 100644 docs/python/search/functions_f.js delete mode 100644 docs/python/search/mag_sel.png delete mode 100644 docs/python/search/namespaces_0.js delete mode 100644 docs/python/search/pages_0.js delete mode 100644 docs/python/search/pages_1.js delete mode 100644 docs/python/search/variables_0.js delete mode 100644 docs/python/search/variables_1.js delete mode 100644 docs/python/search/variables_2.js rename docs/{python => }/resize.js (72%) rename docs/{python => }/search/all_0.html (74%) create mode 100644 docs/search/all_0.js rename docs/{python => }/search/all_1.html (74%) create mode 100644 docs/search/all_1.js rename docs/{python => }/search/all_10.html (74%) create mode 100644 docs/search/all_10.js rename docs/{python => }/search/all_11.html (74%) create mode 100644 docs/search/all_11.js rename docs/{python => }/search/all_12.html (74%) create mode 100644 docs/search/all_12.js rename docs/{python => }/search/all_13.html (74%) create mode 100644 docs/search/all_13.js rename docs/{python => }/search/all_14.html (74%) create mode 100644 docs/search/all_14.js rename docs/{python => }/search/all_15.html (74%) create mode 100644 docs/search/all_15.js rename docs/{python => }/search/all_2.html (74%) create mode 100644 docs/search/all_2.js rename docs/{python => }/search/all_3.html (74%) create mode 100644 docs/search/all_3.js rename docs/{python => }/search/all_4.html (74%) create mode 100644 docs/search/all_4.js rename docs/{python => }/search/all_5.html (74%) create mode 100644 docs/search/all_5.js rename docs/{python => }/search/all_6.html (74%) create mode 100644 docs/search/all_6.js rename docs/{python => }/search/all_7.html (74%) create mode 100644 docs/search/all_7.js rename docs/{python => }/search/all_8.html (74%) create mode 100644 docs/search/all_8.js rename docs/{python => }/search/all_9.html (74%) create mode 100644 docs/search/all_9.js rename docs/{python => }/search/all_a.html (74%) create mode 100644 docs/search/all_a.js rename docs/{python => }/search/all_b.html (74%) create mode 100644 docs/search/all_b.js rename docs/{python => }/search/all_c.html (74%) create mode 100644 docs/search/all_c.js rename docs/{python => }/search/all_d.html (74%) create mode 100644 docs/search/all_d.js rename docs/{python => }/search/all_e.html (74%) create mode 100644 docs/search/all_e.js rename docs/{python => }/search/all_f.html (74%) create mode 100644 docs/search/all_f.js create mode 100644 docs/search/close.svg rename docs/{python => }/search/files_0.html (74%) create mode 100644 docs/search/files_0.js rename docs/{python => }/search/files_1.html (74%) create mode 100644 docs/search/files_1.js rename docs/{python => }/search/files_2.html (74%) create mode 100644 docs/search/files_2.js create mode 100644 docs/search/files_3.html create mode 100644 docs/search/files_3.js rename docs/{python => }/search/functions_0.html (74%) create mode 100644 docs/search/functions_0.js rename docs/{python => }/search/functions_1.html (74%) create mode 100644 docs/search/functions_1.js rename docs/{python => }/search/functions_10.html (74%) create mode 100644 docs/search/functions_10.js rename docs/{python => }/search/functions_11.html (74%) create mode 100644 docs/search/functions_11.js rename docs/{python => }/search/functions_12.html (74%) create mode 100644 docs/search/functions_12.js rename docs/{python => }/search/functions_13.html (74%) create mode 100644 docs/search/functions_13.js rename docs/{python => }/search/functions_14.html (74%) create mode 100644 docs/search/functions_14.js rename docs/{python => }/search/functions_2.html (74%) create mode 100644 docs/search/functions_2.js rename docs/{python => }/search/functions_3.html (74%) create mode 100644 docs/search/functions_3.js rename docs/{python => }/search/functions_4.html (74%) create mode 100644 docs/search/functions_4.js rename docs/{python => }/search/functions_5.html (74%) create mode 100644 docs/search/functions_5.js rename docs/{python => }/search/functions_6.html (74%) create mode 100644 docs/search/functions_6.js rename docs/{python => }/search/functions_7.html (74%) create mode 100644 docs/search/functions_7.js rename docs/{python => }/search/functions_8.html (74%) create mode 100644 docs/search/functions_8.js rename docs/{python => }/search/functions_9.html (74%) create mode 100644 docs/search/functions_9.js rename docs/{python => }/search/functions_a.html (74%) create mode 100644 docs/search/functions_a.js rename docs/{python => }/search/functions_b.html (74%) create mode 100644 docs/search/functions_b.js rename docs/{python => }/search/functions_c.html (74%) create mode 100644 docs/search/functions_c.js rename docs/{python => }/search/functions_d.html (74%) create mode 100644 docs/search/functions_d.js rename docs/{python => }/search/functions_e.html (74%) create mode 100644 docs/search/functions_e.js rename docs/{python => }/search/functions_f.html (74%) create mode 100644 docs/search/functions_f.js create mode 100644 docs/search/mag_sel.svg rename docs/{python => }/search/namespaces_0.html (74%) create mode 100644 docs/search/namespaces_0.js rename docs/{python => }/search/nomatches.html (86%) rename docs/{python => }/search/pages_0.html (74%) create mode 100644 docs/search/pages_0.js rename docs/{python => }/search/pages_1.html (74%) create mode 100644 docs/search/pages_1.js rename docs/{python => }/search/search.css (75%) rename docs/{python => }/search/search.js (91%) rename docs/{python => }/search/search_l.png (100%) rename docs/{python => }/search/search_m.png (100%) rename docs/{python => }/search/search_r.png (100%) rename docs/{python => }/search/searchdata.js (86%) rename docs/{python => }/search/variables_0.html (74%) create mode 100644 docs/search/variables_0.js rename docs/{python => }/search/variables_1.html (74%) create mode 100644 docs/search/variables_1.js rename docs/{python => }/search/variables_2.html (74%) create mode 100644 docs/search/variables_2.js rename docs/{python => }/splitbar.png (100%) rename docs/{python => }/sync_off.png (100%) rename docs/{python => }/sync_on.png (100%) rename docs/{python => }/tab_a.png (100%) rename docs/{python => }/tab_b.png (100%) rename docs/{python => }/tab_h.png (100%) rename docs/{python => }/tab_s.png (100%) rename docs/{python => }/tabs.css (100%) delete mode 100644 docs/w3.css delete mode 100644 lib/.gitignore delete mode 100644 lib/README.md delete mode 100755 pa-cli.py create mode 100644 pyproject.toml create mode 100644 src/practical_astronomy/__init__.py rename {lib => src/practical_astronomy}/pa_binary.py (100%) rename {lib => src/practical_astronomy}/pa_binary_data.py (100%) rename {lib => src/practical_astronomy}/pa_comet.py (100%) rename {lib => src/practical_astronomy}/pa_comet_data.py (100%) rename {lib => src/practical_astronomy}/pa_coordinate.py (100%) rename {lib => src/practical_astronomy}/pa_datetime.py (100%) rename {lib => src/practical_astronomy}/pa_eclipses.py (100%) rename {lib => src/practical_astronomy}/pa_macro.py (100%) rename {lib => src/practical_astronomy}/pa_moon.py (100%) rename {lib => src/practical_astronomy}/pa_planet.py (100%) rename {lib => src/practical_astronomy}/pa_planet_data.py (100%) rename {lib => src/practical_astronomy}/pa_sun.py (100%) rename {lib => src/practical_astronomy}/pa_util.py (100%) delete mode 100755 test.py rename test-coordinate.py => test_coordinate.py (99%) rename test-date-of-easter.py => test_date_of_easter.py (92%) rename test-day-number.py => test_day_number.py (88%) rename test-eclipses.py => test_eclipses.py (99%) rename test-julian.py => test_julian.py (96%) rename test-moon.py => test_moon.py (99%) rename test-planet-comet-binary.py => test_planet_comet_binary.py (98%) rename test-sun.py => test_sun.py (99%) rename test-time.py => test_time.py (98%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fea00e8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +dist/* + +src/practical_astronomy/__pycache__/* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..335ea9d --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018 The Python Packaging Authority + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/Makefile b/Makefile index eca032c..e80d5a3 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ +PYEXE = python3 + default: @echo 'Targets:' - @echo ' all' + @echo ' all-tests' @echo ' test-easter' @echo ' test-day-number' @echo ' test-julian' @@ -10,32 +12,44 @@ default: @echo ' test-planet-comet-binary' @echo ' test-moon' @echo ' test-eclipses' + @echo ' build' + @echo ' upload-test' + @echo ' upload' -all: test-easter test-day-number test-julian test-time test-coordinate test-sun test-planet-comet-binary test-moon test-eclipses +all-tests: test-easter test-day-number test-julian test-time test-coordinate test-sun test-planet-comet-binary test-moon test-eclipses test-easter: - @./test-date-of-easter.py -v + @$(PYEXE) test_date_of_easter.py test-day-number: - @./test-day-number.py + @$(PYEXE) test_day_number.py test-julian: - @./test-julian.py + @$(PYEXE) test_julian.py test-time: - @./test-time.py + @$(PYEXE) test_time.py test-coordinate: - @./test-coordinate.py + @$(PYEXE) test_coordinate.py test-sun: - @./test-sun.py + @$(PYEXE) test_sun.py test-planet-comet-binary: - @./test-planet-comet-binary.py + @$(PYEXE) test_planet_comet_binary.py test-moon: - @./test-moon.py + @$(PYEXE) test_moon.py test-eclipses: - @./test-eclipses.py \ No newline at end of file + @$(PYEXE) test_eclipses.py + +build: + $(PYEXE) -m build + +upload-test: build + $(PYEXE) -m twine upload --repository testpypi dist/* + +upload: build + $(PYEXE) -m twine upload dist/* diff --git a/README.md b/README.md index 796d1a0..dedc8e5 100644 --- a/README.md +++ b/README.md @@ -1,72 +1,117 @@ # practical-astronomy-python -Algorithms from "[Practical Astronomy with your Calculator or Spreadsheet](https://www.amazon.com/Practical-Astronomy-your-Calculator-Spreadsheet/dp/1108436072)" by Peter Duffett-Smith, implemented in Python 3. API documentation is published [here](https://jfcarr-astronomy.github.io/practical-astronomy-python/). +Algorithms from [Practical Astronomy with your Calculator or Spreadsheet](https://www.amazon.com/Practical-Astronomy-your-Calculator-Spreadsheet/dp/1108436072) by Peter Duffett-Smith, implemented in Python 3. API documentation is published [here](https://jfcarr.github.io/practical-astronomy-python/). If you're interested in this topic, please buy the book! It provides far more detail and context. -## CLI +## Quick Start -Work is started on a command-line interface, but only the date/time functions are implemented, so far. Results are formatted as JSON. - -Invoke as `./pa-cli.py -h` to see all of the options: +Install: +```bash +pip install practical-astronomy ``` -$ ./pa-cli.py -h - -usage: pa-cli.py [-h] [--cd CD] [--ct CT] [--dh DH] [--gd GD] [--gl GL] [--gst GST] [--lst LST] [--jd JD] [--ut UT] [--year YEAR] [--dst] [--st] [--zc ZC] [--doe] [--cd_to_dn] [--gd_to_jd] [--jd_to_gd] [--ct_to_dh] [--dh_to_ct] [--lct_to_ut] [--ut_to_lct] [--ut_to_gst] [--gst_to_ut] [--gst_to_lst] [--lst_to_gst] - -Practical Astronomy CLI. - -optional arguments: - -h, --help show this help message and exit - -Actions: - --doe Calculate date of Easter, for a given year. - --cd_to_dn Convert civil date to day number. - --gd_to_jd Convert Greenwich date to Julian date. - --jd_to_gd Convert Julian date to Greenwich date. - --ct_to_dh Convert civil time to decimal hours. - --dh_to_ct Convert decimal hours to civil time. - --lct_to_ut Convert local civil time to universal time. - --ut_to_lct Convert universal time to local civil time. - --ut_to_gst Convert universal time to Greenwich sidereal time. - --gst_to_ut Convert Greenwich sidereal time to universal time. - --gst_to_lst Convert Greenwich sidereal time to local sidereal time. - --lst_to_gst Convert local sidereal time to Greenwich sidereal time. - -Inputs (used by Actions): - --cd CD Civil date. Input format: 'mm/dd/yyyy' - --ct CT Civil time. Input format: 'hh:mm:ss' - --dh DH Decimal hours. Input format: floating point number, e.g., 18.52416667 - --gd GD Greenwich date. Input format: 'mm/dd/yyyy'. Fractional day is allowed, e.g., '6/19.75/2009' - --gl GL Geographical longitude. Input format: (+/-)##.##, e.g., -64.00 - --gst GST Greenwich sidereal time. Input format: 'hh:mm:ss' - --lst LST Local sidereal time. Input format: 'hh:mm:ss' - --jd JD Julian date. Input format: floating point number, e.g., 2455002.25 - --ut UT Universal time. Input format: 'hh:mm:ss' - --year YEAR Calendar year, e.g. 2019. - -Inputs (time zone management): - --dst Observe daylight savings time. - --st Observe standard time (default) - --zc ZC Offset, in hours, for time zone correction. -``` +Create `easter.py`: -### Example +```python +import practical_astronomy.pa_datetime as pd + +print(pd.get_date_of_easter(2024)) +``` -Convert universal time to Greenwich sidereal time: +Run it: +```bash +python easter.py ``` -$./pa-cli.py --ut_to_gst --ut "14:36:51.67" --gd "4/22/1980" -{"greenwichSiderealTimeHours": 4, "greenwichSiderealTimeMinutes": 40, "greenwichSiderealTimeSeconds": 5.23} +Result: + +``` +(3, 31, 2024) ``` ## Unit Tests -Unit test run can be invoked via the Make utility: +If you clone the [repo](https://github.com/jfcarr/practical-astronomy-python) locally, you can run unit tests with the Make utility: ``` -make all +make all-tests ``` + +## Library Functions + +Documentation [here](https://jfcarr.github.io/practical-astronomy-python/). + +### Date/Time + +Type | Description +-----|------------ +Calculate | Date of Easter +Convert | Civil Date to Day Number +Convert | Greenwich Date <-> Julian Date +Convert | Julian Date to Day-of-Week +Extract | Day, Month, and Year parts of Julian Date +Convert | Civil Time <-> Decimal Hours +Extract | Hour, Minutes, and Seconds parts of Decimal Hours +Convert | Local Civil Time <-> Universal Time +Convert | Universal Time <-> Greenwich Sidereal Time +Convert | Greenwich Sidereal Time <-> Local Sidereal Time + +### Coordinates + +Type | Description +-----|------------ +Convert | Angle <-> Decimal Degrees +Convert | Right Ascension <-> Hour Angle +Convert | Equatorial Coordinates <-> Horizon Coordinates +Calculate | Obliquity of the Ecliptic +Convert | Ecliptic Coordinates <-> Equatorial Coordinates +Convert | Equatorial Coordinates <-> Galactic Coordinates +Calculate | Angle between two objects +Calculate | Rising and Setting times for an object +Calculate | Precession (corrected coordinates between two epochs) +Calculate | Nutation (in ecliptic longitude and obliquity) for a Greenwich date +Calculate | Effects of aberration for ecliptic coordinates +Calculate | RA and Declination values, corrected for atmospheric refraction and geocentric parallax +Calculate | Heliographic coordinates +Calculate | Carrington rotation number +Calculate | Selenographic (lunar) coordinates (sub-Earth and sub-Solar) + +### The Sun + +Type | Description +-----|------------ +Calculate | Approximate and precise positions of the Sun +Calculate | Sun's distance and angular size +Calculate | Local sunrise and sunset +Calculate | Morning and evening twilight +Calculate | Equation of time +Calculate | Solar elongation + +### Planets + +Type | Description +-----|------------ +Calculate | Approximate and precise position of planet +Calculate | Visual aspects of planet (distance, angular diameter, phase, light time, position angle of bright limb, and apparent magnitude) +Calculate | Position of comet (elliptical and parabolic) +Calculate | Binary star orbit data + +### The Moon + +Type | Description +-----|------------ +Calculate | Approximate and precise position of Moon +Calculate | Moon phase and position angle of bright limb +Calculate | Times of new Moon and full Moon +Calculate | Moon's distance, angular diameter, and horizontal parallax +Calculate | Local moonrise and moonset + +### Eclipses + +Type | Description +-----|------------ +Calculate | Lunar eclipse occurrence and circumstances +Calculate | Solar eclipse occurrence and circumstances diff --git a/cli-test.sh b/cli-test.sh deleted file mode 100755 index 11eddf3..0000000 --- a/cli-test.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -./pa-cli.py --doe --year 2019 -./pa-cli.py --cd_to_dn --cd "2/1/2019" -./pa-cli.py --gd_to_jd --gd "6/19.75/2009" -./pa-cli.py --jd_to_gd --jd 2455002.25 -./pa-cli.py --ct_to_dh --ct "18:31:27" -./pa-cli.py --dh_to_ct --dh 18.52416667 -./pa-cli.py --lct_to_ut --cd "7/1/2013" --ct "3:37:00" --zc 4 --dst -./pa-cli.py --ut_to_lct --cd "6/30/2013" --ut "22:37:00" --zc 4 --dst -./pa-cli.py --ut_to_gst --ut "14:36:51.67" --gd "4/22/1980" -./pa-cli.py --gst_to_ut --gst "4:40:5.23" --gd "4/22/1980" -./pa-cli.py --gst_to_lst --gst "4:40:5.23" --gl -64 -./pa-cli.py --lst_to_gst --lst "0:24:5.23" --gl -64 \ No newline at end of file diff --git a/cli_lib/.gitignore b/cli_lib/.gitignore deleted file mode 100644 index 763624e..0000000 --- a/cli_lib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -__pycache__/* \ No newline at end of file diff --git a/cli_lib/pa_cli_datetime.py b/cli_lib/pa_cli_datetime.py deleted file mode 100644 index 61f3e34..0000000 --- a/cli_lib/pa_cli_datetime.py +++ /dev/null @@ -1,127 +0,0 @@ -import json -from dateutil.parser import parse -import lib.pa_datetime as PA_DT - -def doe_year(year): - ''' - Calculate date of Easter for a given year. - ''' - easter_month,easter_day,easter_year = PA_DT.get_date_of_easter(year) - easter_dict = dict(easterMonth=easter_month, easterDay=easter_day, easterYear=easter_year) - - print(json.dumps(easter_dict)) - -def cd_to_dn(date_string): - ''' - Convert civil date to day number. - ''' - dt = parse(date_string) - day_number = PA_DT.civil_date_to_day_number(dt.month, dt.day, dt.year) - day_num_dict = dict(dayNumber=day_number) - - print(json.dumps(day_num_dict)) - -def gd_to_jd(greenwich_date): - ''' - Convert Greenwich date to Julian date. - ''' - dt_split = greenwich_date.split("/") - - julian_date = PA_DT.greenwich_date_to_julian_date(float(dt_split[1]), int(dt_split[0]), int(dt_split[2])) - julian_date_dict = dict(julianDate=julian_date) - - print(json.dumps(julian_date_dict)) - -def jd_to_gd(julian_date): - ''' - Convert Julian date to Greenwich date. - ''' - day,month,year = PA_DT.julian_date_to_greenwich_date(julian_date) - greenwich_date_dict = dict(greenwichDay=day, greenwichMonth=month, greenwichYear=year) - - print(json.dumps(greenwich_date_dict)) - -def ct_to_dh(civil_time): - ''' - Convert civil time to decimal hours. - ''' - ct_split = civil_time.split(":") - - decimal_hours = PA_DT.civil_time_to_decimal_hours(int(ct_split[0]), int(ct_split[1]), int(ct_split[2])) - decimal_hours = round(decimal_hours,8) - decimal_hours_dict = dict(decimalHours=decimal_hours) - - print(json.dumps(decimal_hours_dict)) - -def dh_to_ct(decimal_hours): - ''' - Convert decimal hours to civil time. - ''' - hours,minutes,seconds = PA_DT.decimal_hours_to_civil_time(decimal_hours) - civil_time_dict = dict(civilTimeHours=hours, civilTimeMinutes=minutes, civilTimeSeconds=seconds) - - print(json.dumps(civil_time_dict)) - -def lct_to_ut(civil_date, civil_time, is_dst, zone_correction): - ''' - Convert local civil time to universal time. - ''' - cd_split = civil_date.split("/") - ct_split = civil_time.split(":") - ut_hours,ut_minutes,ut_seconds,gw_day,gw_month,gw_year = PA_DT.local_civil_time_to_universal_time(int(ct_split[0]), int(ct_split[1]), int(ct_split[2]), is_dst, zone_correction, int(cd_split[1]), int(cd_split[0]), int(cd_split[2])) - ut_dict = dict(utHours=ut_hours,utMinutes=ut_minutes,utSeconds=ut_seconds,greenwichDay=gw_day,greenwichMonth=gw_month,greenwichYear=gw_year) - - print(json.dumps(ut_dict)) - -def ut_to_lct(civil_date, universal_time, is_dst, zone_correction): - ''' - Convert universal time to local civil time. - ''' - cd_split = civil_date.split("/") - ut_split = universal_time.split(":") - lct_hours,lct_minutes,lct_seconds,gw_day,gw_month,gw_year = PA_DT.universal_time_to_local_civil_time(int(ut_split[0]), int(ut_split[1]), int(ut_split[2]), is_dst, zone_correction, int(cd_split[1]), int(cd_split[0]), int(cd_split[2])) - lct_dict = dict(lctHours=lct_hours,lctMinutes=lct_minutes,lctSeconds=lct_seconds,greenwichDay=gw_day,greenwichMonth=gw_month,greenwichYear=gw_year) - - print(json.dumps(lct_dict)) - -def ut_to_gst(universal_time, greenwich_date): - ''' - Convert Universal time to Greenwich sidereal time - ''' - ut_split = universal_time.split(":") - gd_split = greenwich_date.split("/") - gst_hours,gst_minutes,gst_seconds = PA_DT.universal_time_to_greenwich_sidereal_time(int(ut_split[0]), int(ut_split[1]), float(ut_split[2]), int(gd_split[1]), int(gd_split[0]), int(gd_split[2])) - gst_dict = dict(greenwichSiderealTimeHours=gst_hours, greenwichSiderealTimeMinutes=gst_minutes, greenwichSiderealTimeSeconds=gst_seconds) - - print(json.dumps(gst_dict)) - -def gst_to_ut(greenwich_sidereal_time, greenwich_date): - ''' - Convert Greenwich sidereal time to universal time - ''' - gst_split = greenwich_sidereal_time.split(":") - gd_split = greenwich_date.split("/") - ut_hours,ut_minutes,ut_seconds,status_message = PA_DT.greenwich_sidereal_time_to_universal_time(int(gst_split[0]),int(gst_split[1]),float(gst_split[2]),int(gd_split[1]),int(gd_split[0]),int(gd_split[2])) - ut_dict = dict(utHours=ut_hours,utMinutes=ut_minutes,utSeconds=ut_seconds,statusMessage=status_message) - - print(json.dumps(ut_dict)) - -def gst_to_lst(greenwich_sidereal_time, geographical_longitude): - ''' - Convert Greenwich sidereal time to local sidereal time - ''' - gst_split = greenwich_sidereal_time.split(":") - lst_hours,lst_minutes,lst_seconds = PA_DT.greenwich_sidereal_time_to_local_sidereal_time(int(gst_split[0]), int(gst_split[1]), float(gst_split[2]), geographical_longitude) - lst_dict = dict(lstHours=lst_hours,lstMinutes=lst_minutes,lstSeconds=lst_seconds) - - print(json.dumps(lst_dict)) - -def lst_to_gst(local_sidereal_time, geographical_longitude): - ''' - Convert local sidereal time to Greenwich sidereal time - ''' - lst_split = local_sidereal_time.split(":") - gst_hours,gst_minutes,gst_seconds = PA_DT.local_sidereal_time_to_greenwich_sidereal_time(int(lst_split[0]),int(lst_split[1]),float(lst_split[2]),geographical_longitude) - gst_dict = dict(gstHours=gst_hours,gstMinutes=gst_minutes,gstSeconds=gst_seconds) - - print(json.dumps(gst_dict)) diff --git a/docs-gen/Doxyfile b/docs-gen/Doxyfile index d97f78d..60642a8 100644 --- a/docs-gen/Doxyfile +++ b/docs-gen/Doxyfile @@ -7,12 +7,12 @@ OPTIMIZE_OUTPUT_VHDL = NO EXTRACT_ALL = YES EXTRACT_PRIVATE = YES HIDE_SCOPE_NAMES = YES -INPUT = src ../lib ../cli_lib +INPUT = src ../src/practical_astronomy ../README.md USE_MDFILE_AS_MAINPAGE = README.md RECURSIVE = YES EXAMPLE_PATTERNS = * GENERATE_HTML = YES -HTML_OUTPUT = docs/python +HTML_OUTPUT = docs DOCSET_FEEDNAME = "Doxygen generated docs" DOCSET_BUNDLE_ID = org.doxygen.Project DOCSET_PUBLISHER_ID = org.doxygen.Publisher diff --git a/docs-gen/Makefile b/docs-gen/Makefile index 7f696ed..4556358 100644 --- a/docs-gen/Makefile +++ b/docs-gen/Makefile @@ -4,9 +4,10 @@ default: @echo ' build-python Build documentation from Python sources.' view: build-python - @firefox ../docs/python/index.html & + @firefox ../docs/index.html & build-python: - @-rm -rf ../docs/python + @-rm -rf ../docs + @mkdir ../docs @doxygen diff --git a/docs-gen/src/README.md b/docs-gen/src/README.md deleted file mode 100644 index 4d95a27..0000000 --- a/docs-gen/src/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Welcome - -Welcome to the documentation for Practical Astronomy. - -This is an ongoing effort to implement, in Python 3, algorithms and spreadsheet functions from [Practical Astronomy with your Calculator or Spreadsheet](https://www.amazon.com/Practical-Astronomy-your-Calculator-Spreadsheet/dp/1108436072) by Peter Duffett-Smith. If you're interested in this topic, please buy the book! It provides far more detail and context. diff --git a/docs/python/lib_2README_8md.html b/docs/README_8md.html similarity index 81% rename from docs/python/lib_2README_8md.html rename to docs/README_8md.html index f642a96..c846f55 100644 --- a/docs/python/lib_2README_8md.html +++ b/docs/README_8md.html @@ -3,9 +3,9 @@ - + -Practical Astronomy: /home/jimc/projects/practical-astronomy-python/lib/README.md File Reference +Practical Astronomy: /home/jimc/projects/Practical Astronomy/practical-astronomy-python-venv/practical-astronomy-python/README.md File Reference @@ -33,10 +33,10 @@ - + @@ -62,7 +62,7 @@
@@ -82,7 +82,7 @@
-
/home/jimc/projects/practical-astronomy-python/lib/README.md File Reference
+
/home/jimc/projects/Practical Astronomy/practical-astronomy-python-venv/practical-astronomy-python/README.md File Reference
@@ -90,10 +90,8 @@ diff --git a/docs/python/docs-gen_2src_2README_8md.html b/docs/____init_____8py.html similarity index 69% rename from docs/python/docs-gen_2src_2README_8md.html rename to docs/____init_____8py.html index 9f52fd5..52d5625 100644 --- a/docs/python/docs-gen_2src_2README_8md.html +++ b/docs/____init_____8py.html @@ -3,9 +3,9 @@ - + -Practical Astronomy: src/README.md File Reference +Practical Astronomy: /home/jimc/projects/Practical Astronomy/practical-astronomy-python-venv/practical-astronomy-python/src/practical_astronomy/__init__.py File Reference @@ -33,10 +33,10 @@ - + @@ -62,7 +62,7 @@
@@ -81,19 +81,25 @@
+
-
src/README.md File Reference
+
__init__.py File Reference
+ + + + +

+Namespaces

 practical_astronomy
 
diff --git a/docs/python/bc_s.png b/docs/bc_s.png similarity index 100% rename from docs/python/bc_s.png rename to docs/bc_s.png diff --git a/docs/python/bdwn.png b/docs/bdwn.png similarity index 100% rename from docs/python/bdwn.png rename to docs/bdwn.png diff --git a/docs/python/closed.png b/docs/closed.png similarity index 100% rename from docs/python/closed.png rename to docs/closed.png diff --git a/docs/python/dir_97aefd0d527b934f1d99a682da8fe6a9.html b/docs/dir_45978790aec87fba6f3407586a078612.html similarity index 86% rename from docs/python/dir_97aefd0d527b934f1d99a682da8fe6a9.html rename to docs/dir_45978790aec87fba6f3407586a078612.html index a988023..f2d31c3 100644 --- a/docs/python/dir_97aefd0d527b934f1d99a682da8fe6a9.html +++ b/docs/dir_45978790aec87fba6f3407586a078612.html @@ -3,9 +3,9 @@ - + -Practical Astronomy: /home/jimc/projects/practical-astronomy-python/lib Directory Reference +Practical Astronomy: /home/jimc/projects/Practical Astronomy/practical-astronomy-python-venv/practical-astronomy-python/src/practical_astronomy Directory Reference @@ -33,10 +33,10 @@ - + @@ -62,7 +62,7 @@
@@ -82,12 +82,14 @@
-
lib Directory Reference
+
practical_astronomy Directory Reference
+ + @@ -120,10 +122,8 @@ diff --git a/docs/python/dir_97aefd0d527b934f1d99a682da8fe6a9.js b/docs/dir_45978790aec87fba6f3407586a078612.js similarity index 90% rename from docs/python/dir_97aefd0d527b934f1d99a682da8fe6a9.js rename to docs/dir_45978790aec87fba6f3407586a078612.js index f2db565..402252e 100644 --- a/docs/python/dir_97aefd0d527b934f1d99a682da8fe6a9.js +++ b/docs/dir_45978790aec87fba6f3407586a078612.js @@ -1,5 +1,6 @@ -var dir_97aefd0d527b934f1d99a682da8fe6a9 = +var dir_45978790aec87fba6f3407586a078612 = [ + [ "__init__.py", "____init_____8py.html", null ], [ "pa_binary.py", "pa__binary_8py.html", "pa__binary_8py" ], [ "pa_binary_data.py", "pa__binary__data_8py.html", "pa__binary__data_8py" ], [ "pa_comet.py", "pa__comet_8py.html", "pa__comet_8py" ], diff --git a/docs/python/dir_3e90ebb34b98c37ddce7af954e777053.html b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html similarity index 77% rename from docs/python/dir_3e90ebb34b98c37ddce7af954e777053.html rename to docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html index f77eedb..4984de5 100644 --- a/docs/python/dir_3e90ebb34b98c37ddce7af954e777053.html +++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -3,9 +3,9 @@ - + -Practical Astronomy: /home/jimc/projects/practical-astronomy-python/cli_lib Directory Reference +Practical Astronomy: /home/jimc/projects/Practical Astronomy/practical-astronomy-python-venv/practical-astronomy-python/src Directory Reference @@ -33,10 +33,10 @@

Files

file  __init__.py
 
file  pa_binary.py
 
file  pa_binary_data.py
- + @@ -62,7 +62,7 @@
@@ -82,13 +82,13 @@
-
cli_lib Directory Reference
+
src Directory Reference
- - + +

-Files

file  pa_cli_datetime.py

+Directories

directory  practical_astronomy
 
@@ -96,10 +96,8 @@ diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js new file mode 100644 index 0000000..a2fe9e3 --- /dev/null +++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js @@ -0,0 +1,4 @@ +var dir_68267d1309a1af8e8297ef4c3efbcdba = +[ + [ "practical_astronomy", "dir_45978790aec87fba6f3407586a078612.html", "dir_45978790aec87fba6f3407586a078612" ] +]; \ No newline at end of file diff --git a/docs/python/dir_8ebb4883bd5210c1437544ca4cb0df32.html b/docs/dir_8ebb4883bd5210c1437544ca4cb0df32.html similarity index 92% rename from docs/python/dir_8ebb4883bd5210c1437544ca4cb0df32.html rename to docs/dir_8ebb4883bd5210c1437544ca4cb0df32.html index 7b4e3c6..978e0ef 100644 --- a/docs/python/dir_8ebb4883bd5210c1437544ca4cb0df32.html +++ b/docs/dir_8ebb4883bd5210c1437544ca4cb0df32.html @@ -3,7 +3,7 @@ - + Practical Astronomy: src Directory Reference @@ -33,10 +33,10 @@ - + @@ -91,9 +91,7 @@ diff --git a/docs/python/doc.png b/docs/doc.png similarity index 100% rename from docs/python/doc.png rename to docs/doc.png diff --git a/docs/python/doxygen.css b/docs/doxygen.css similarity index 95% rename from docs/python/doxygen.css rename to docs/doxygen.css index 73ecbb2..ffbff02 100644 --- a/docs/python/doxygen.css +++ b/docs/doxygen.css @@ -1,4 +1,4 @@ -/* The standard CSS for doxygen 1.8.17 */ +/* The standard CSS for doxygen 1.9.1 */ body, table, div, p, dl { font: 400 14px/22px Roboto,sans-serif; @@ -66,7 +66,7 @@ p.startli, p.startdd { margin-top: 2px; } -th p.starttd, p.intertd, p.endtd { +th p.starttd, th p.intertd, th p.endtd { font-size: 100%; font-weight: 700; } @@ -103,30 +103,96 @@ caption { } span.legend { - font-size: 70%; - text-align: center; + font-size: 70%; + text-align: center; } h3.version { - font-size: 90%; - text-align: center; + font-size: 90%; + text-align: center; } -div.qindex, div.navtab{ - background-color: #EBEFF6; - border: 1px solid #A3B4D7; - text-align: center; +div.navtab { + border-right: 1px solid #A3B4D7; + padding-right: 15px; + text-align: right; + line-height: 110%; +} + +div.navtab table { + border-spacing: 0; } -div.qindex, div.navpath { +td.navtab { + padding-right: 6px; + padding-left: 6px; +} +td.navtabHL { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL a, td.navtabHL a:visited { + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +a.navtab { + font-weight: bold; +} + +div.qindex{ + text-align: center; width: 100%; line-height: 140%; + font-size: 130%; + color: #A0A0A0; } -div.navtab { - margin-right: 15px; +dt.alphachar{ + font-size: 180%; + font-weight: bold; +} + +.alphachar a{ + color: black; +} + +.alphachar a:hover, .alphachar a:visited{ + text-decoration: none; +} + +.classindex dl { + padding: 25px; + column-count:1 +} + +.classindex dd { + display:inline-block; + margin-left: 50px; + width: 90%; + line-height: 1.15em; +} + +.classindex dl.odd { + background-color: #F8F9FC; +} + +@media(min-width: 1120px) { + .classindex dl { + column-count:2 + } +} + +@media(min-width: 1320px) { + .classindex dl { + column-count:3 + } } + /* @group Link Styling */ a { @@ -143,17 +209,6 @@ a:hover { text-decoration: underline; } -a.qindex { - font-weight: bold; -} - -a.qindexHL { - font-weight: bold; - background-color: #9CAFD4; - color: #FFFFFF; - border: 1px double #869DCA; -} - .contents a.qindexHL:visited { color: #FFFFFF; } @@ -1358,10 +1413,12 @@ dl.citelist dt { font-weight:bold; margin-right:10px; padding:5px; + text-align:right; + width:52px; } dl.citelist dd { - margin:2px 0; + margin:2px 0 2px 72px; padding:5px 0; } @@ -1424,6 +1481,12 @@ div.toc li.level4 { margin-left: 45px; } +span.emoji { + /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html + * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; + */ +} + .PageDocRTL-title div.toc li.level1 { margin-left: 0 !important; margin-right: 0; @@ -1661,47 +1724,6 @@ tr.heading h2 { /* @group Markdown */ -/* -table.markdownTable { - border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; -} - -table.markdownTable td, table.markdownTable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -table.markdownTableHead tr { -} - -table.markdownTableBodyLeft td, table.markdownTable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone { - background-color: #374F7F; - color: #FFFFFF; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; -} - -th.markdownTableHeadLeft { - text-align: left -} - -th.markdownTableHeadRight { - text-align: right -} - -th.markdownTableHeadCenter { - text-align: center -} -*/ - table.markdownTable { border-collapse:collapse; margin-top: 4px; diff --git a/docs/doxygen.svg b/docs/doxygen.svg new file mode 100644 index 0000000..d42dad5 --- /dev/null +++ b/docs/doxygen.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/python/dynsections.js b/docs/dynsections.js similarity index 71% rename from docs/python/dynsections.js rename to docs/dynsections.js index ea0a7b3..3174bd7 100644 --- a/docs/python/dynsections.js +++ b/docs/dynsections.js @@ -1,25 +1,26 @@ /* - @licstart The following is the entire license notice for the - JavaScript code in this file. + @licstart The following is the entire license notice for the JavaScript code in this file. - Copyright (C) 1997-2017 by Dimitri van Heesch + The MIT License (MIT) - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + Copyright (C) 1997-2020 by Dimitri van Heesch - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. - @licend The above is the entire license notice - for the JavaScript code in this file + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file */ function toggleVisibility(linkObj) { diff --git a/docs/files.html b/docs/files.html new file mode 100644 index 0000000..38c671e --- /dev/null +++ b/docs/files.html @@ -0,0 +1,118 @@ + + + + + + + +Practical Astronomy: File List + + + + + + + + + + + + + +
+
+ + + + + + +
+
Practical Astronomy +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
File List
+
+
+
Here is a list of all files with brief descriptions:
+
+
+ + + + diff --git a/docs/files_dup.js b/docs/files_dup.js new file mode 100644 index 0000000..e31f28e --- /dev/null +++ b/docs/files_dup.js @@ -0,0 +1,5 @@ +var files_dup = +[ + [ "src", "dir_8ebb4883bd5210c1437544ca4cb0df32.html", null ], + [ "src", "dir_68267d1309a1af8e8297ef4c3efbcdba.html", "dir_68267d1309a1af8e8297ef4c3efbcdba" ] +]; \ No newline at end of file diff --git a/docs/python/folderclosed.png b/docs/folderclosed.png similarity index 100% rename from docs/python/folderclosed.png rename to docs/folderclosed.png diff --git a/docs/python/folderopen.png b/docs/folderopen.png similarity index 100% rename from docs/python/folderopen.png rename to docs/folderopen.png diff --git a/docs/python/glossary_8md.html b/docs/glossary_8md.html similarity index 92% rename from docs/python/glossary_8md.html rename to docs/glossary_8md.html index 730b5c0..1b8cdbc 100644 --- a/docs/python/glossary_8md.html +++ b/docs/glossary_8md.html @@ -3,7 +3,7 @@ - + Practical Astronomy: src/glossary.md File Reference @@ -33,10 +33,10 @@ - + @@ -91,9 +91,7 @@ diff --git a/docs/index.html b/docs/index.html index 046a73f..2f624b6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,22 +1,239 @@ - - + + + + + + + +Practical Astronomy: practical-astronomy-python + + + + + + + + + + + + + +
+
+ + + + + + +
+
Practical Astronomy +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
- - API documentation for Practical Astronomy - - - - - -
-
-

API documentation for Practical Astronomy

- - -
-
- + +
+ +
+
+
+
practical-astronomy-python
+
+
+

Algorithms from Practical Astronomy with your Calculator or Spreadsheet by Peter Duffett-Smith, implemented in Python 3. API documentation is published here.

+

If you're interested in this topic, please buy the book! It provides far more detail and context.

+

+Quick Start

+

Install:

+
pip install practical-astronomy
+

Create easter.py:

+
import practical_astronomy.pa_datetime as pd
+
+
print(pd.get_date_of_easter(2024))
+

Run it:

+
python easter.py
+

Result:

+
(3, 31, 2024)
+

+Unit Tests

+

If you clone the repo locally, you can run unit tests with the Make utility:

+
make all-tests
+

+Library Functions

+

Documentation here.

+

+Date/Time

+ + + + + + + + + + + + + + + + + + + + + + + +
Type Description
Calculate Date of Easter
Convert Civil Date to Day Number
Convert Greenwich Date <-> Julian Date
Convert Julian Date to Day-of-Week
Extract Day, Month, and Year parts of Julian Date
Convert Civil Time <-> Decimal Hours
Extract Hour, Minutes, and Seconds parts of Decimal Hours
Convert Local Civil Time <-> Universal Time
Convert Universal Time <-> Greenwich Sidereal Time
Convert Greenwich Sidereal Time <-> Local Sidereal Time
+

+Coordinates

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Type Description
Convert Angle <-> Decimal Degrees
Convert Right Ascension <-> Hour Angle
Convert Equatorial Coordinates <-> Horizon Coordinates
Calculate Obliquity of the Ecliptic
Convert Ecliptic Coordinates <-> Equatorial Coordinates
Convert Equatorial Coordinates <-> Galactic Coordinates
Calculate Angle between two objects
Calculate Rising and Setting times for an object
Calculate Precession (corrected coordinates between two epochs)
Calculate Nutation (in ecliptic longitude and obliquity) for a Greenwich date
Calculate Effects of aberration for ecliptic coordinates
Calculate RA and Declination values, corrected for atmospheric refraction and geocentric parallax
Calculate Heliographic coordinates
Calculate Carrington rotation number
Calculate Selenographic (lunar) coordinates (sub-Earth and sub-Solar)
+

+The Sun

+ + + + + + + + + + + + + + + +
Type Description
Calculate Approximate and precise positions of the Sun
Calculate Sun's distance and angular size
Calculate Local sunrise and sunset
Calculate Morning and evening twilight
Calculate Equation of time
Calculate Solar elongation
+

+Planets

+ + + + + + + + + + + +
Type Description
Calculate Approximate and precise position of planet
Calculate Visual aspects of planet (distance, angular diameter, phase, light time, position angle of bright limb, and apparent magnitude)
Calculate Position of comet (elliptical and parabolic)
Calculate Binary star orbit data
+

+The Moon

+ + + + + + + + + + + + + +
Type Description
Calculate Approximate and precise position of Moon
Calculate Moon phase and position angle of bright limb
Calculate Times of new Moon and full Moon
Calculate Moon's distance, angular diameter, and horizontal parallax
Calculate Local moonrise and moonset
+

+Eclipses

+ + + + + + + +
Type Description
Calculate Lunar eclipse occurrence and circumstances
Calculate Solar eclipse occurrence and circumstances
+
+
+
+ + + diff --git a/docs/python/jquery.js b/docs/jquery.js similarity index 100% rename from docs/python/jquery.js rename to docs/jquery.js diff --git a/docs/python/md_src_glossary.html b/docs/md_src_glossary.html similarity index 99% rename from docs/python/md_src_glossary.html rename to docs/md_src_glossary.html index 6d5d7d3..033eefb 100644 --- a/docs/python/md_src_glossary.html +++ b/docs/md_src_glossary.html @@ -3,7 +3,7 @@ - + Practical Astronomy: Glossary of Terms @@ -33,10 +33,10 @@ - + @@ -490,9 +490,7 @@

diff --git a/docs/python/menu.js b/docs/menu.js similarity index 54% rename from docs/python/menu.js rename to docs/menu.js index 433c15b..2fe2214 100644 --- a/docs/python/menu.js +++ b/docs/menu.js @@ -1,25 +1,26 @@ /* - @licstart The following is the entire license notice for the - JavaScript code in this file. + @licstart The following is the entire license notice for the JavaScript code in this file. - Copyright (C) 1997-2017 by Dimitri van Heesch + The MIT License (MIT) - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + Copyright (C) 1997-2020 by Dimitri van Heesch - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. - @licend The above is the entire license notice - for the JavaScript code in this file + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file */ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { function makeTree(data,relPath) { @@ -40,9 +41,9 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); if (searchEnabled) { if (serverSide) { - $('#main-menu').append('
  • '); + $('#main-menu').append('
  • '); } else { - $('#main-menu').append('
  • '); + $('#main-menu').append('
  • '); } } $('#main-menu').smartmenus(); diff --git a/docs/python/menudata.js b/docs/menudata.js similarity index 68% rename from docs/python/menudata.js rename to docs/menudata.js index aa4b592..feb5d5a 100644 --- a/docs/python/menudata.js +++ b/docs/menudata.js @@ -1,24 +1,26 @@ /* -@licstart The following is the entire license notice for the -JavaScript code in this file. + @licstart The following is the entire license notice for the JavaScript code in this file. -Copyright (C) 1997-2019 by Dimitri van Heesch + The MIT License (MIT) -This program is free software; you can redistribute it and/or modify -it under the terms of version 2 of the GNU General Public License as published by -the Free Software Foundation + Copyright (C) 1997-2020 by Dimitri van Heesch -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. -@licend The above is the entire license notice -for the JavaScript code in this file + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file */ var menudata={children:[ {text:"Main Page",url:"index.html"}, diff --git a/docs/python/namespacemembers.html b/docs/namespacemembers.html similarity index 73% rename from docs/python/namespacemembers.html rename to docs/namespacemembers.html index 1d9f095..8a87839 100644 --- a/docs/python/namespacemembers.html +++ b/docs/namespacemembers.html @@ -3,7 +3,7 @@ - + Practical Astronomy: Package Functions @@ -33,10 +33,10 @@ - + @@ -85,28 +85,28 @@

    - a -

    @@ -114,9 +114,7 @@

    - a -