Public Member Functions | |
| SolarPosition (helios::Context *context_ptr) | |
| Solar position model default constructor. Initializes location based on the location set in the Context. | |
| SolarPosition (float UTC_hrs, float latitude_deg, float longitude_deg, helios::Context *context_ptr) | |
| Solar position model constructor. | |
| helios::Time | getSunriseTime () const |
| Get the approximate time of sunrise at the current location. | |
| helios::Time | getSunsetTime () const |
| Get the approximate time of sunset at the current location. | |
| float | getSunElevation () const |
| Get the current sun elevation angle in radians for the current location. The sun angle is computed based on the current time and date set in the Helios context. | |
| float | getSunZenith () const |
| Get the current sun zenithal angle in radians for the current location. The sun angle is computed based on the current time and date set in the Helios context. | |
| float | getSunAzimuth () const |
| Get the current sun azimuthal angle in radians for the current location. The sun angle is computed based on the current time and date set in the Helios context. | |
| helios::vec3 | getSunDirectionVector () const |
| Get a unit vector pointing toward the sun for the current location. The sun angle is computed based on the current time and date set in the Helios context. | |
| helios::SphericalCoord | getSunDirectionSpherical () const |
| Get a spherical coordinate vector pointing toward the sun for the current location. The sun angle is computed based on the current time and date set in the Helios context. | |
| void | setSunDirection (const helios::SphericalCoord &sundirection) |
| Override solar position calculation based on time in the Context by using a prescribed solar position. | |
| float | getSolarFlux (float pressure_Pa, float temperature_K, float humidity_rel, float turbidity) const |
| Get the solar radiation flux perpendicular to the sun direction. | |
| float | getSolarFluxPAR (float pressure_Pa, float temperature_K, float humidity_rel, float turbidity) const |
| Get the photosynthetically active (PAR) component of solar radiation flux perpendicular to the sun direction. | |
| float | getSolarFluxNIR (float pressure_Pa, float temperature_K, float humidity_rel, float turbidity) const |
| Get the near-infrared (NIR) component of solar radiation flux perpendicular to the sun direction. | |
| float | getDiffuseFraction (float pressure_Pa, float temperature_K, float humidity_rel, float turbidity) const |
| Get the fraction of solar radiation flux that is diffuse. | |
| float | getAmbientLongwaveFlux (float temperature_K, float humidity_rel) const |
| Calculate the ambient (sky) longwave radiation flux. | |
| float | calibrateTurbidityFromTimeseries (const std::string ×eries_shortwave_flux_label_Wm2) const |
| Calculate the turbidity value based on a timeseries of net radiation measurements. | |
| void | enableCloudCalibration (const std::string ×eries_shortwave_flux_label_Wm2) |
| Enable calibration of solar flux and diffuse fraction when possibility of clouds are present against measured solar flux data. | |
| void | disableCloudCalibration () |
| Disable calibration of solar flux and diffuse fraction for clouds. | |
| void | setAtmosphericConditions (float pressure_Pa, float temperature_K, float humidity_rel, float turbidity) |
| Set atmospheric conditions globally in the Context. | |
| void | getAtmosphericConditions (float &pressure_Pa, float &temperature_K, float &humidity_rel, float &turbidity) const |
| Get atmospheric conditions from the Context. | |
| float | getSolarFlux () const |
| Get the solar radiation flux perpendicular to the sun direction using atmospheric conditions from the Context. | |
| float | getSolarFluxPAR () const |
| Get the photosynthetically active (PAR) component of solar radiation flux perpendicular to the sun direction using atmospheric conditions from the Context. | |
| float | getSolarFluxNIR () const |
| Get the near-infrared (NIR) component of solar radiation flux perpendicular to the sun direction using atmospheric conditions from the Context. | |
| float | getDiffuseFraction () const |
| Get the fraction of solar radiation flux that is diffuse using atmospheric conditions from the Context. | |
| float | getAmbientLongwaveFlux () const |
| Calculate the ambient (sky) longwave radiation flux using atmospheric conditions from the Context. | |
| void | calculateDirectSolarSpectrum (const std::string &label, float resolution_nm=1.0f) |
| Calculate direct beam solar spectrum and store in global data. | |
| void | calculateDiffuseSolarSpectrum (const std::string &label, float resolution_nm=1.0f) |
| Calculate diffuse solar spectrum and store in global data. | |
| void | calculateGlobalSolarSpectrum (const std::string &label, float resolution_nm=1.0f) |
| Calculate global (total) solar spectrum and store in global data. | |
| void | enablePragueSkyModel () |
| Enable Prague sky model for atmospheric sky radiance computation. | |
| bool | isPragueSkyModelEnabled () const |
| Check if Prague sky model is enabled. | |
| void | updatePragueSkyModel (float ground_albedo=0.33f) |
| Update Prague sky model and store spectral-angular parameters in Context. | |
| bool | pragueSkyModelNeedsUpdate (float ground_albedo=0.33f, float sun_tolerance=0.01f, float turbidity_tolerance=0.02f, float albedo_tolerance=0.05f) const |
| Check if Prague sky model update is needed based on changed conditions. | |
Static Public Member Functions | |
| static int | selfTest (int argc=0, char **argv=nullptr) |
| Function to perform a self-test of model functions. | |
Definition at line 25 of file SolarPosition.h.
|
explicit |
Solar position model default constructor. Initializes location based on the location set in the Context.
| [in] | context_ptr | Pointer to the Helios context |
Definition at line 22 of file SolarPosition.cpp.
| SolarPosition::SolarPosition | ( | float | UTC_hrs, |
| float | latitude_deg, | ||
| float | longitude_deg, | ||
| helios::Context * | context_ptr | ||
| ) |
Solar position model constructor.
| [in] | context_ptr | Pointer to the Helios context |
| [in] | UTC_hrs | Hours from Coordinated Universal Time (UTC) for location of interest. Convention is that UTC is positive moving Westward. |
| [in] | latitude_deg | Latitude in degrees for location of interest. Convention is latitude is positive for Northern hemisphere. |
| [in] | longitude_deg | Longitude in degrees for location of interest. Convention is longitude is positive for Western hemisphere. |
Definition at line 30 of file SolarPosition.cpp.
| void SolarPosition::calculateDiffuseSolarSpectrum | ( | const std::string & | label, |
| float | resolution_nm = 1.0f |
||
| ) |
Calculate diffuse solar spectrum and store in global data.
| [in] | label | User-defined label for storing spectral data in Context global data |
| [in] | resolution_nm | Wavelength resolution in nm (default: 1 nm). Must be >= 1 nm and <= 2300 nm. |
Definition at line 1013 of file SolarPosition.cpp.
| void SolarPosition::calculateDirectSolarSpectrum | ( | const std::string & | label, |
| float | resolution_nm = 1.0f |
||
| ) |
Calculate direct beam solar spectrum and store in global data.
| [in] | label | User-defined label for storing spectral data in Context global data |
| [in] | resolution_nm | Wavelength resolution in nm (default: 1 nm). Must be >= 1 nm and <= 2300 nm. |
Definition at line 1007 of file SolarPosition.cpp.
| void SolarPosition::calculateGlobalSolarSpectrum | ( | const std::string & | label, |
| float | resolution_nm = 1.0f |
||
| ) |
Calculate global (total) solar spectrum and store in global data.
| [in] | label | User-defined label for storing spectral data in Context global data |
| [in] | resolution_nm | Wavelength resolution in nm (default: 1 nm). Must be >= 1 nm and <= 2300 nm. |
Definition at line 1019 of file SolarPosition.cpp.
| float SolarPosition::calibrateTurbidityFromTimeseries | ( | const std::string & | timeseries_shortwave_flux_label_Wm2 | ) | const |
Calculate the turbidity value based on a timeseries of net radiation measurements.
| [in] | timeseries_shortwave_flux_label_Wm2 | Label of the timeseries variable in the Helios context that contains the net radiation flux measurements |
Definition at line 390 of file SolarPosition.cpp.
| void SolarPosition::disableCloudCalibration | ( | ) |
Disable calibration of solar flux and diffuse fraction for clouds.
Definition at line 442 of file SolarPosition.cpp.
| void SolarPosition::enableCloudCalibration | ( | const std::string & | timeseries_shortwave_flux_label_Wm2 | ) |
Enable calibration of solar flux and diffuse fraction when possibility of clouds are present against measured solar flux data.
| [in] | timeseries_shortwave_flux_label_Wm2 | Label for timeseries data field containing measured total shortwave flux data (W/m^2). |
Definition at line 433 of file SolarPosition.cpp.
| void SolarPosition::enablePragueSkyModel | ( | ) |
Enable Prague sky model for atmospheric sky radiance computation.
Definition at line 1027 of file SolarPosition.cpp.
| float SolarPosition::getAmbientLongwaveFlux | ( | ) | const |
Calculate the ambient (sky) longwave radiation flux using atmospheric conditions from the Context.
Definition at line 548 of file SolarPosition.cpp.
| float SolarPosition::getAmbientLongwaveFlux | ( | float | temperature_K, |
| float | humidity_rel | ||
| ) | const |
Calculate the ambient (sky) longwave radiation flux.
| [in] | temperature_K | Air temperature near the ground surface in Kelvin |
| [in] | humidity_rel | Air relative humidity near the ground surface |
Definition at line 359 of file SolarPosition.cpp.
| void SolarPosition::getAtmosphericConditions | ( | float & | pressure_Pa, |
| float & | temperature_K, | ||
| float & | humidity_rel, | ||
| float & | turbidity | ||
| ) | const |
Get atmospheric conditions from the Context.
| [out] | pressure_Pa | Atmospheric pressure near ground surface in Pascals |
| [out] | temperature_K | Air temperature near the ground surface in Kelvin |
| [out] | humidity_rel | Air relative humidity near the ground surface |
| [out] | turbidity | Ångström's aerosol turbidity coefficient (β), representing aerosol optical depth (AOD) at 500 nm |
Definition at line 468 of file SolarPosition.cpp.
| float SolarPosition::getDiffuseFraction | ( | ) | const |
Get the fraction of solar radiation flux that is diffuse using atmospheric conditions from the Context.
Definition at line 536 of file SolarPosition.cpp.
| float SolarPosition::getDiffuseFraction | ( | float | pressure_Pa, |
| float | temperature_K, | ||
| float | humidity_rel, | ||
| float | turbidity | ||
| ) | const |
Get the fraction of solar radiation flux that is diffuse.
| [in] | pressure_Pa | Atmospheric pressure near ground surface in Pascals |
| [in] | temperature_K | Air temperature near the ground surface in Kelvin |
| [in] | humidity_rel | Air relative humidity near the ground surface |
| [in] | turbidity | Ångström's aerosol turbidity coefficient (AOD at 500 nm). Typical values: 0.02 (very clear), 0.05 (clear), 0.1 (hazy) |
Definition at line 217 of file SolarPosition.cpp.
| float SolarPosition::getSolarFlux | ( | ) | const |
Get the solar radiation flux perpendicular to the sun direction using atmospheric conditions from the Context.
Definition at line 499 of file SolarPosition.cpp.
| float SolarPosition::getSolarFlux | ( | float | pressure_Pa, |
| float | temperature_K, | ||
| float | humidity_rel, | ||
| float | turbidity | ||
| ) | const |
Get the solar radiation flux perpendicular to the sun direction.
| [in] | pressure_Pa | Atmospheric pressure near ground surface in Pascals |
| [in] | temperature_K | Air temperature near the ground surface in Kelvin |
| [in] | humidity_rel | Air relative humidity near the ground surface |
| [in] | turbidity | Ångström's aerosol turbidity coefficient (AOD at 500 nm). Typical values: 0.02 (very clear), 0.05 (clear), 0.1 (hazy) |
Definition at line 186 of file SolarPosition.cpp.
| float SolarPosition::getSolarFluxNIR | ( | ) | const |
Get the near-infrared (NIR) component of solar radiation flux perpendicular to the sun direction using atmospheric conditions from the Context.
Definition at line 524 of file SolarPosition.cpp.
| float SolarPosition::getSolarFluxNIR | ( | float | pressure_Pa, |
| float | temperature_K, | ||
| float | humidity_rel, | ||
| float | turbidity | ||
| ) | const |
Get the near-infrared (NIR) component of solar radiation flux perpendicular to the sun direction.
| [in] | pressure_Pa | Atmospheric pressure near ground surface in Pascals |
| [in] | temperature_K | Air temperature near the ground surface in Kelvin |
| [in] | humidity_rel | Air relative humidity near the ground surface |
| [in] | turbidity | Ångström's aerosol turbidity coefficient (AOD at 500 nm). Typical values: 0.02 (very clear), 0.05 (clear), 0.1 (hazy) |
Definition at line 207 of file SolarPosition.cpp.
| float SolarPosition::getSolarFluxPAR | ( | ) | const |
Get the photosynthetically active (PAR) component of solar radiation flux perpendicular to the sun direction using atmospheric conditions from the Context.
Definition at line 512 of file SolarPosition.cpp.
| float SolarPosition::getSolarFluxPAR | ( | float | pressure_Pa, |
| float | temperature_K, | ||
| float | humidity_rel, | ||
| float | turbidity | ||
| ) | const |
Get the photosynthetically active (PAR) component of solar radiation flux perpendicular to the sun direction.
| [in] | pressure_Pa | Atmospheric pressure near ground surface in Pascals |
| [in] | temperature_K | Air temperature near the ground surface in Kelvin |
| [in] | humidity_rel | Air relative humidity near the ground surface |
| [in] | turbidity | Ångström's aerosol turbidity coefficient (AOD at 500 nm). Typical values: 0.02 (very clear), 0.05 (clear), 0.1 (hazy) |
Definition at line 197 of file SolarPosition.cpp.
| float SolarPosition::getSunAzimuth | ( | ) | const |
Get the current sun azimuthal angle in radians for the current location. The sun angle is computed based on the current time and date set in the Helios context.
Definition at line 151 of file SolarPosition.cpp.
| SphericalCoord SolarPosition::getSunDirectionSpherical | ( | ) | const |
Get a spherical coordinate vector pointing toward the sun for the current location. The sun angle is computed based on the current time and date set in the Helios context.
Definition at line 171 of file SolarPosition.cpp.
| vec3 SolarPosition::getSunDirectionVector | ( | ) | const |
Get a unit vector pointing toward the sun for the current location. The sun angle is computed based on the current time and date set in the Helios context.
Definition at line 161 of file SolarPosition.cpp.
| float SolarPosition::getSunElevation | ( | ) | const |
Get the current sun elevation angle in radians for the current location. The sun angle is computed based on the current time and date set in the Helios context.
Definition at line 131 of file SolarPosition.cpp.
| Time SolarPosition::getSunriseTime | ( | ) | const |
Get the approximate time of sunrise at the current location.
Definition at line 95 of file SolarPosition.cpp.
| Time SolarPosition::getSunsetTime | ( | ) | const |
Get the approximate time of sunset at the current location.
Definition at line 113 of file SolarPosition.cpp.
| float SolarPosition::getSunZenith | ( | ) | const |
Get the current sun zenithal angle in radians for the current location. The sun angle is computed based on the current time and date set in the Helios context.
Definition at line 141 of file SolarPosition.cpp.
| bool SolarPosition::isPragueSkyModelEnabled | ( | ) | const |
Check if Prague sky model is enabled.
Definition at line 1046 of file SolarPosition.cpp.
| bool SolarPosition::pragueSkyModelNeedsUpdate | ( | float | ground_albedo = 0.33f, |
| float | sun_tolerance = 0.01f, |
||
| float | turbidity_tolerance = 0.02f, |
||
| float | albedo_tolerance = 0.05f |
||
| ) | const |
Check if Prague sky model update is needed based on changed conditions.
| [in] | ground_albedo | Current ground albedo |
| [in] | sun_tolerance | Threshold for sun direction changes (default: 0.01 ≈ 0.57°) |
| [in] | turbidity_tolerance | Relative threshold for turbidity (default: 0.02 = 2%) |
| [in] | albedo_tolerance | Threshold for albedo changes (default: 0.05 = 5%) |
Definition at line 1123 of file SolarPosition.cpp.
|
static |
Function to perform a self-test of model functions.
Definition at line 563 of file selfTest.cpp.
| void SolarPosition::setAtmosphericConditions | ( | float | pressure_Pa, |
| float | temperature_K, | ||
| float | humidity_rel, | ||
| float | turbidity | ||
| ) |
Set atmospheric conditions globally in the Context.
| [in] | pressure_Pa | Atmospheric pressure near ground surface in Pascals (must be > 0) |
| [in] | temperature_K | Air temperature near the ground surface in Kelvin (must be > 0) |
| [in] | humidity_rel | Air relative humidity near the ground surface (must be between 0 and 1) |
| [in] | turbidity | Ångström's aerosol turbidity coefficient (β), representing aerosol optical depth (AOD) at 500 nm reference wavelength (must be >= 0). Typical values: 0.02 (very clear sky), 0.05 (clear sky), 0.1 (light haze), 0.2-0.3 (hazy), >0.4 (very hazy/polluted). Note: This is NOT Linke turbidity, which uses a different scale (typically 2-6). |
Definition at line 446 of file SolarPosition.cpp.
| void SolarPosition::setSunDirection | ( | const helios::SphericalCoord & | sundirection | ) |
Override solar position calculation based on time in the Context by using a prescribed solar position.
| [in] | sundirection | SphericalCoord giving the direction of the sun |
Definition at line 181 of file SolarPosition.cpp.
| void SolarPosition::updatePragueSkyModel | ( | float | ground_albedo = 0.33f | ) |
Update Prague sky model and store spectral-angular parameters in Context.
| [in] | ground_albedo | Ground reflectance [0-1] (default: 0.33 for vegetation) |
Definition at line 1050 of file SolarPosition.cpp.