pingswept / pysolar

Pysolar is a collection of Python libraries for simulating the irradiation of any point on earth by the sun. It includes code for extremely precise ephemeris calculations.
http://pysolar.org
GNU General Public License v3.0
372 stars 125 forks source link

B.C. compatible dates for sun position? #151

Closed caviri closed 1 year ago

caviri commented 2 years ago

Hello, I am working on an archeological project and I would like to calculate the sun's position from a specific coordinate and time. The year I would like to solve is around -4000. I installed the package but, I can't use B.C. dated with datetime package. Could the algorithm implemented in pysolar estimate the sun position for this case?

Thanks in advance!

pingswept commented 2 years ago

I don't think there's an easy way to do this, but it's not impossible.

Internally, pysolar uses the Julian calendar, which is good to around 4700 BC. If you could figure out the dates and times of interest in the Julian calendar, a decent Python programmer could modify Pysolar (somewhere around here: https://github.com/pingswept/pysolar/blob/master/pysolar/solar.py#L64) to read in your Julian dates instead of calculating the Julian dates using the datetime package.

Good luck! Sounds like a cool thing to try.