CARMA C++
carma::services::Atmosphere Class Reference

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). More...

#include <carma/services/Atmosphere.h>

Public Types

enum  dewPointMethodEnum { CLAUSIUS_CLAPEYRON, MAGNUS_TETENS, HOFFMAN_WELCH }
 
typedef enum
carma::services::Atmosphere::dewPointMethodEnum 
dewPointMethodType
 

Public Member Functions

 Atmosphere ()
 no-arg constructor More...
 
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 constant pressure and constant moisture content in order for the vapor pressure and saturation vapor pressure of the parcel to be equal. More...
 
double computeHorizonPathlength (double airTemp, double atmPressure, double relHumid, double frequency) const
 Calculate the maximum possible pathlength, toward the horizon. More...
 
double computeHumidity (double airTemp, double dewTemp, dewPointMethodType method=CLAUSIUS_CLAPEYRON) const
 The relative humidity is computed from the ambient and dew point temperatures. More...
 
double computePathlength (double airTemp, double atmPressure, double relHumid, double elevation, double frequency, double altitude=0.0) const
 
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. More...
 
double computeSaturatedPressure (double airTemp) const
 The surface saturated water vapor pressure is used in the calculation of the refractivity. More...
 
double computeZenithRefractivity (double airTemp, double atmPressure, double relHumid, double frequency) const
 The refractivity, N_O, at zenith. More...
 
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 humidity. More...
 
carma::services::Temperature lastSafeAirTemperature (double airTemp)
 This method checks if the input air temperature is safe and if so saves and returns the value. More...
 
carma::services::Temperature lastSafeAirTemperature (carma::services::Temperature airTemp)
 This method checks if the input air temperature is safe and if so saves and returns the value. More...
 
carma::services::Temperature lastSafeAirTemperature () const
 
carma::services::Pressure lastSafeAtmPressure (double atmPressure)
 This method checks if the input atmospheric pressure is safe and if so saves and returns the value. More...
 
carma::services::Pressure lastSafeAtmPressure (carma::services::Pressure atmPressure)
 This method checks if the input atmospheric pressure is safe and if so saves and returns the value. More...
 
carma::services::Pressure lastSafeAtmPressure () const
 
carma::services::Temperature lastSafeDewPoint (double dewPoint)
 This method checks if the input dew point is safe and if so saves and returns the value. More...
 
carma::services::Temperature lastSafeDewPoint (carma::services::Temperature dewPoint)
 This method checks if the input dew point is safe and if so saves and returns the value. More...
 
carma::services::Temperature lastSafeDewPoint () const
 
double lastSafeRelativeHumidity (double relHumid)
 This method checks if the input relative humidity is safe and if so saves and returns the value. More...
 
double lastSafeRelativeHumidity () const
 
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. More...
 
double waterColumn (double airTemp, double relHumid) const
 The water column is derived from the water vapor density and an assumed scaleheight for the wet atmosphere (assumed to be about 2.1km) More...
 
double waterPartialPressure (double airTemp, double relHumid) const
 Compute the partial pressure of water given the ambient air temperature and relative humidity. More...
 
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. More...
 
virtual ~Atmosphere ()
 destructor More...
 

Static Public Member Functions

static bool isSafeAirTemperature (double airTemp)
 
static bool isSafeAirTemperature (carma::services::Temperature airTemp)
 
static bool isSafeAtmPressure (double atmPressure)
 
static bool isSafeAtmPressure (carma::services::Pressure atmPressure)
 
static bool isSafeDewPoint (double dewPoint)
 
static bool isSafeDewPoint (carma::services::Temperature dewPoint)
 
static bool isSafeElevation (double elevation)
 
static bool isSafeElevation (carma::services::Angle elevation)
 
static bool isSafeRelativeHumidity (double relHumid)
 
static bool isSafeWindSpeed (carma::services::Velocity windSpeed)
 
static bool isSafeWindSpeed (double windSpeed)
 
