![]() |
0.1.39
|
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.
Definition at line 180 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. | |
| __del__ (self) | |
| Destructor to ensure C++ resources freed even without 'with' statement. | |
| None | setAtmosphericConditions (self, float pressure_Pa, float temperature_K, float humidity_rel, float turbidity) |
| Set atmospheric conditions for subsequent flux calculations (modern API). | |
| Tuple[float, float, float, float] | getAtmosphericConditions (self) |
| Get currently set atmospheric conditions from Context. | |
| float | getSunElevation (self) |
| Get the sun elevation angle in radians. | |
| float | getSunZenith (self) |
| Get the sun zenith angle in radians. | |
| float | getSunAzimuth (self) |
| Get the sun azimuth angle in radians. | |
| vec3 | getSunDirectionVector (self) |
| Get the sun direction as a 3D unit vector. | |
| SphericalCoord | getSunDirectionSpherical (self) |
| Get the sun direction as spherical coordinates. | |
| setSunDirection (self, SphericalCoord sundirection) | |
| Override the computed solar position with a prescribed sun direction. | |
| float | getSolarFlux (self, Optional[float] pressure_Pa=None, Optional[float] temperature_K=None, Optional[float] humidity_rel=None, Optional[float] turbidity=None) |
| Calculate total solar flux (supports legacy and modern APIs). | |
| float | getSolarFluxPAR (self, Optional[float] pressure_Pa=None, Optional[float] temperature_K=None, Optional[float] humidity_rel=None, Optional[float] turbidity=None) |
| Calculate PAR (Photosynthetically Active Radiation) solar flux. | |
| float | getSolarFluxNIR (self, Optional[float] pressure_Pa=None, Optional[float] temperature_K=None, Optional[float] humidity_rel=None, Optional[float] turbidity=None) |
| Calculate NIR (Near-Infrared) solar flux. | |
| float | getDiffuseFraction (self, Optional[float] pressure_Pa=None, Optional[float] temperature_K=None, Optional[float] humidity_rel=None, Optional[float] turbidity=None) |
| Calculate the diffuse fraction of solar radiation. | |
| float | getAmbientLongwaveFlux (self, Optional[float] temperature_K=None, Optional[float] humidity_rel=None) |
| Calculate the ambient (sky) longwave radiation flux. | |
| Time | getSunriseTime (self) |
| Calculate sunrise time for the current date and location. | |
| Time | getSunsetTime (self) |
| Calculate sunset time for the current date and location. | |
| float | 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. | |
| enablePragueSkyModel (self) | |
| Enable Prague Sky Model for physically-based sky radiance calculations. | |
| bool | isPragueSkyModelEnabled (self) |
| Check if Prague Sky Model is currently enabled. | |
| updatePragueSkyModel (self, float ground_albedo=0.33) | |
| Update Prague Sky Model and store spectral-angular parameters in Context. | |
| bool | pragueSkyModelNeedsUpdate (self, float ground_albedo=0.33, float sun_tolerance=0.01, float turbidity_tolerance=0.02, float albedo_tolerance=0.05) |
| Check if Prague Sky Model needs updating based on changed conditions. | |
| calculateDirectSolarSpectrum (self, str label, float resolution_nm=1.0) | |
| Calculate direct beam solar spectrum. | |
| calculateDiffuseSolarSpectrum (self, str label, float resolution_nm=1.0) | |
| Calculate diffuse solar spectrum. | |
| calculateGlobalSolarSpectrum (self, str label, float resolution_nm=1.0) | |
| Calculate global (total) solar spectrum. | |
| None | setOzoneColumn (self, float ozone_DU) |
| Set the total column ozone, overriding the climatological value. | |
| float | getOzoneColumn (self) |
| Get the total column ozone used by the solar radiation models. | |
| None | setGroundAlbedo (self, float albedo) |
| Set the albedo of the ground surrounding the scene. | |
| float | getGroundAlbedo (self) |
| Get the albedo of the ground surrounding the scene. | |
| None | calculateSensorAtmosphereSpectra (self, str label, vec3 direction_to_sensor, float resolution_nm=1.0) |
| Calculate the spectral atmospheric quantities needed to simulate imagery from a sensor above the atmosphere (e.g., a satellite). | |
| None | calculateSensorThermalAtmosphere (self, str label, vec3 direction_to_sensor) |
| Calculate the thermal infrared atmospheric quantities needed to simulate thermal imagery from a sensor above the atmosphere (e.g., a satellite). | |
| float | getThermalSkyFlux (self, float wavelength_min_nm, float wavelength_max_nm) |
| Calculate the sky longwave irradiance on a horizontal surface within a thermal band. | |
| bool | is_available (self) |
| Check if SolarPosition is available in current build. | |
Public Attributes | |
| context = context | |
Protected Member Functions | |
| _check_context_alive (self) | |
| Raise if the owning Context has been destroyed (see Context.check_context_alive). | |
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 (-14 to +12). Helios counts the offset positive moving West, which inverts the real-world UTC-12..UTC+14 span, so the range is asymmetric. 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 204 of file SolarPosition.py.
| pyhelios.SolarPosition.SolarPosition.__del__ | ( | self | ) |
Destructor to ensure C++ resources freed even without 'with' statement.
Definition at line 273 of file SolarPosition.py.
| pyhelios.SolarPosition.SolarPosition.__enter__ | ( | self | ) |
Context manager entry.
Definition at line 263 of file SolarPosition.py.
| pyhelios.SolarPosition.SolarPosition.__exit__ | ( | self, | |
| exc_type, | |||
| exc_val, | |||
| exc_tb ) |
Context manager exit - cleanup resources.
Definition at line 267 of file SolarPosition.py.
|
protected |
Raise if the owning Context has been destroyed (see Context.check_context_alive).
Definition at line 259 of file SolarPosition.py.
| pyhelios.SolarPosition.SolarPosition.calculateDiffuseSolarSpectrum | ( | self, | |
| str | label, | ||
| float | resolution_nm = 1.0 ) |
Calculate diffuse solar spectrum.
Computes the diffuse (sky) spectral irradiance on a horizontal surface from 300 to 2600 nm, including light reflected by the ground and scattered back down by the atmosphere, with a spectral model that follows SSolar-GOA (Cachorro et al. 2022). Results are stored in Context global data as a vector of (wavelength, irradiance) pairs.
| label | Label to store the spectrum data in Context global data |
| resolution_nm | Wavelength resolution in nanometers (1.0-2300.0). Lower values give finer spectral resolution but require more computation. Default is 1.0 nm. |
| ValueError | If label is empty or resolution is out of valid range |
| SolarPositionError | If calculation fails |
Definition at line 1146 of file SolarPosition.py.
| pyhelios.SolarPosition.SolarPosition.calculateDirectSolarSpectrum | ( | self, | |
| str | label, | ||
| float | resolution_nm = 1.0 ) |
Calculate direct beam solar spectrum.
Computes the spectral irradiance of the direct solar beam on a surface normal to the sun direction from 300 to 2600 nm, with a spectral model that follows SSolar-GOA (Cachorro et al. 2022). Results are stored in Context global data as a vector of (wavelength, irradiance) pairs.
| label | Label to store the spectrum data in Context global data |
| resolution_nm | Wavelength resolution in nanometers (1.0-2300.0). Lower values give finer spectral resolution but require more computation. Default is 1.0 nm. |
| ValueError | If label is empty or resolution is out of valid range |
| SolarPositionError | If calculation fails |
Definition at line 1094 of file SolarPosition.py.
| pyhelios.SolarPosition.SolarPosition.calculateGlobalSolarSpectrum | ( | self, | |
| str | label, | ||
| float | resolution_nm = 1.0 ) |
Calculate global (total) solar spectrum.
Computes the global (direct plus diffuse) spectral irradiance on a horizontal surface from 300 to 2600 nm, with a spectral model that follows SSolar-GOA (Cachorro et al. 2022). Results are stored in Context global data as a vector of (wavelength, irradiance) pairs.
| label | Label to store the spectrum data in Context global data |
| resolution_nm | Wavelength resolution in nanometers (1.0-2300.0). Lower values give finer spectral resolution but require more computation. Default is 1.0 nm. |
| ValueError | If label is empty or resolution is out of valid range |
| SolarPositionError | If calculation fails |
Definition at line 1198 of file SolarPosition.py.
| None pyhelios.SolarPosition.SolarPosition.calculateSensorAtmosphereSpectra | ( | self, | |
| str | label, | ||
| vec3 | direction_to_sensor, | ||
| float | resolution_nm = 1.0 ) |
Calculate the spectral atmospheric quantities needed to simulate imagery from a sensor above the atmosphere (e.g., a satellite).
Radiance reaching the sensor is modeled as L_sensor = L_path + T_dir_up * L_surface + L_adj, where L_surface is the radiance leaving the scene. The atmosphere is described by a look-up table computed with the 6S radiative transfer code (continental aerosol), which gives both the upward path to the sensor and the downward solar illumination of the scene. For the two to be consistent, illuminate the scene with the "_direct_irradiance" and "_diffuse_irradiance" spectra stored by this method rather than those of calculateDirectSolarSpectrum() and calculateDiffuseSolarSpectrum().
The following spectra are stored in Context global data as vectors of vec2 (wavelength_nm, value), each labeled with the given label followed by a suffix:
The unit vector toward the sensor is also stored, as vec3 global data with the suffix "_direction_to_sensor".
| label | Prefix of the labels under which the spectra are stored in Context global data |
| direction_to_sensor | Vector pointing from the scene toward the sensor (need not be normalized). Its zenith angle must not exceed 60 degrees. |
| resolution_nm | Wavelength resolution in nanometers (1.0-2300.0). Default is 1.0 nm. |
| ValueError | If label is empty, direction_to_sensor is not a non-zero vec3, or resolution is out of valid range |
| SolarPositionError | If calculation fails, including for conditions outside the range of the look-up table |
Definition at line 1395 of file SolarPosition.py.
| None pyhelios.SolarPosition.SolarPosition.calculateSensorThermalAtmosphere | ( | self, | |
| str | label, | ||
| vec3 | direction_to_sensor ) |
Calculate the thermal infrared atmospheric quantities needed to simulate thermal imagery from a sensor above the atmosphere (e.g., a satellite).
Radiance reaching the sensor at a thermal wavelength is modeled as L_sensor = tau * L_surface + L_up, where L_surface is the radiance leaving the scene (emitted plus reflected sky radiance), tau the atmospheric transmittance and L_up the radiance emitted upward by the atmosphere. These are interpolated from a look-up table computed with the libRadtran radiative transfer code (clear sky without aerosol).
The following spectra are stored in Context global data as vectors of vec2 (wavelength of the bin center in nm, value), with 234 points from 5502 to 15326 nm, each labeled with the given label followed by a suffix:
The column water vapor (float, g/cm²) is stored with the suffix "_thermal_water_vapor_cm", and the unit vector toward the sensor, as vec3, with the suffix "_direction_to_sensor".
| label | Prefix of the labels under which the results are stored in Context global data |
| direction_to_sensor | Vector pointing from the scene toward the sensor (need not be normalized). Its zenith angle must not exceed 60 degrees. |
| ValueError | If label is empty or direction_to_sensor is not a non-zero vec3 |
| SolarPositionError | If calculation fails, including for conditions outside the range of the look-up table |
Definition at line 1461 of file SolarPosition.py.
| float pyhelios.SolarPosition.SolarPosition.calibrateTurbidityFromTimeseries | ( | self, | |
| str | timeseries_label ) |
Calibrate atmospheric turbidity using timeseries data.
| timeseries_label | Label of timeseries data in Context. The data should be global shortwave radiation flux on a horizontal plane in W/m^2, and should contain at least one day of clear-sky conditions. |
| ValueError | If timeseries label is invalid |
| SolarPositionError | If calibration fails |
Definition at line 881 of file SolarPosition.py.
| pyhelios.SolarPosition.SolarPosition.disableCloudCalibration | ( | self | ) |
Disable cloud calibration.
| SolarPositionError | If operation fails |
Definition at line 924 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 |
Definition at line 905 of file SolarPosition.py.
| pyhelios.SolarPosition.SolarPosition.enablePragueSkyModel | ( | self | ) |
Enable Prague Sky Model for physically-based sky radiance calculations.
The Prague Sky Model provides high-quality spectral and angular sky radiance distribution for accurate diffuse radiation modeling. It accounts for Rayleigh and Mie scattering to produce realistic sky radiance patterns across the 360-1480 nm spectral range.
| SolarPositionError | If operation fails |
Definition at line 954 of file SolarPosition.py.
| float pyhelios.SolarPosition.SolarPosition.getAmbientLongwaveFlux | ( | self, | |
| Optional[float] | temperature_K = None, | ||
| Optional[float] | humidity_rel = None ) |
Calculate the ambient (sky) longwave radiation flux.
This method supports both legacy and modern APIs: - **Legacy API**: Pass temperature and humidity explicitly - **Modern API**: Pass no parameters, uses atmospheric conditions from setAtmosphericConditions()
| temperature_K | Temperature in Kelvin [optional] |
| humidity_rel | Relative humidity as fraction (0.0-1.0) [optional] |
| ValueError | If one parameter provided but not the other |
| SolarPositionError | If calculation fails |
Modern API (uses temperature and humidity from setAtmosphericConditions): >>> solar.setAtmosphericConditions(101325, 288.15, 0.6, 0.1) >>> lw_flux = solar.getAmbientLongwaveFlux()
Definition at line 763 of file SolarPosition.py.
| Tuple[float, float, float, float] pyhelios.SolarPosition.SolarPosition.getAtmosphericConditions | ( | self | ) |
Get currently set atmospheric conditions from Context.
| SolarPositionError | If operation fails |
Definition at line 354 of file SolarPosition.py.
| float pyhelios.SolarPosition.SolarPosition.getDiffuseFraction | ( | self, | |
| Optional[float] | pressure_Pa = None, | ||
| Optional[float] | temperature_K = None, | ||
| Optional[float] | humidity_rel = None, | ||
| Optional[float] | turbidity = None ) |
Calculate the diffuse fraction of solar radiation.
Supports both legacy (parameter-based) and modern (state-based) APIs.
| pressure_Pa | Atmospheric pressure in Pascals [optional] |
| temperature_K | Temperature in Kelvin [optional] |
| humidity_rel | Relative humidity as fraction (0.0-1.0) [optional] |
| turbidity | Ångström's aerosol turbidity coefficient (β), the aerosol optical depth at 1 µm [optional] |
| ValueError | If some parameters provided but not all |
| SolarPositionError | If calculation fails |
Definition at line 705 of file SolarPosition.py.
| float pyhelios.SolarPosition.SolarPosition.getGroundAlbedo | ( | self | ) |
Get the albedo of the ground surrounding the scene.
| SolarPositionError | If operation fails |
Definition at line 1320 of file SolarPosition.py.
| float pyhelios.SolarPosition.SolarPosition.getOzoneColumn | ( | self | ) |
Get the total column ozone used by the solar radiation models.
Returns the ozone column set with setOzoneColumn(), if any. Otherwise returns the monthly zonal-mean climatology of the NASA SBUV Merged Ozone Data Set averaged over 2005-2024, interpolated linearly in latitude between the centers of its 5-degree latitude bands and in the day of the year between the middles of the months.
| SolarPositionError | If no ozone column was set and the climatology has no data for the location and date. The climatology has no data in high-latitude winter months or poleward of 80 degrees; set the ozone column with setOzoneColumn() there. |
Definition at line 1264 of file SolarPosition.py.
| float pyhelios.SolarPosition.SolarPosition.getSolarFlux | ( | self, | |
| Optional[float] | pressure_Pa = None, | ||
| Optional[float] | temperature_K = None, | ||
| Optional[float] | humidity_rel = None, | ||
| Optional[float] | turbidity = None ) |
Calculate total solar flux (supports legacy and modern APIs).
This method supports both legacy and modern APIs: - **Legacy API**: Pass all 4 atmospheric parameters explicitly - **Modern API**: Pass no parameters, uses atmospheric conditions from setAtmosphericConditions()
| pressure_Pa | Atmospheric pressure in Pascals (e.g., 101325 for sea level) [optional] |
| temperature_K | Temperature in Kelvin (e.g., 288.15 for 15°C) [optional] |
| humidity_rel | Relative humidity as fraction (0.0-1.0) [optional] |
| turbidity | Ångström's aerosol turbidity coefficient (β), the aerosol optical depth at 1 µm [optional] |
| ValueError | If some parameters provided but not all, or if values are invalid |
| SolarPositionError | If calculation fails or atmospheric conditions not set (modern API) |
Definition at line 548 of file SolarPosition.py.
| float pyhelios.SolarPosition.SolarPosition.getSolarFluxNIR | ( | self, | |
| Optional[float] | pressure_Pa = None, | ||
| Optional[float] | temperature_K = None, | ||
| Optional[float] | humidity_rel = None, | ||
| Optional[float] | turbidity = None ) |
Calculate NIR (Near-Infrared) solar flux.
Supports both legacy (parameter-based) and modern (state-based) APIs.
| pressure_Pa | Atmospheric pressure in Pascals [optional] |
| temperature_K | Temperature in Kelvin [optional] |
| humidity_rel | Relative humidity as fraction (0.0-1.0) [optional] |
| turbidity | Ångström's aerosol turbidity coefficient (β), the aerosol optical depth at 1 µm [optional] |
| ValueError | If some parameters provided but not all |
| SolarPositionError | If calculation fails |
Definition at line 655 of file SolarPosition.py.
| float pyhelios.SolarPosition.SolarPosition.getSolarFluxPAR | ( | self, | |
| Optional[float] | pressure_Pa = None, | ||
| Optional[float] | temperature_K = None, | ||
| Optional[float] | humidity_rel = None, | ||
| Optional[float] | turbidity = None ) |
Calculate PAR (Photosynthetically Active Radiation) solar flux.
Supports both legacy (parameter-based) and modern (state-based) APIs.
| pressure_Pa | Atmospheric pressure in Pascals [optional] |
| temperature_K | Temperature in Kelvin [optional] |
| humidity_rel | Relative humidity as fraction (0.0-1.0) [optional] |
| turbidity | Ångström's aerosol turbidity coefficient (β), the aerosol optical depth at 1 µm [optional] |
| ValueError | If some parameters provided but not all |
| SolarPositionError | If calculation fails |
Definition at line 607 of file SolarPosition.py.
| float pyhelios.SolarPosition.SolarPosition.getSunAzimuth | ( | self | ) |
Get the sun azimuth angle in radians.
| SolarPositionError | If calculation fails |
Definition at line 419 of file SolarPosition.py.
| SphericalCoord pyhelios.SolarPosition.SolarPosition.getSunDirectionSpherical | ( | self | ) |
Get the sun direction as spherical coordinates.
| SolarPositionError | If calculation fails |
Definition at line 461 of file SolarPosition.py.
| vec3 pyhelios.SolarPosition.SolarPosition.getSunDirectionVector | ( | self | ) |
Get the sun direction as a 3D unit vector.
| SolarPositionError | If calculation fails |
Definition at line 440 of file SolarPosition.py.
| float pyhelios.SolarPosition.SolarPosition.getSunElevation | ( | self | ) |
Get the sun elevation angle in radians.
| SolarPositionError | If calculation fails |
Definition at line 376 of file SolarPosition.py.
| Time pyhelios.SolarPosition.SolarPosition.getSunriseTime | ( | self | ) |
Calculate sunrise time for the current date and location.
| SolarPositionError | If calculation fails |
Definition at line 828 of file SolarPosition.py.
| Time pyhelios.SolarPosition.SolarPosition.getSunsetTime | ( | self | ) |
Calculate sunset time for the current date and location.
| SolarPositionError | If calculation fails |
Definition at line 849 of file SolarPosition.py.
| float pyhelios.SolarPosition.SolarPosition.getSunZenith | ( | self | ) |
Get the sun zenith angle in radians.
| SolarPositionError | If calculation fails |
Definition at line 397 of file SolarPosition.py.
| float pyhelios.SolarPosition.SolarPosition.getThermalSkyFlux | ( | self, | |
| float | wavelength_min_nm, | ||
| float | wavelength_max_nm ) |
Calculate the sky longwave irradiance on a horizontal surface within a thermal band.
This is the band-specific counterpart of getAmbientLongwaveFlux(): the downward irradiance emitted by a clear-sky atmosphere between two wavelengths, integrated from the downwelling radiance of the thermal atmosphere look-up table (see calculateSensorThermalAtmosphere()). It is the diffuse flux to give an emission band with the same wavelength bounds (RadiationModel.setDiffuseRadiationFlux()), so that the sky radiance the scene reflects is consistent with the thermal sensor atmosphere.
| wavelength_min_nm | Lower wavelength bound of the band in nm |
| wavelength_max_nm | Upper wavelength bound of the band in nm |
| ValueError | If the bounds are not numbers satisfying 0 < wavelength_min_nm < wavelength_max_nm |
| SolarPositionError | If calculation fails, including for bounds outside 5502-15326 nm or atmospheric conditions outside the ranges given for calculateSensorThermalAtmosphere() |
Definition at line 1498 of file SolarPosition.py.
| bool pyhelios.SolarPosition.SolarPosition.is_available | ( | self | ) |
Check if SolarPosition is available in current build.
Definition at line 1520 of file SolarPosition.py.
| bool pyhelios.SolarPosition.SolarPosition.isPragueSkyModelEnabled | ( | self | ) |
Check if Prague Sky Model is currently enabled.
| SolarPositionError | If operation fails |
Definition at line 975 of file SolarPosition.py.
| bool pyhelios.SolarPosition.SolarPosition.pragueSkyModelNeedsUpdate | ( | self, | |
| float | ground_albedo = 0.33, | ||
| float | sun_tolerance = 0.01, | ||
| float | turbidity_tolerance = 0.02, | ||
| float | albedo_tolerance = 0.05 ) |
Check if Prague Sky Model needs updating based on changed conditions.
Enables lazy evaluation to avoid expensive Prague updates when conditions haven't changed significantly. Compares current state against cached values.
| ground_albedo | Current ground albedo (default: 0.33) |
| sun_tolerance | Threshold for sun direction changes (default: 0.01 ≈ 0.57°) |
| turbidity_tolerance | Relative threshold for turbidity (default: 0.02 = 2%) |
| albedo_tolerance | Threshold for albedo changes (default: 0.05 = 5%) |
| SolarPositionError | If check fails |
Definition at line 1043 of file SolarPosition.py.
| None pyhelios.SolarPosition.SolarPosition.setAtmosphericConditions | ( | self, | |
| float | pressure_Pa, | ||
| float | temperature_K, | ||
| float | humidity_rel, | ||
| float | turbidity ) |
Set atmospheric conditions for subsequent flux calculations (modern API).
This method sets global atmospheric conditions in the Context that are used by parameter-free flux methods (modern API). Once set, you can call getSolarFlux(), getSolarFluxPAR(), etc. without passing 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). The spectral solar irradiance, sensor atmosphere and thermal atmosphere methods derive the precipitable water from it and require a value greater than 0. |
| turbidity | Ångström's aerosol turbidity coefficient (β), the aerosol optical depth at 1 µm (must be >= 0). The aerosol optical depth at 550 nm is about 2.18 β and that at 500 nm about 2.46 β, so an aerosol optical depth measured at 500 nm corresponds to β of about 0.41 times that value. This is not Linke turbidity. |
| ValueError | If atmospheric parameters are out of valid ranges |
| SolarPositionError | If operation fails |
Definition at line 318 of file SolarPosition.py.
| None pyhelios.SolarPosition.SolarPosition.setGroundAlbedo | ( | self, | |
| float | albedo ) |
Set the albedo of the ground surrounding the scene.
The ground albedo sets how much light is reflected back and forth between the ground and the atmosphere, which increases the global and diffuse irradiance, most strongly at short wavelengths. It is stored in Context global data as "atmosphere_ground_albedo".
| albedo | Broadband ground albedo (must be between 0 and 1) |
| ValueError | If albedo is not a number between 0 and 1 |
| SolarPositionError | If operation fails |
Definition at line 1296 of file SolarPosition.py.
| None pyhelios.SolarPosition.SolarPosition.setOzoneColumn | ( | self, | |
| float | ozone_DU ) |
Set the total column ozone, overriding the climatological value.
The ozone column is used by the broadband solar flux model (getSolarFlux() family), the spectral solar irradiance model and the sensor atmosphere models. It is stored in Context global data as "atmosphere_ozone_DU".
| ozone_DU | Total column ozone in Dobson units (must be > 0) |
| ValueError | If ozone_DU is not a positive number |
| SolarPositionError | If operation fails |
Definition at line 1229 of file SolarPosition.py.
| pyhelios.SolarPosition.SolarPosition.setSunDirection | ( | self, | |
| SphericalCoord | sundirection ) |
Override the computed solar position with a prescribed sun direction.
By default the sun position is computed from the date, time and location set in the Context. Calling this method overrides that calculation, so all subsequent sun queries (elevation, zenith, azimuth, direction vectors) and flux calculations use the prescribed direction instead.
| sundirection | SphericalCoord giving the direction of the sun. Elevation and azimuth are in radians. |
| ValueError | If sundirection is not a SphericalCoord |
| SolarPositionError | If the override fails |
Definition at line 496 of file SolarPosition.py.
| pyhelios.SolarPosition.SolarPosition.updatePragueSkyModel | ( | self, | |
| float | ground_albedo = 0.33 ) |
Update Prague Sky Model and store spectral-angular parameters in Context.
This is a computationally intensive operation (~1100 model queries with OpenMP parallelization) that computes sky radiance distribution for current atmospheric and solar conditions. Use pragueSkyModelNeedsUpdate() for lazy evaluation to avoid unnecessary updates.
| ground_albedo | Ground surface albedo (default: 0.33 for typical soil/vegetation) |
| SolarPositionError | If update fails |
Definition at line 1010 of file SolarPosition.py.
|
protected |
Definition at line 245 of file SolarPosition.py.
| pyhelios.SolarPosition.SolarPosition.context = context |
Definition at line 244 of file SolarPosition.py.