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
373 stars 125 forks source link

Noticed Bad solar elevation coming from pysolar 0.6 #99

Closed thomasBrummet closed 5 years ago

thomasBrummet commented 5 years ago

I noticed a bad solar zenith coming from one particular time from the .6 version of pysolar. Below I've attached a time series of solar elevations for a 20 minute period, with the questionable value in bold . . Datetime SolarZenith 109493 2018-05-22 01:25:00 -7.066446 109494 2018-05-22 01:30:00 -6.078767 109495 2018-05-22 01:35:00 11.184133 109496 2018-05-22 01:40:00 -3.919527 109497 2018-05-22 01:45:00 -2.632823

Here is the line of code and output for both pysolar .6 and pysolar .8. Value returned from pysolar 0.8 . . .

solar.get_altitude(29.2044, 47.0528, pd.to_datetime(1526952900, unit='s',utc=True)) -5.048541631380446

Value returned from pysolar 0.6

solar.GetAltitude(29.2044, 47.0528, pd.to_datetime(1526952900, unit='s', utc=True)) 11.184133489077634

The value from 0.8 looks good, but there is clearly a problem with .6.

pingswept commented 5 years ago

Looks like a bug, but given that it's been fixed several releases ago, and nobody seems interested in backporting our newer code to Python 2, I'm closing this.