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

Leap Seconds for 2022 and future #152

Closed wewa00 closed 2 years ago

wewa00 commented 2 years ago

Hi, is it possible to add the leap seconds for 2022 and the upcoming years please ?

Message : UserWarning: I don't know about leap seconds after 2021 warnings.warn \

Thank you very much !

pingswept commented 2 years ago

The 2022 leap second data has been added to the latest code; you’ll have to figure out how to upgrade to that, or just add (0,0) to solartime.py by hand. Here it is: https://github.com/pingswept/pysolar/blob/5e4796604b4c7b38713f19faa5843b1569dd6ead/pysolar/solartime.py#L92

We can’t add future adjustments because we don’t know how much the earth will slow down yet. It’s affected by tidal sloshing, glacial rebound, and other things that I don’t know about. For reference: https://en.wikipedia.org/wiki/Leap_second