Commit Graph

15 Commits

Author SHA1 Message Date
Don Cross
bbaf5bf544 Added Python demo: solar_eclipse.py
This demo calculates the next 10 solar eclipses that are
visible from a given location on the Earth, after a given date.
2023-10-03 11:17:32 -04:00
Don Cross
c7095c5038 Added Python demo ecliptic_of_date.
The demo program ecliptic_of_date.py shows how to
calculate the true ecliptic of date (ECT) angular coordinates
of the Sun, Moon, and planets for an observer somewhere on the Earth.
It calculates the equatorial of date (EQD) coordinates, then uses
a rotation matrix to convert the vector to ECT, then converts
the vector to spherical coordinates: latitude, longitude, and distance.
2023-10-02 16:36:56 -04:00
Don Cross
0be053325a Fixed bug in camera.py demo: incorrect angle for sunlit side of Moon. 2023-03-24 22:06:45 -04:00
Don Cross
42c352f918 PY: true solar time demo 2023-02-12 16:28:37 -05:00
Don Cross
a9b9652c5d Added sample Python program stars_near_moon.py.
Tonight as I was walking outside, I saw a fairly bright
star about half a degree away from the edge of the Moon.
I wondered what it was, so I decided to write a quick
program to find out.

This Python demo program scans the HYG Database
(https://github.com/astronexus/HYG-Database)
to find which bright stars are within a small angular
distance of the Moon, as seen at a given time, latitude, and longitude.

It turns out the star I saw was Nunki (Sigma Sagittarii).

It was handy to do vector subtraction to implement this program,
and it was trivial to do in the Python code's Vector class,
so I went ahead and added that.
2021-11-08 21:44:36 -05:00
Don Cross
aa2eb01dbf Python ObserverGravity function. 2021-07-19 22:09:49 -04:00
Don Cross
2aa26aba78 Python: implemented VectorObserver function.
I already had the function ObserverVector that converts geographic
coordinates (latitude, longitude, elevation) to an equatorial-of-date
(EQD) vector.

Now I'm in the process of adding the inverse function VectorObserver
that calculates geographic coordinates from an EQD vector.
This commit implements VectorObserver in Python.
The other languages will follow in future commits.

The motivation was from the following request:
https://github.com/cosinekitty/geocalc/issues/1
The goal is to find the near-intersection between two different lines
of sight from two different observers on the Earth's surface.
Added a demo program triangulate.py that solves this problem.
2021-06-20 10:57:12 -04:00
Don Cross
b9daddd04c Added demo program galactic.py.
This is the Python version of a demo to convert
galactic coordinates to horizontal coordinates for
a given time and geographic location.
2021-06-14 12:29:33 -04:00
Don Cross
b81a96cbdc Fixed #100 - Demo of searching for constellation change.
Added Python demo constellation.py that shows how to search
for when a body crosses the border between two constellations.
2021-04-30 20:00:52 -04:00
Don Cross
c7a48093c0 Fixed #101 - Added Python example of searching for lunar angle events with other bodies.
Finished the script demos/python/lunar_angles.py
that shows how to search for times when the Moon and other
solar system bodies reach apparent ecliptic longitude separations
as seen from the Earth.

This is also a good demo of how to perform a custom search
for events using Astronomy Engine. This is the same technique
used internally by Astronomy Engine to search for lunar phases,
eclipses, solstices, etc.
2021-04-28 12:29:01 -04:00
Don Cross
5a8daba7d5 Added Python demo of calculating Jupiter's moons.
The demo shows how to correct for light travel
time to render Jupiter's moons as they appear
from the Earth.

Created an addition operator for the Vector
class in the Python code, because it is handy.

Corrected a bug in the string representation
of the Python StateVector class.
2021-04-15 20:54:37 -04:00
Don Cross
a97fc7da9c Ported IdentityMatrix, Pivot functions to Python. Added tests and camera demo. 2021-03-27 05:19:27 -04:00
Don Cross
78e68354b0 Added Python demo for calculating lunar eclipses. 2020-05-16 22:14:55 -04:00
Don Cross
4db8c66775 Python: Ported example of finding intersection of ecliptic and horizon. 2019-12-19 13:14:37 -05:00
Don Cross
91aafeaba7 Starting to add Python demo programs.
Created skeleton test harness for validating the demo programs.
Created stub moonphase.py.
Copied correct demo program outputs from nodejs; will tweak as needed.
Call the Python demo test harness from the 'run' script.
2019-07-26 16:49:48 -04:00