_timestamp¶
- class contrib.misc._timestamp.TimestampUtils[source]¶
Bases:
object- solar_declination(day_of_year)[source]¶
Return solar declination (radians) using approximate formula.
- solar_events(timestamp, latitude, longitude)[source]¶
Calculate solar noon, sunrise, and sunset for the given timestamp and coordinates. All results are UTC datetimes.
- Parameters:
timestamp – POSIX timestamp (seconds since epoch)
latitude – latitude in decimal degrees (positive north)
longitude – longitude in decimal degrees (positive east, negative west)
- Returns:
‘solar_noon’, ‘sunrise’, ‘sunset’ (UTC datetimes)
- Return type:
dict with keys