Usage
First, import the library:
Note
Since there is no system time-zone data on Windows, it is necessary to download IANA tzdata for the library date-tz.
mkdir $HOME/tzdata
cd $HOME/tzdata
curl "https://data.iana.org/time-zones/releases/tzdata2022a.tar.gz" | tar xvz
curl "https://raw.githubusercontent.com/unicode-org/cldr/main/common/supplemental/windowsZones.xml"
If curl
failed with connection refused
, manually download the windowsZones.xml
file in browser.
Windows version was forgone at v0.8.0
sun position at
-
Instantialize an
analyzer
, and bound to an algorithm, for example "SPA": -
Set the observatory using kwargs arguments:
d = {'timezone': -7.0, 'longitude': -105.1786, 'latitude': 39.742476, 'elevation': 1830.14} sea.observatory = d
Without setting observatory, a runtime error will be raised when calling for calculation:
-
Call the backend algorithm to calculate sun position at the give time:
Other type of arguments like>>> sp = sea.sun_position_at("2003-10-17 12:30:30") >>> sp TopoCentricSunPositionResult(zenith=50.11162202402972, ... azimuth=194.34024051019162, julian_day=2452930.312847222)
List[int]
anddatetime.datetime
are also supported, see reference for details.