sun¶
This module provides a low-accuracy solar positon algorithm, and handles some time and location calculations which depend on solar position (e.g. calculating the solar zenith angle or greenwich siderial time at a particular location on earth)
API¶
-
geospacepy.sun.greenwich_mean_siderial_time(jds)[source]¶ Calculate the angle in the plane of the equator between the vernal equinox direction and the prime meridian (the line of longitude through Greenwich, England).
Parameters: jds (float or np.ndarray) – The julian date(s) of the times for which the GMST should be calculated Returns: theta_GST – The Greenwich Mean Siderial Time in radians Return type: float or np.ndarray Notes
Because this calculation depends on the actual exact number of earth rotations since the J2000 epoch, the time (julian date) strictly speaking should be in the UT1 system (the time system determined from observations of distant stars), because this system takes into account the small changes in earth’s rotation speed.
Generally though, UTC is available instead of UT1. UTC is determined from atomic clocks, and is kept within +- 1 second of UT1 by the periodic insertion of leap seconds.
-
geospacepy.sun.local_hour_angle(jds, glons)[source]¶ Finds local hour angle in radians. The sign convention is that of astronomy (positive to the west, meaning angle increases opposite the rotation direction of earth).
Under this sign convention the hour angle (in units of hours) is the time it will be before for the sun is directly overhead at the specified location and time.
Parameters: - jds (np.ndarray or float) – Time (as julian date)
- glons (np.ndarray or float) – Geographic longitude
Returns: - lhas (np.ndarray or float) – Local hour angles for locations at specified times (in radians)
- .. note:: – See also Vallado Figure 3-9 (pp.157)
-
geospacepy.sun.local_mean_solar_time(jds, glons)[source]¶ Find the local solar time (using the mean equinox)
Parameters: - jds (np.ndarray or float) – Time (as julian date)
- glons (np.ndarray or float) – Geographic longitude
Returns: lmsts – Local mean solar time at locations at specified times (in radians)
Return type: np.ndarray or float
Notes
As an angle, the solar local time increases in the same direction as the ISO 6709 longitude convention (eastward positive).
The differences between hour angle and local time is that hour angle is: 1.) Measured with positive in the westward direction 2.) Zero when the sun is directly overhead (instead of 12 for solar time)
See also Vallado pp. 184
-
geospacepy.sun.solar_position_almanac(jds)[source]¶ Finds the apparent solar right ascension and declination for any number of julian dates.
This algorithm is entitled ‘Low precision formulas for the Sun’ and can be found in section C of the Naval Research Laboratory Astronomical Almanac (2019). This formula should also be in other editions of the Almanac.
The Almanac describes this formula as yeilding a precision better than 1’ (1/60 degrees) for the years 1950 to 2050
Parameters: jds (np.ndarray or float) – Julian dates for which to calculate solar positions Returns: - alpha (np.ndarray or float (matches input)) – Solar apparent right ascension (angle in equatorial plane measured clockwise from the vernal equinox direction), in radians
- delta (np.ndarray or float (matches input)) – Solar declination (equiv. to subsolar latitude), in radians
-
geospacepy.sun.solar_zenith_angle(jds, glats, glons)[source]¶ Finds solar zenith angle using Astronomical Almanac low-accuracy solar position.
Parameters: - jds (np.ndarray or float) – Time (as julian date)
- glats (np.ndarray or float) – Geographic (geocentric-spherical) latitude of the location
- glons (np.ndarray or float) – Geographic longitude of the location
Returns: szas – Solar Zenith angles for the time/location combinations specified (in radians)
Return type: np.ndarray or float