0.1.39
Loading...
Searching...
No Matches
pyhelios.SolarPosition Namespace Reference

Classes

class  SolarPosition
 High-level interface for solar position calculations and radiation modeling. More...
 
class  SolarPositionError
 Exception raised for SolarPosition-specific errors. More...
 

Functions

 _solarposition_working_directory (Tuple[str,...] required_assets=(_PRAGUE_DATASET,))
 Context manager that temporarily changes working directory to where SolarPosition assets are located.
 
None _validate_sensor_arguments (label, direction_to_sensor)
 Validate the label and sensor direction shared by the sensor atmosphere methods.
 
SolarPosition create_solar_position (Context context, Optional[float] utc_offset=None, Optional[float] latitude=None, Optional[float] longitude=None)
 Create SolarPosition instance with context and optional coordinates.
 

Variables

 logger = logging.getLogger(__name__)
 
str _PRAGUE_DATASET
 
str _OZONE_CLIMATOLOGY
 
str _EXTRATERRESTRIAL_SPECTRUM
 
str _ATMOSPHERE_LUT
 
str _THERMAL_ATMOSPHERE_LUT
 
tuple _SPECTRAL_MODEL_ASSETS
 
tuple _THERMAL_MODEL_ASSETS
 

Function Documentation

◆ _solarposition_working_directory()

pyhelios.SolarPosition._solarposition_working_directory ( Tuple[str, ...] required_assets = (_PRAGUE_DATASET,))
protected

Context manager that temporarily changes working directory to where SolarPosition assets are located.

SolarPosition C++ code opens its data files (the Prague sky model dataset, the ozone climatology, the extraterrestrial solar spectrum and the atmospheric look-up tables) through hardcoded relative paths such as "plugins/solarposition/lib/prague_sky_model/PragueSkyModelReduced.dat", so they are only resolvable when the process is running from the build directory. This manager temporarily changes to the build directory where the files actually live.

Parameters
required_assetsPaths, relative to the "plugins/solarposition" asset directory, of the data files the enclosed call reads.
Exceptions
RuntimeErrorIf the build directory or a required data file is not found, indicating a build system error.

Definition at line 79 of file SolarPosition.py.

◆ _validate_sensor_arguments()

None pyhelios.SolarPosition._validate_sensor_arguments ( label,
direction_to_sensor )
protected

Validate the label and sensor direction shared by the sensor atmosphere methods.

Definition at line 136 of file SolarPosition.py.

◆ create_solar_position()

SolarPosition pyhelios.SolarPosition.create_solar_position ( Context context,
Optional[float] utc_offset = None,
Optional[float] latitude = None,
Optional[float] longitude = None )

Create SolarPosition instance with context and optional coordinates.

Parameters
contextHelios Context
utc_offsetUTC time offset in hours (optional)
latitudeLatitude in degrees (optional)
longitudeLongitude in degrees (optional)
Returns
SolarPosition instance
Example
>>> solar = create_solar_position(context, utc_offset=-8, latitude=38.5, longitude=-121.7)

Definition at line 1541 of file SolarPosition.py.

Variable Documentation

◆ _ATMOSPHERE_LUT

str pyhelios.SolarPosition._ATMOSPHERE_LUT
protected

Definition at line 41 of file SolarPosition.py.

◆ _EXTRATERRESTRIAL_SPECTRUM

str pyhelios.SolarPosition._EXTRATERRESTRIAL_SPECTRUM
protected

Definition at line 37 of file SolarPosition.py.

◆ _OZONE_CLIMATOLOGY

str pyhelios.SolarPosition._OZONE_CLIMATOLOGY
protected

Definition at line 33 of file SolarPosition.py.

◆ _PRAGUE_DATASET

str pyhelios.SolarPosition._PRAGUE_DATASET
protected

Definition at line 29 of file SolarPosition.py.

◆ _SPECTRAL_MODEL_ASSETS

tuple pyhelios.SolarPosition._SPECTRAL_MODEL_ASSETS
protected

Definition at line 51 of file SolarPosition.py.

◆ _THERMAL_ATMOSPHERE_LUT

str pyhelios.SolarPosition._THERMAL_ATMOSPHERE_LUT
protected

Definition at line 45 of file SolarPosition.py.

◆ _THERMAL_MODEL_ASSETS

tuple pyhelios.SolarPosition._THERMAL_MODEL_ASSETS
protected

Definition at line 56 of file SolarPosition.py.

◆ logger

pyhelios.SolarPosition.logger = logging.getLogger(__name__)

Definition at line 21 of file SolarPosition.py.