19 #ifndef CARMA_SERVICES_ATMOSPHERE_H
20 #define CARMA_SERVICES_ATMOSPHERE_H
185 typedef enum dewPointMethodEnum {
189 } dewPointMethodType ;
225 double waterColumn(
double airTemp,
double relHumid)
const;
288 dewPointMethodType method = CLAUSIUS_CLAPEYRON )
const;
308 dewPointMethodType method = CLAUSIUS_CLAPEYRON )
const;
331 double frequency)
const;
361 double altitude)
const;
378 double frequency)
const;
425 double altitude = 0.0)
const;
450 double frequency)
const;
700 dewPointMethodType method = CLAUSIUS_CLAPEYRON,
701 double consistencyPercent = 10.0 );
802 static bool isSafeWindSpeed(
double windSpeed );
812 static const double CC_A = 6.105;
813 static const double CC_B = 25.22;
814 static const double CC_C = 5.31;
822 static const double AWIPS_C1 = 0.0091379024;
823 static const double AWIPS_C2 = 6106.396;
824 static const double AWIPS_C3 = 223.1986;
825 static const double AWIPS_C4 = 0.0182758048;
826 static const double AWIPS_C15 = 26.66082;
832 static const double MT_A = 17.27;
833 static const double MT_B = 237.7;
839 static const double HW_A = 1.598E9;
840 static const double HW_B = 5370;
848 static const double SW_DRY_AIR = 77.6;
854 static const double BW_DRY_AIR = 77.6;
865 static const double SW_INDUCED_DIPOLE = 0.128;
869 static const double BW_INDUCED_DIPOLE = 5.6;
880 static const double SW_PERM_DIPOLE = 3.776E3;
884 static const double BW_PERM_DIPOLE = 3.75E3;
892 static const double REFRAC_COEFF_A = -2.8354E-5;
900 static const double REFRAC_COEFF_B = 5.4012E-7;
909 static const double MIN_REFRAC_FREQ = 50.0;
933 static const double A1_RAD_1 = 0.5753868;
934 static const double A1_RAD_P = 0.5291E-4;
935 static const double A1_RAD_PPW = -0.2819E-4;
936 static const double A1_RAD_PPWSQ = -0.9381E-6;
937 static const double A1_RAD_T = -0.5958E-3;
938 static const double A1_RAD_TSQ = 0.2657E-5;
940 static const double A2_RAD_1 = 1.301211;
941 static const double A2_RAD_P = 0.2003E-4;
942 static const double A2_RAD_PPW = -0.7285E-4;
943 static const double A2_RAD_PPWSQ = 0.2579E-5;
944 static const double A2_RAD_T = -0.2595E-2;
945 static const double A2_RAD_TSQ = 0.8509E-5;
948 static const double A1_OPT_1 = 0.5787089;
949 static const double A1_OPT_P = 0.5609E-4;
950 static const double A1_OPT_T = -0.6229E-3;
951 static const double A1_OPT_TSQ = 0.2824E-5;
952 static const double A1_OPT_PPW = 0.5177E-3;
953 static const double A1_OPT_PPWSQ = 0.2900E-6;
954 static const double A1_OPT_WAVE = -0.1644E-1;
955 static const double A1_OPT_WAVESQ = 0.4910E-1;
957 static const double A2_OPT_1 = 1.302474;
958 static const double A2_OPT_P = 0.2142E-4;
959 static const double A2_OPT_T = 0.1287E-2;
960 static const double A2_OPT_TSQ = 0.6500E-6;
961 static const double A2_OPT_PPW = -0.2623E-2;
962 static const double A2_OPT_PPWSQ = 0.8776E-5;
963 static const double A2_OPT_WAVE = -0.6298E-2;
964 static const double A2_OPT_WAVESQ = 0.1890E-1;
972 static const double P_OFFSET = -1013.25;
974 static const double T_OFFSET = -258.15;
976 static const double WAVE_OFFSET = -0.5320;
988 static const double RMG = 29.333895;
992 static const double MAP1 = 13.24969;
993 static const double MAP2 = 173.4233;
1001 double lastSafeRelativeHumidity_;
1042 static const scaleHeightType scaleHeight;
1059 double freqDependence(
double frequency);
1077 double computeMappingFunction(
1083 double altitude)
const;
1091 double ulichMappingFunction(
double elevation)
const;
1105 double normalizedEffectiveZenith(
double airTemp,
1107 double altitude)
const;
1114 bool isOptical(
double frequency)
const;
1125 double a1Radio(
double p0,
double t0,
double ppw)
const;
1136 double a2Radio(
double p0,
double t0,
double ppw)
const;
1147 double a1Optical(
double p0,
double t0,
double ppw,
double w0)
const;
1158 double a2Optical(
double p0,
double t0,
double ppw,
double w0)
const;
1164 #endif //CARMA_SERVICES_ATMOSPHERE_H
static bool isSafeElevation(double elevation)
double computeRefractionCorrection(double airTemp, double atmPressure, double relHumid, double elevation, double frequency, double altitude) const
Compute the refraction pointing correction, given the in vacuo elevation and weather parameters...
static const double DEFAULT_ATM_PRESSURE
Default atmospheric pressure, in millibars For when weather station measurement unavailable.
carma::services::Temperature lastSafeDewPoint() const
static const double MIN_AIR_TEMP
Minimum believable air temperature, in Kelvin If weather station gives value below this...
static const double MAX_RH
Maximum believable relative humidity, in percent If weather station gives value above this...
static const double MIN_ATM_PRESSURE
Minimum believable atmospheric pressure, in millibars.
carma::services::Temperature lastSafeAirTemperature() const
double waterVaporDensity(double airTemp, double relHumid) const
The water vapor density is derived from the relative humidity and saturated pressure, and is the amount of water in the atmosphere.
double computeHumidity(double airTemp, double dewTemp, dewPointMethodType method=CLAUSIUS_CLAPEYRON) const
The relative humidity is computed from the ambient and dew point temperatures.
static const double MAX_ATM_PRESSURE
Maximum believable atmospheric pressure, in millibars If weather station gives value above this...
double computeZenithRefractivity(double airTemp, double atmPressure, double relHumid, double frequency) const
The refractivity, N_O, at zenith.
Representation of Pressure.
This class is used to calculate a variety of quantities related to the earth's atmosphere, such as refractivity, saturated pressure, and pathlength (refractivity integrated through the atmosphere).
static const double MIN_RH
Minimum believable relative humidity, in percent If weather station gives value below this...
static const double STANDARD_ATM_PRESSURE
US standard 1 atm of pressure.
static const double MIN_WIND_SPEED
Minimum wind speed, in mph If weather station gives value below this, there is probably something wro...
Representation of an angle, return values are always modulo 2PI radians.
static double safeElevation(double elevation)
static const double MIN_ELEVATION
The minimum elevation at which pathlength will be directly calculated, in radians.
double computeHorizonPathlength(double airTemp, double atmPressure, double relHumid, double frequency) const
Calculate the maximum possible pathlength, toward the horizon.
static double safeRelativeHumidity(double relHumid)
This method is meant to check that a given relative humidity is within reasonable bounds for the CARM...
static const double DEFAULT_DEW_POINT
Default dew point, in Kelvin For when weather station measurement unavailable.
bool isConsistentDewPoint(services::Temperature dewPoint, services::Temperature airTemp, double relHumid, dewPointMethodType method=CLAUSIUS_CLAPEYRON, double consistencyPercent=10.0)
Check that a given dewPoint value is consistent with its paired ambient air temperature and relative ...
The Velocity class can represent an velocity in any units.
static const double DEFAULT_RH
Default relative humidity, in percent For when weather station measurement unavailable.
double waterColumn(double airTemp, double relHumid) const
The water column is derived from the water vapor density and an assumed scaleheight for the wet atmos...
Atmosphere()
no-arg constructor
double waterPartialPressure(double airTemp, double relHumid) const
Compute the partial pressure of water given the ambient air temperature and relative humidity...
The Temperature class represents a temperature in any unit.
static carma::services::Velocity safeWindSpeed(carma::services::Velocity windSpeed)
This method is meant to check that a given wind speed is within reasonable bounds for the CARMA site...
The Pressure class can represent any pressure in any units.
static double safeDewPoint(double dewPoint)
This method is meant to check that a given dew point temperature is within reasonable bounds for the ...
carma/services/Temperature.h Representation of Temperature
static const double DEFAULT_AIR_TEMP
Default air temperature, in Kelvin For when weather station measurement unavailable.
The Angle class can represent any angle in any units.
virtual ~Atmosphere()
destructor
static double safeAtmPressure(double atmPressure)
This method is meant to check that a given atmospheric pressure is within reasonable bounds for the C...
double computePathlength(double airTemp, double atmPressure, double relHumid, double elevation, double frequency, double altitude=0.0) const
static double safeAirTemperature(double airTemp)
This method is meant to check that a given air temperature is within reasonable bounds for the CARMA ...
static bool isSafeAtmPressure(double atmPressure)
static const double MAX_DEW_POINT
Maximum believable dew point, in Kelvin If weather station gives value above this, there is probably something wrong, so fall back to default.
static const double MIN_DEW_POINT
Minimum believable dew point, in Kelvin If weather station gives value below this, there is probably something wrong, so fall back to default.
static bool isSafeAirTemperature(double airTemp)
double computeSaturatedPressure(double airTemp) const
The surface saturated water vapor pressure is used in the calculation of the refractivity.
Representation of Velocity in any units.
static const double MAX_AIR_TEMP
Maximum believable air temperature, in Kelvin If weather station gives value above this...
double lastSafeRelativeHumidity() const
static bool isSafeDewPoint(double dewPoint)
double ulichRefractionCorrection(double airTemp, double atmPressure, double relHumid, double elevation, double frequency) const
This is to test against the Ulich (1981) radio refraction formulation NOTE: RADIO ONLY...
static const double DEFAULT_WIND_SPEED
Default wind speed, in mph.
carma::services::Pressure lastSafeAtmPressure() const
static const double MAX_WIND_SPEED
Maximum reasonable wind speed, in mph If weather station gives value above this, there is probably so...
double computeDewPoint(double airTemp, double relHumid, dewPointMethodType method=CLAUSIUS_CLAPEYRON) const
The dewpoint temperature defines the temperature to which a parcel of air would need to be cooled at ...
static bool isSafeRelativeHumidity(double relHumid)
This class is based on the GNU units library.