SatelliteToolbox.jl icon indicating copy to clipboard operation
SatelliteToolbox.jl copied to clipboard

Sunposition?

Open stephancb opened this issue 6 years ago • 3 comments

Not really an issue, but I have code in native Julia for the sun position at given geodetic coordinates and time, returning zenith angle and azimuth. We use this to calculate the sun position relative to the satellite. It is quite fast. I never got around to put this into a package, but if you think it might fit, I would try to come up with a pull request for the SatelliteToolbox?

Some more details:

Functions for calculating the Sun's position described in Roberto Grena (2012), Five new algorithms for the computation of sun position from 2010 to 2110, Solar Energy, 86(5):1323–1337, doi:10.1016/j.solener.2012.01.024.

URLs: http://adsabs.harvard.edu/abs/2012SoEn...86.1323G

The Julia code was transcribed from C++ obtained at http://www.solaritaly.enea.it/StrSunPosition/SunPositionEn.php

by Stephan Buchert, Swedish Institute of Space Physics, [email protected]

Examples for usage:

zenith,azimuth,rightAscension,declination,hourAngle = sunpos(...

stephancb avatar Jun 18 '18 20:06 stephancb

Excellent! It will be very nice to have those algorithms. Now, we only have one very simple Sun determination algorithm here, which provides the sun position in ECI. You can add all of those and let the user select. Maybe it best way is to use multiple-dispatch, so the user can use it like:

sun_position_i(Val{:algorithm_1}, ...)
sun_position_i(Val{:algorithm_2}, ...)

Change the _i to _e maybe (ECEF)?

ronisbr avatar Jun 18 '18 20:06 ronisbr

Hi @stephancb !

Do you still want to add those algorithms in SatelliteToolbox.jl?

ronisbr avatar Mar 29 '19 13:03 ronisbr

Hi Ronan,

yes, sorry for not doing it yet. The code is attached, it has comments. Included is also the original C++ code and documentation, it doesn't have a license.. SunPosition.jl.zip

I don't have any experience with creating pull requests etc., and became quite busy. If you have the possibility to add the algorithms to the satellite toolbox, this would be perfect.

Best regards, Stephan

stephancb avatar Mar 30 '19 07:03 stephancb