static double safeAirTemperature (double airTemp)
 This method is meant to check that a given air temperature is within reasonable bounds for the CARMA site. More...
 
static carma::services::Temperature safeAirTemperature (carma::services::Temperature airTemp)
 This method is meant to check that a given air temperature is within reasonable bounds for the CARMA site. More...
 
static double safeAtmPressure (double atmPressure)
 This method is meant to check that a given atmospheric pressure is within reasonable bounds for the CARMA site. More...
 
static carma::services::Pressure safeAtmPressure (carma::services::Pressure atmPressure)
 This method is meant to check that a given atmospheric pressure is within reasonable bounds for the CARMA site. More...
 
static double safeDewPoint (double dewPoint)
 This method is meant to check that a given dew point temperature is within reasonable bounds for the CARMA site. More...
 
static carma::services::Temperature safeDewPoint (carma::services::Temperature dewPoint)
 This method is meant to check that a given dew point temperature is within reasonable bounds for the CARMA site. More...
 
static double safeElevation (double elevation)
 
static carma::services::Angle safeElevation (carma::services::Angle elevation)
 
static double safeRelativeHumidity (double relHumid)
 This method is meant to check that a given relative humidity is within reasonable bounds for the CARMA site. More...
 
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. More...
 
static double safeWindSpeed (double windSpeed)
 This method is meant to check that a given wind speed is within reasonable bounds for the CARMA site. More...
 

Static Public Attributes

static const double DEFAULT_AIR_TEMP = 300.0
 Default air temperature, in Kelvin For when weather station measurement unavailable. More...
 
static const double DEFAULT_ATM_PRESSURE = 780.0
 Default atmospheric pressure, in millibars For when weather station measurement unavailable. More...
 
static const double DEFAULT_DEW_POINT = 278.388
 Default dew point, in Kelvin For when weather station measurement unavailable. More...
 
static const double DEFAULT_RH = 25.0
 Default relative humidity, in percent For when weather station measurement unavailable. More...
 
static const double DEFAULT_WIND_SPEED = 0.0
 Default wind speed, in mph. More...
 
static const double MAX_AIR_TEMP = 316.5
 Maximum believable air temperature, in Kelvin If weather station gives value above this, there is probably something wrong, so fall back to default. More...
 
static const double MAX_ATM_PRESSURE = 1115.0
 Maximum believable atmospheric pressure, in millibars If weather station gives value above this, there is probably something wrong, so fall back to default. More...
 
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. More...
 
static const double MAX_RH = 100.0
 Maximum believable relative humidity, in percent If weather station gives value above this, there is probably something wrong, so fall back to default. More...
 
static const double MAX_WIND_SPEED = 200.0
 Maximum reasonable wind speed, in mph If weather station gives value above this, there is probably something wrong, so fall back to default. More...
 
static const double MIN_AIR_TEMP = 242.0
 Minimum believable air temperature, in Kelvin If weather station gives value below this, there is probably something wrong, so fall back to default. More...
 
static const double MIN_ATM_PRESSURE = 680
 Minimum believable atmospheric pressure, in millibars. More...
 
static const double MIN_DEW_POINT = 221.9
 Minimum believable dew point, in Kelvin If weather station gives value below this, there is probably something wrong, so fall back to default. More...
 
static const double MIN_ELEVATION = 0.0174533
 The minimum elevation at which pathlength will be directly calculated, in radians. More...
 
static const double MIN_RH = 5.0
 Minimum believable relative humidity, in percent If weather station gives value below this, there is probably something wrong, so fall back to default. More...
 
static const double MIN_WIND_SPEED = 0.0
 Minimum wind speed, in mph If weather station gives value below this, there is probably something wrong, so fall back to default. More...
 
static const double STANDARD_ATM_PRESSURE = 1013.25
 US standard 1 atm of pressure. More...
 

Detailed Description

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).

