Documentation
¶
Overview ¶
Package sg2 computes the topocentric geometric position of the Sun using the Solar Geometry 2 (SG2) algorithm of Blanc and Wald (2012).
Geographic points use the conventional GIS axis order: X is longitude and Y is latitude, both in decimal degrees. If the point has a Z coordinate it is interpreted as ellipsoidal height in metres; otherwise height is zero.
SunPosition returns azimuth clockwise from true north in [0, 360) degrees and geometric altitude in degrees (positive above the horizon). Altitude is not corrected for atmospheric refraction, matching the core SG2 output (topocentric gamma_S0). The supplied time is interpreted as an absolute instant and converted to UTC; UTC approximates UT1 for this implementation.
SG2's published accuracy is approximately 0.003 degrees over 1980–2030. The direct trigonometric series is evaluated without the optional precomputed daily interpolation tables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SunPosition ¶
SunPosition returns the Sun's azimuth and geometric altitude, in degrees, for a geographic point and an absolute time.
The geom.Point ordinates are longitude (X), latitude (Y), and optional ellipsoidal height in metres (Z). Empty points, non-finite coordinates, or coordinates outside the geographic ranges return (NaN, NaN). Longitude is restricted to [-180, 180] and latitude to [-90, 90].
No error can be returned because the requested API has no error result.
Types ¶
This section is empty.