![]() |
0.1.8
|
High-level interface for solar position calculations and radiation modeling. More...
High-level interface for solar position calculations and radiation modeling.
SolarPosition provides comprehensive solar angle calculations, radiation flux modeling, sunrise/sunset time calculations, and atmospheric turbidity calibration. The plugin automatically uses Context time/date for calculations or can be initialized with explicit coordinates.
This class requires the native Helios library built with SolarPosition support. Use context managers for proper resource cleanup.
Examples
Basic usage with Context coordinates:
Usage with explicit coordinates:
Definition at line 56 of file SolarPosition.py.
Public Member Functions | |
__init__ (self, Context context, Optional[float] utc_offset=None, Optional[float] latitude=None, Optional[float] longitude=None) | |
Initialize SolarPosition with a Helios context. | |
__enter__ (self) | |
Context manager entry. | |
__exit__ (self, exc_type, exc_val, exc_tb) | |
Context manager exit - cleanup resources. | |
float | getSunElevation (self) |
Get the sun elevation angle in degrees. | |
float | getSunZenith (self) |
Get the sun zenith angle in degrees. | |
float | getSunAzimuth (self) |
Get the sun azimuth angle in degrees. | |
vec3 | getSunDirectionVector (self) |
Get the sun direction as a 3D unit vector. | |
SphericalCoord | getSunDirectionSpherical (self) |
Get the sun direction as spherical coordinates. | |
float | getSolarFlux (self, float pressure_Pa, float temperature_K, float humidity_rel, float turbidity) |
Calculate total solar flux with atmospheric parameters. | |
float | getSolarFluxPAR (self, float pressure_Pa, float temperature_K, float humidity_rel, float turbidity) |
Calculate PAR (Photosynthetically Active Radiation) solar flux. | |
float | getSolarFluxNIR (self, float pressure_Pa, float temperature_K, float humidity_rel, float turbidity) |
Calculate NIR (Near-Infrared) solar flux. | |
float | getDiffuseFraction (self, float pressure_Pa, float temperature_K, float humidity_rel, float turbidity) |
Calculate the diffuse fraction of solar radiation. | |
Time | getSunriseTime (self) |
Calculate sunrise time for the current date and location. | |
Time | getSunsetTime (self) |
Calculate sunset time for the current date and location. | |
calibrateTurbidityFromTimeseries (self, str timeseries_label) | |
Calibrate atmospheric turbidity using timeseries data. | |
enableCloudCalibration (self, str timeseries_label) | |
Enable cloud calibration using timeseries data. | |
disableCloudCalibration (self) | |
Disable cloud calibration. | |
bool | is_available (self) |
Check if SolarPosition is available in current build. | |
Public Attributes | |
context = context | |
Protected Attributes | |
_solar_pos | |
pyhelios.SolarPosition.SolarPosition.__init__ | ( | self, | |
Context | context, | ||
Optional[float] | utc_offset = None, | ||
Optional[float] | latitude = None, | ||
Optional[float] | longitude = None ) |
Initialize SolarPosition with a Helios context.
context | Active Helios Context instance |
utc_offset | UTC time offset in hours (-12 to +12). If provided with latitude/longitude, creates plugin with explicit coordinates. |
latitude | Latitude in degrees (-90 to +90). Required if utc_offset provided. |
longitude | Longitude in degrees (-180 to +180). Required if utc_offset provided. |
SolarPositionError | If plugin not available in current build |
ValueError | If coordinate parameters are invalid or incomplete |
RuntimeError | If plugin initialization fails |
Definition at line 78 of file SolarPosition.py.
pyhelios.SolarPosition.SolarPosition.__enter__ | ( | self | ) |
Context manager entry.
Definition at line 128 of file SolarPosition.py.
pyhelios.SolarPosition.SolarPosition.__exit__ | ( | self, | |
exc_type, | |||
exc_val, | |||
exc_tb ) |
Context manager exit - cleanup resources.
Definition at line 132 of file SolarPosition.py.
pyhelios.SolarPosition.SolarPosition.calibrateTurbidityFromTimeseries | ( | self, | |
str | timeseries_label ) |
Calibrate atmospheric turbidity using timeseries data.
timeseries_label | Label of timeseries data in Context |
ValueError | If timeseries label is invalid |
SolarPositionError | If calibration fails |
Examples
Definition at line 431 of file SolarPosition.py.
pyhelios.SolarPosition.SolarPosition.disableCloudCalibration | ( | self | ) |
Disable cloud calibration.
SolarPositionError | If operation fails |
Examples
Definition at line 475 of file SolarPosition.py.
pyhelios.SolarPosition.SolarPosition.enableCloudCalibration | ( | self, | |
str | timeseries_label ) |
Enable cloud calibration using timeseries data.
timeseries_label | Label of cloud timeseries data in Context |
ValueError | If timeseries label is invalid |
SolarPositionError | If calibration setup fails |
Examples
Definition at line 455 of file SolarPosition.py.
float pyhelios.SolarPosition.SolarPosition.getDiffuseFraction | ( | self, | |
float | pressure_Pa, | ||
float | temperature_K, | ||
float | humidity_rel, | ||
float | turbidity ) |
Calculate the diffuse fraction of solar radiation.
pressure_Pa | Atmospheric pressure in Pascals |
temperature_K | Temperature in Kelvin |
humidity_rel | Relative humidity as fraction (0.0-1.0) |
turbidity | Atmospheric turbidity coefficient |
ValueError | If atmospheric parameters are invalid |
SolarPositionError | If calculation fails |
Examples
Definition at line 363 of file SolarPosition.py.
float pyhelios.SolarPosition.SolarPosition.getSolarFlux | ( | self, | |
float | pressure_Pa, | ||
float | temperature_K, | ||
float | humidity_rel, | ||
float | turbidity ) |
Calculate total solar flux with atmospheric parameters.
pressure_Pa | Atmospheric pressure in Pascals (e.g., 101325 for sea level) |
temperature_K | Temperature in Kelvin (e.g., 288.15 for 15°C) |
humidity_rel | Relative humidity as fraction (0.0-1.0) |
turbidity | Atmospheric turbidity coefficient (typically 0.05-0.5) |
ValueError | If atmospheric parameters are out of valid ranges |
SolarPositionError | If calculation fails |
Examples
Definition at line 274 of file SolarPosition.py.
float pyhelios.SolarPosition.SolarPosition.getSolarFluxNIR | ( | self, | |
float | pressure_Pa, | ||
float | temperature_K, | ||
float | humidity_rel, | ||
float | turbidity ) |
Calculate NIR (Near-Infrared) solar flux.
pressure_Pa | Atmospheric pressure in Pascals |
temperature_K | Temperature in Kelvin |
humidity_rel | Relative humidity as fraction (0.0-1.0) |
turbidity | Atmospheric turbidity coefficient |
ValueError | If atmospheric parameters are invalid |
SolarPositionError | If calculation fails |
Examples
Definition at line 332 of file SolarPosition.py.
float pyhelios.SolarPosition.SolarPosition.getSolarFluxPAR | ( | self, | |
float | pressure_Pa, | ||
float | temperature_K, | ||
float | humidity_rel, | ||
float | turbidity ) |
Calculate PAR (Photosynthetically Active Radiation) solar flux.
pressure_Pa | Atmospheric pressure in Pascals |
temperature_K | Temperature in Kelvin |
humidity_rel | Relative humidity as fraction (0.0-1.0) |
turbidity | Atmospheric turbidity coefficient |
ValueError | If atmospheric parameters are invalid |
SolarPositionError | If calculation fails |
Examples
Definition at line 303 of file SolarPosition.py.
float pyhelios.SolarPosition.SolarPosition.getSunAzimuth | ( | self | ) |
Get the sun azimuth angle in degrees.
SolarPositionError | If calculation fails |
Examples
Definition at line 195 of file SolarPosition.py.
SphericalCoord pyhelios.SolarPosition.SolarPosition.getSunDirectionSpherical | ( | self | ) |
Get the sun direction as spherical coordinates.
SolarPositionError | If calculation fails |
Examples
Definition at line 239 of file SolarPosition.py.
vec3 pyhelios.SolarPosition.SolarPosition.getSunDirectionVector | ( | self | ) |
Get the sun direction as a 3D unit vector.
SolarPositionError | If calculation fails |
Examples
Definition at line 217 of file SolarPosition.py.
float pyhelios.SolarPosition.SolarPosition.getSunElevation | ( | self | ) |
Get the sun elevation angle in degrees.
SolarPositionError | If calculation fails |
Examples
Definition at line 153 of file SolarPosition.py.
Time pyhelios.SolarPosition.SolarPosition.getSunriseTime | ( | self | ) |
Calculate sunrise time for the current date and location.
SolarPositionError | If calculation fails |
Examples
Definition at line 386 of file SolarPosition.py.
Time pyhelios.SolarPosition.SolarPosition.getSunsetTime | ( | self | ) |
Calculate sunset time for the current date and location.
SolarPositionError | If calculation fails |
Examples
Definition at line 408 of file SolarPosition.py.
float pyhelios.SolarPosition.SolarPosition.getSunZenith | ( | self | ) |
Get the sun zenith angle in degrees.
SolarPositionError | If calculation fails |
Examples
Definition at line 174 of file SolarPosition.py.
bool pyhelios.SolarPosition.SolarPosition.is_available | ( | self | ) |
Check if SolarPosition is available in current build.
Definition at line 489 of file SolarPosition.py.
|
protected |
Definition at line 116 of file SolarPosition.py.
pyhelios.SolarPosition.SolarPosition.context = context |
Definition at line 115 of file SolarPosition.py.