Many of these depend upon the weather conditions such as air temperature, pressure, humidity. The class also contains reasonable default, minimum, and maximum values for these weather parameters. The current user of this class is the Delay Engine, however it is expected that Auxiliary Services will use this class to calculate antenna refraction pointing corrections. The Weather Station might also use this class.

Todo:
  • Verify the min, max, default values for atmospheric quantities are sensible.
  • Possibly modify computeHorizonPathlength() to take into account all 3 scale heights.

Definition at line 46 of file Atmosphere.h.

Constructor & Destructor Documentation

carma::services::Atmosphere::Atmosphere ( )

no-arg constructor

virtual carma::services::Atmosphere::~Atmosphere ( )
virtual

destructor

Member Function Documentation

double carma::services::Atmosphere::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 constant pressure and constant moisture content in order for the vapor pressure and saturation vapor pressure of the parcel to be equal.

In other words, it's the temperature at which a parcel of air would be saturated (i.e., 100% relative humidity)

The dewpoint temperature is computed from relative humidity and air temperature. There are a few alternate methods available.

  1. Modified Clausius-Clapeyron equation
  2. Magnus-Tetens formula
  3. Latent Heat of Vaporization


See Also
Further discussion of the C-C equation
<a href=http://www.paroscientific.com/dewpoint.htm Further discussion of the Magnus-Tetens formula
Parameters
airTemp the ambient air temperature in Kelvin
relHumidthe relative humidity, in percent (0..100)
method compute method
Returns
the dewpoint temperature, in Kelvin
double carma::services::Atmosphere::computeHorizonPathlength ( double  airTemp,
double  atmPressure,
double  relHumid,
double  frequency 
) const

Calculate the maximum possible pathlength, toward the horizon.

This is defined in terms of the zenith refractivity and Earth constants in TMS equation 13.40. Its value depends on weather conditions. This method will NOT check that the air temperature, atmospheric pressure, and RH are "safe"; use safeAirTemperature(), safeAtmPressure(), and safeRelativeHumidity() to do that.

Parameters
atmPressureThe atmospheric pressure in millibars
airTempThe ambient air temperature in Kelvin
relHumidThe relative humidity in percent
frequencyThe observing frequency, Hz
Returns
The horizon pathlength, in meters
See Also
computeZenithRefractivity(double airTemp, double atmPressure, double relHumid)
double carma::services::Atmosphere::computeHumidity ( double  airTemp,
double  dewTemp,
dewPointMethodType  method = CLAUSIUS_CLAPEYRON 
) const

The relative humidity is computed from the ambient and dew point temperatures.

There are a few alternate methods available.

Parameters
airTempthe ambient air temperature in Kelvin
dewTempdew point temperature, in Kelvin
methodcompute method (see above)
Returns
relHumid the relative humidity, in percent (0..100)
See Also
computeDewPoint(double airTemp, double relHumid, dewPointmethodType method) for explanation of compute method
double carma::services::Atmosphere::computePathlength ( double  airTemp,
double  atmPressure,
double  relHumid,
double  elevation,
double  frequency,
double  altitude = 0.0 
) const

This method calculates the refractivity integrated through the atmosphere, that is, the pathlength. See equation 18 of the interferometry design document. This expression for pathlength diverges as elevation approaches zero degrees. Therefore, if the source elevation is below some minimum, the maximum (horizon) pathlength as defined by TMS equation 13.40 is returned.

The pathlength depends on weather conditions. This method will NOT check that the air temperature, atmospheric pressure, and RH are "safe"; use safeAirTemperature(), safeAtmPressure(), and safeRelativeHumidity() to do that.

Note the refraction correction to the elevation is not applied internally by this method. If you want the pathlength for the refraction-corrected elevation, you must first add the the elevation the return value computeRefractionCorrection().

