Observer
- class pysolorie.observer.Observer(observer_latitude: float | None = None, observer_longitude: float | None = None)[source]
A class to model an observer based on horizontal and equatorial pictures of the sun-earth geometry.
To instantiate the
Observerclass, provide the following parameter.- Parameters:
observer_latitude (Optional[float]) – The latitude of the observer in degrees (optional).
observer_longitude (Optional[float]) – The longitude of the observer in degrees (optional).
- calculate_sunrise_sunset(day_of_year: int) tuple[source]
Calculate the hour angle at sunrise and sunset.
The hour angle at sunrise and sunset is calculated using the formula:
\[\cos(\omega) = -\tan(\phi) \times \tan(\delta)\]- \(\omega\) is the hour angle- \(\phi\) is the latitude of the observer- \(\delta\) is the solar declination.- Parameters:
day_of_year (int) – The day of the year.
- Returns:
The hour angle at sunrise and sunset in radians.
- Return type:
tuple
- calculate_zenith_angle(day_of_year: int, solar_time: float) float[source]
Calculate the solar zenith angle.
The solar zenith angle is calculated using the formula:
\[\cos(\theta_z) = \sin(\phi) \times \sin(\delta) + \cos(\phi) \times \cos(\delta) \times \cos(\omega)\]- \(\theta_z\) is the solar zenith angle- \(\phi\) is the latitude of the observer- \(\delta\) is the solar declination- \(\omega\) is the hour angle.- Parameters:
day_of_year (int) – The day of the year.
solar_time (float) – The solar time in seconds.
- Returns:
The zenith angle in radians.
- Return type:
float
- property observer_latitude: float | None
Getter for the observer’s latitude.
- Returns:
The observer’s latitude in radians.
- Return type:
Optional[float]
- property observer_longitude: float | None
Getter for the observer’s longitude.
- Returns:
The observer’s longitude in radians.
- Return type:
Optional[float]