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

Sun position at high elevations #67

Closed jonas-hagen closed 6 years ago

jonas-hagen commented 6 years ago

(I am using the master branch version.)

I am trying to get sunrise and sunset times in high elevations (up to 100 km above sea level). As the get_{altitude|position}() functions take an elevation argument, I would expect them to return a different value for sun altitude, based on the given elevation.

>>> import datetime
>>> from pysolar import solar
>>> sunrise_time = datetime.datetime(2018,3,12,6,55,0)
>>> solar.get_position(46.95, 7.47, sunrise_time, elevation=100000)
(95.03439124507312, 0.5961510806209467)
>>> solar.get_position(46.95, 7.47, sunrise_time, elevation=0)
(95.03439124029069, 0.596183960394498)

The difference between the two altitudes is in the order of 3e-5 and thus much less than expected. What is the elevation parameter and how could I get the sun altitude in arbitrary elevations?

pingswept commented 6 years ago

Answered (sort of) on mailing list: http://lists.pysolar.org/2018-03/0000001.html