Parameters
atmPressureThe atmospheric pressure in millibars
airTempThe ambient air temperature in Kelvin
relHumidThe relative humidity in percent
elevationThe source elevation in radians
frequencyThe observing frequency, Hz
thealtitude (station height) of the antenna above the array reference plane, meters.
Returns
the pathlength, in meters
See Also
computeZenithRefractivity(double airTemp, double atmPressure, double relHumid)
computeHorizonPathlength()
computeRefractionCorrection()
safeAirTemperature(double airTemp)
safeAtmPressure(double airTemp)
safeRelativeHumidity(double relHumid)
double carma::services::Atmosphere::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.

The return value should be added to the in vacuo elevation. The frequency parameter indicates whether the optical or radio correction is returned. If frequency is greater than 3 THz, the optical correction is returned, otherwise the radio correction is returned. The refraction correction is done using the mapping function of Yan (1996) as written by Mangum ALMA Memo 366.

Parameters
airTempThe ambient air temperature in Kelvin
atmPressureThe atmospheric pressure in millibars
relHumidThe relative humidity in percent
elevationThe in vacuo (uncorrected) elevation in radians
frequencyThe observing frequency, Hz
thealtitude (station height) of the antenna above
Returns
the refraction pointing correction in radians to add to the uncorrected elevation.
double carma::services::Atmosphere::computeSaturatedPressure ( double  airTemp) const

The surface saturated water vapor pressure is used in the calculation of the refractivity.

This method will NOT check that the air temperature is "safe", use safeAirTemperature() to do that.

Parameters
airTempThe ambient air temperature in Kelvin
Returns
the surface saturated water vapor pressure in millibars (equation 13 in interferometry design document)
See Also
safeAirTemperature(double airTemp)
double carma::services::Atmosphere::computeZenithRefractivity ( double  airTemp,
double  atmPressure,
double  relHumid,
double  frequency 
) const

The refractivity, N_O, at zenith.

See equation 14 of the interferometry design document. Its value depends on weather conditions. This method will NOT check that the air temperature, atmospheric pressure, and RH are "safe"; use safeAirTemperature(), safeAtmPressure(), and safeRelativeHumidity() to do that.

Parameters
airTempThe ambient air temperature in Kelvin
atmPressureThe atmospheric pressure in millibars
relHumidThe relative humidity in percent
frequencyThe observing frequency, Hz
Returns
zenith refractivity.
See Also
safeAirTemperature(double airTemp)
safeAtmPressure(double airTemp)
safeRelativeHumidity(double relHumid)
bool carma::services::Atmosphere::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 humidity.

Parameters
dewPointThe dew point temperature to check
airTempThe ambient air temperature to use in the calculation
relHumidThe relative humidity in percent
methodcompute method
consistencyPercentThe sloppiness of the consistency check.
Returns
true if the dewPoint entered is consistent with the air temp and relative humidity. Consistency means input dewPoint is within +/-consistencyPercent (inclusive range) of that returned by computeDewPoint(airTemp,relHumid)
See Also
computeDewPoint(double airTemp, double relHumid, dewPointmethodType method) for explanation of compute method
static bool carma::services::Atmosphere::isSafeAirTemperature ( double  airTemp)
static
Returns
True if the air temperaure is within reasonable bounds.
Parameters
airTempThe ambient air temperature to check, in Kelvin
See Also
safeAirTemperature(double airTemp)
static bool carma::services::Atmosphere::isSafeAirTemperature ( carma::services::Temperature  airTemp)
static
Returns
True if the air temperaure is within reasonable bounds.
Parameters
airTempThe ambient air temperature to check
See Also
safeAirTemperature(services::Temperature airTemp)
static bool carma::services::Atmosphere::isSafeAtmPressure ( double  atmPressure)
static
Returns
True if the atmospheric pressure is within reasonable bounds.
Parameters
atmPressureThe atmospheric pressure to check, in millibars
See Also
safeAirTemperature(double airTemp)
static bool carma::services::Atmosphere::isSafeAtmPressure ( carma::services::Pressure  atmPressure)
static
Returns
True if the atmospheric pressure is within reasonable bounds.
Parameters
atmPressureThe atmospheric pressure to check
See Also
safeAtmPressure(double atmPressure)
static bool carma::services::Atmosphere::isSafeDewPoint ( double  dewPoint)
static
Returns
true if dewpoint temperature is within reasonable bounds for the CARMA site.
Parameters
dewPointThe dewpoint Temperature
See Also
safeDewPoint(double dewPoint)
static bool carma::services::Atmosphere::isSafeDewPoint ( carma::services::Temperature  dewPoint)
static
Returns
true if dewpoint temperature is within reasonable bounds for the CARMA site.
Parameters
dewPointThe dewpoint Temperature
See Also
safeDewPoint(services::Temperature dewPoint)
static bool carma::services::Atmosphere::isSafeElevation ( double  elevation)
static
Returns
true if elevation is safe
Parameters
elevation,inradians
See Also
safeElevation(double elevation)
static bool carma::services::Atmosphere::isSafeElevation ( carma::services::Angle  elevation)
static
Returns
true if elevation is safe
Parameters
elevation,asAngle
See Also
safeElevation(services::Angle elevation)
static bool carma::services::Atmosphere::isSafeRelativeHumidity ( double  relHumid)
static
Returns
true if the relative humidity is within reasonable bounds for the CARMA site.
See Also
safeRelativeHumidity(double relHumid)
carma::services::Temperature carma::services::Atmosphere::lastSafeAirTemperature ( double  airTemp)

