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. | |
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 21 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 21 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 29 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 381 of file SolarPosition.cpp.
void SolarPosition::disableCloudCalibration | ( | ) |
Disable calibration of solar flux and diffuse fraction for clouds.
Definition at line 431 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 422 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 354 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 | Angstrom's aerosol turbidity coefficient |
Definition at line 213 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 | Angstrom's aerosol turbidity coefficient |
Definition at line 185 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 | Angstrom's aerosol turbidity coefficient |
Definition at line 204 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 | Angstrom's aerosol turbidity coefficient |
Definition at line 195 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 150 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 170 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 160 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 130 of file SolarPosition.cpp.
Time SolarPosition::getSunriseTime | ( | ) | const |
Get the approximate time of sunrise at the current location.
Definition at line 94 of file SolarPosition.cpp.
Time SolarPosition::getSunsetTime | ( | ) | const |
Get the approximate time of sunset at the current location.
Definition at line 112 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 140 of file SolarPosition.cpp.
|
static |
Function to perform a self-test of model functions.
Definition at line 232 of file selfTest.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 180 of file SolarPosition.cpp.