This method checks if the input air temperature is safe and if so saves and returns the value.

If the input temperature isn't safe, the last safe temperature value is returned. If there is no previous value, DEFAULT_AIR_TEMP is returned. This technique provides alternative air temperature values which more accurately reflect current weather conditions.

Parameters
airTempAir temperature in Kelvin.
carma::services::Temperature carma::services::Atmosphere::lastSafeAirTemperature ( carma::services::Temperature  airTemp)

This method checks if the input air temperature is safe and if so saves and returns the value.

If the input temperature isn't safe, the last safe temperature value is returned. If there is no previous value, DEFAULT_AIR_TEMP is returned. This technique provides alternative air temperature values which more accurately reflect current weather conditions.

Parameters
airTempAir temperature
carma::services::Temperature carma::services::Atmosphere::lastSafeAirTemperature ( ) const
Returns
the most recently stored safe air temperature
carma::services::Pressure carma::services::Atmosphere::lastSafeAtmPressure ( double  atmPressure)

This method checks if the input atmospheric pressure is safe and if so saves and returns the value.

If the input pressure isn't safe, the last safe pressure value is returned. If there is no previous value, DEFAULT_ATM_PRESSURE is returned. This technique provides alternative atmospheric pressure values which more accurately reflect current weather conditions.

Parameters
atmPressureAtmospheric pressure in mbar.
carma::services::Pressure carma::services::Atmosphere::lastSafeAtmPressure ( carma::services::Pressure  atmPressure)

This method checks if the input atmospheric pressure is safe and if so saves and returns the value.

If the input pressure isn't safe, the last safe pressure value is returned. If there is no previous value, DEFAULT_ATM_PRESSURE is returned. This technique provides alternative atmospheric pressure values which more accurately reflect current weather conditions.

Parameters
atmPressureAtmospheric pressure
carma::services::Pressure carma::services::Atmosphere::lastSafeAtmPressure ( ) const
Returns
the most recently stored safe atmospheric pressure
carma::services::Temperature carma::services::Atmosphere::lastSafeDewPoint ( double  dewPoint)

This method checks if the input dew point is safe and if so saves and returns the value.

If the input dew point isn't safe, the last safe dew point value is returned. If there is no previous value, DEFAULT_DEW_POINT is returned. This technique provides alternative dew point values which more accurately reflect current weather conditions.

Parameters
dewPointDew point in Kelvin.
carma::services::Temperature carma::services::Atmosphere::lastSafeDewPoint ( carma::services::Temperature  dewPoint)

This method checks if the input dew point is safe and if so saves and returns the value.

If the input dew point isn't safe, the last safe dew point value is returned. If there is no previous value, DEFAULT_DEW_POINT is returned. This technique provides alternative dew point values which more accurately reflect current weather conditions.

Parameters
dewPointDew point Temperature
carma::services::Temperature carma::services::Atmosphere::lastSafeDewPoint ( ) const
Returns
the most recently stored safe dew point.
double carma::services::Atmosphere::lastSafeRelativeHumidity ( double  relHumid)

This method checks if the input relative humidity is safe and if so saves and returns the value.

If the input humidity isn't safe, the last safe humidity value is returned. If there is no previous value, DEFAULT_RH is returned. This technique provides alternative humidity values which more accurately reflect current weather conditions.

Parameters
relHumidRelative humidity in percent.
double carma::services::Atmosphere::lastSafeRelativeHumidity ( ) const
Returns
the most recently stored safe relative humidity
static double carma::services::Atmosphere::safeAirTemperature ( double  airTemp)
static

This method is meant to check that a given air temperature is within reasonable bounds for the CARMA site.

It will return a sensible default air temperature if the input temperature is outside those bounds. Both methods store the last safe air temperature if it is safe.

Parameters
airTempThe ambient air temperature to check, in Kelvin
Returns
airTemp if (MIN_AIR_TEMP <= airTemp <= MAX_AIR_TEMP), otherwise return DEFAULT_AIR_TEMP
static carma::services::Temperature carma::services::Atmosphere::safeAirTemperature ( carma::services::Temperature  airTemp)
static

This method is meant to check that a given air temperature is within reasonable bounds for the CARMA site.

It will return a sensible default air temperature inside a Tempurature object if the input temperature is outside those bounds.

Parameters
airTempThe ambient air temperature to check (any units)
Returns
airTemp if its value is within the reasonable bounds otherwise return DEFAULT_AIR_TEMP in a Temperature object.
See Also
safeAirTemperature(double airTemp)
static double carma::services::Atmosphere::safeAtmPressure ( double  atmPressure)
static

This method is meant to check that a given atmospheric pressure is within reasonable bounds for the CARMA site.

It will return a sensible default atmospheric pressure if the input pressure is outside those bounds.

Parameters
atmPressureThe atmospheric pressure to check, in millibars
Returns
atmPressure if (MIN_ATM_PRESSURE <= atmPressure <= MAX_ATM_PRESSURE), otherwise return DEFAULT_ATM_PRESSURE
static carma::services::Pressure carma::services::Atmosphere::safeAtmPressure ( carma::services::Pressure  atmPressure)
static

This method is meant to check that a given atmospheric pressure is within reasonable bounds for the CARMA site.

It will return a sensible default atmospheric pressure inside a Pressure object if the input pressure is outside those bounds.

Parameters
atmPressureThe atmospheric pressure to check, in a Pressure object.
Returns
atmPressure if its value is within the reasonable bounds otherwise return DEFAULT_ATM_PRESSURE in a Pressure object.
See Also
safeAtmPressure(double atmPressure)
static double carma::services::Atmosphere::safeDewPoint ( double  dewPoint)
static

This method is meant to check that a given dew point temperature is within reasonable bounds for the CARMA site.

It will return a sensible default dew point if the input dew point is outside those bounds.

Parameters
dewPointThe dew point temperature to check, in Kelvin
Returns
dewPoint if (MIN_DEW_POINT <= dewPoint <= MAX_DEW_POINT), otherwise return DEFAULT_DEW_POINT

(NB: Actually MAX_DEW could be a variable set equal to Tambient, since Dewpoint rarely exceeds Tambient)

static carma::services::Temperature carma::services::Atmosphere::safeDewPoint ( carma::services::Temperature  dewPoint)
static

This method is meant to check that a given dew point temperature is within reasonable bounds for the CARMA site.

It will return a sensible dew point temperature inside a Tempurature object if the input temperature is outside those bounds.

Parameters
dewPointThe dew point temperature to check, in a Temperature object
Returns
dewPoint if its value is within the reasonable bounds otherwise return DEFAULT_DEW_POINT in a Temperature object.
static double carma::services::Atmosphere::safeElevation ( double  elevation)
static
Parameters
elevationThe elevation to check, in radians
Returns
elevation if (elevation >= MIN_ELEVATION ) otherwise return MIN_ELEVATION
static carma::services::Angle carma::services::Atmosphere::safeElevation ( carma::services::Angle  elevation)
static
Parameters
elevationThe elevation ANgle to check, in radians
Returns
An Angle representiing the elevation if (elevation >= MIN_ELEVATION ) otherwise return an Angle representing MIN_ELEVATION
static double carma::services::Atmosphere::safeRelativeHumidity ( double  relHumid)
static

This method is meant to check that a given relative humidity is within reasonable bounds for the CARMA site.

It will return a sensible default relative humidity if the input relative humidity is outside those bounds.

Parameters
relHumidThe relative humidity to check, in percent.
Returns
relHumid if (MIN_RH <= relHumid <= MAX_RH), otherwise return DEFAULT_RH
static carma::services::Velocity carma::services::Atmosphere::safeWindSpeed ( carma::services::Velocity  windSpeed)
static

This method is meant to check that a given wind speed is within reasonable bounds for the CARMA site.

It will return a sensible default wind speed if the input speed is outside those bounds.

Parameters
windSpeedThe wind speed to check, represented by a Velocity
Returns
windSpeed if (MIN_WIND_SPEED <= windSpeed.mph() <= MAX_WIND_SPEED), otherwise return DEFAULT_WIND_SPEED in a Velocity object
static double carma::services::Atmosphere::safeWindSpeed ( double  windSpeed)
static

This method is meant to check that a given wind speed is within reasonable bounds for the CARMA site.

It will return a sensible default wind speed if the input speed is outside those bounds.

Parameters
windSpeedThe wind speed to check, in mph
Returns
windSpeed if (MIN_WIND_SPEED <= windSpeed <= MAX_WIND_SPEED), otherwise return DEFAULT_WIND_SPEED
double carma::services::Atmosphere::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.

Parameters
atmPressureThe atmospheric pressure in millibars
airTempThe ambient air temperature in Kelvin
relHumidThe relative humidity in percent
frequencyThe observing frequency, Hz
elevationThe in vacuo (uncorrected) elevation in radians
double carma::services::Atmosphere::waterColumn ( double  airTemp,
double  relHumid 
) const

The water column is derived from the water vapor density and an assumed scaleheight for the wet atmosphere (assumed to be about 2.1km)

Parameters
airTempthe ambient air temperature in Kelvin
relHumidthe relative humidity, in percent (0..100)
Returns
water column in mm
double carma::services::Atmosphere::waterPartialPressure ( double  airTemp,
double  relHumid 
) const

Compute the partial pressure of water given the ambient air temperature and relative humidity.

The partial pressure is the saturated pressure times the relative humidity.

Parameters
airTempthe ambient air temperature in Kelvin
relHumidthe relative humidity, in percent (0..100)
Returns
partial pressure of water in millibars
See Also
#computeSaturatedPressure(double airTemp, double relHumid)
double carma::services::Atmosphere::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.

We choose the return units to be g/m^3 rather than g/cm^3 because typical values in g/m^3 will be of order unity.

Parameters
airTempthe ambient air temperature in Kelvin
relHumidthe relative humidity, in percent (0..100)
Returns
water vapor density in g/m^3

Member Data Documentation

const double carma::services::Atmosphere::DEFAULT_AIR_TEMP = 300.0
static

Default air temperature, in Kelvin For when weather station measurement unavailable.

Definition at line 85 of file Atmosphere.h.

const double carma::services::Atmosphere::DEFAULT_ATM_PRESSURE = 780.0
static

Default atmospheric pressure, in millibars For when weather station measurement unavailable.

The default is based on measurements at Cedar Flat.V

Definition at line 59 of file Atmosphere.h.

const double carma::services::Atmosphere::DEFAULT_DEW_POINT = 278.388
static

Default dew point, in Kelvin For when weather station measurement unavailable.

Definition at line 135 of file Atmosphere.h.

const double carma::services::Atmosphere::DEFAULT_RH = 25.0
static

Default relative humidity, in percent For when weather station measurement unavailable.

Definition at line 108 of file Atmosphere.h.

const double carma::services::Atmosphere::DEFAULT_WIND_SPEED = 0.0
static

Default wind speed, in mph.

Definition at line 169 of file Atmosphere.h.

const double carma::services::Atmosphere::MAX_AIR_TEMP = 316.5
static

Maximum believable air temperature, in Kelvin If weather station gives value above this, there is probably something wrong, so fall back to default.

Definition at line 101 of file Atmosphere.h.

const double carma::services::Atmosphere::MAX_ATM_PRESSURE = 1115.0
static

Maximum believable atmospheric pressure, in millibars If weather station gives value above this, there is probably something wrong, so fall back to default.

Definition at line 78 of file Atmosphere.h.

const double carma::services::Atmosphere::MAX_DEW_POINT
static

Maximum believable dew point, in Kelvin If weather station gives value above this, there is probably something wrong, so fall back to default.

Ideally, this should be non-const and set to the current Ambient temperature, since Tdp is "never" greater than Tambient. Maybe I need a private maxdewpoint() method.

Definition at line 156 of file Atmosphere.h.

const double carma::services::Atmosphere::MAX_RH = 100.0
static

Maximum believable relative humidity, in percent If weather station gives value above this, there is probably something wrong, so fall back to default.

Definition at line 123 of file Atmosphere.h.

const double carma::services::Atmosphere::MAX_WIND_SPEED = 200.0
static

Maximum reasonable wind speed, in mph If weather station gives value above this, there is probably something wrong, so fall back to default.

Definition at line 183 of file Atmosphere.h.

const double carma::services::Atmosphere::MIN_AIR_TEMP = 242.0
static

Minimum believable air temperature, in Kelvin If weather station gives value below this, there is probably something wrong, so fall back to default.

Definition at line 93 of file Atmosphere.h.

const double carma::services::Atmosphere::MIN_ATM_PRESSURE = 680
static

Minimum believable atmospheric pressure, in millibars.

If weather station gives value below this, there is probably something wrong, so fall back to default.

Definition at line 71 of file Atmosphere.h.

const double carma::services::Atmosphere::MIN_DEW_POINT = 221.9
static

Minimum believable dew point, in Kelvin If weather station gives value below this, there is probably something wrong, so fall back to default.

Definition at line 143 of file Atmosphere.h.

const double carma::services::Atmosphere::MIN_ELEVATION = 0.0174533
static

The minimum elevation at which pathlength will be directly calculated, in radians.

Below this elevation, computeHorizonPathLength() is used. Currently set to 1 degree.

Definition at line 164 of file Atmosphere.h.

const double carma::services::Atmosphere::MIN_RH = 5.0
static

Minimum believable relative humidity, in percent If weather station gives value below this, there is probably something wrong, so fall back to default.

Definition at line 116 of file Atmosphere.h.

const double carma::services::Atmosphere::MIN_WIND_SPEED = 0.0
static

Minimum wind speed, in mph If weather station gives value below this, there is probably something wrong, so fall back to default.

Definition at line 176 of file Atmosphere.h.

const double carma::services::Atmosphere::STANDARD_ATM_PRESSURE = 1013.25
static

US standard 1 atm of pressure.

Definition at line 64 of file Atmosphere.h.


The documentation for this class was generated from the following file: