UFO
ufo::formulas Namespace Reference

Enumerations

enum  MethodFormulation {
  UKMO , NCAR , NOAA , DEFAULT ,
  Murphy , Sonntag , LandoltBornstein , Walko ,
  Rogers
}
 Various Methods and Formulations available. More...
 

Functions

MethodFormulation resolveMethods (const std::string &input)
 
MethodFormulation resolveFormulations (const std::string &input, const std::string &method)
 
float SatVaporPres_fromTemp (const float temp_K, const MethodFormulation formulation=formulas::MethodFormulation::DEFAULT)
 Calculates saturated vapour pressure from temperature. More...
 
float SatVaporPres_correction (float e_sub_s, float temp_K, float pressure, const MethodFormulation formulation=formulas::MethodFormulation::DEFAULT)
 Calculates saturated vapour pressure from temperature. More...
 
float Qsat_From_Psat (float Psat, float P, MethodFormulation formulation=formulas::MethodFormulation::DEFAULT)
 Calculates Saturated specific humidity or saturated vapour pressure using saturation vapour pressure. More...
 
float VirtualTemp_From_Psat_P_T (float Psat, float P, float T, MethodFormulation formulation=formulas::MethodFormulation::DEFAULT)
 Derive Virtual Temperature from saturation vapour pressure, pressure and temperature. More...
 
float VirtualTemp_From_Rh_Psat_P_T (float Rh, float Psat, float P, float T, MethodFormulation formulation=formulas::MethodFormulation::DEFAULT)
 Derive Virtual Tempreture using Relative humidity, sat. More...
 
float Height_To_Pressure_ICAO_atmos (float Height, MethodFormulation formulation=formulas::MethodFormulation::DEFAULT)
 Converts height to pressure using the International Civil Aviation Organization (ICAO) atmosphere. More...
 
float Pressure_To_Height (float pressure, MethodFormulation formulation=formulas::MethodFormulation::DEFAULT)
 Converts pressure to height. More...
 
float GetWindDirection (float u, float v)
 Converts u and v wind component into wind direction. More...
 
float GetWindSpeed (float u, float v)
 Converts u and v wind component into wind speed. More...
 
float GetWind_U (float windSpeed, float windFromDirection)
 Get eastward (u) wind component from wind speed and direction. More...
 
float GetWind_V (float windSpeed, float windFromDirection)
 Get northward (v) wind component from wind speed and direction. More...
 
int RenumberScanPosition (int scanpos)
 Get renumbered scan position 1,2,3,... More...
 
void horizontalDrift (const std::vector< size_t > &locs, const std::vector< bool > &apply, const std::vector< float > &lat_in, const std::vector< float > &lon_in, const std::vector< util::DateTime > &time_in, const std::vector< float > &height, const std::vector< float > &windspd, const std::vector< float > &winddir, std::vector< float > &lat_out, std::vector< float > &lon_out, std::vector< util::DateTime > &time_out, MethodFormulation formulation=formulas::MethodFormulation::DEFAULT)
 Compute horizontal drift latitude, longitude and time for an atmospheric profile. More...
 

Enumeration Type Documentation

◆ MethodFormulation

Various Methods and Formulations available.

Enumerator
UKMO 

UKMO specific formulation.

NCAR 

NCAR specific formulation.

NOAA 

NOAA specific formulation.

DEFAULT 

DEFAULT formulation.

Murphy 
Sonntag 
LandoltBornstein 
Walko 
Rogers 

Definition at line 26 of file Formulas.h.

Function Documentation

◆ GetWind_U()

float ufo::formulas::GetWind_U ( float  windSpeed,
float  windFromDirection 
)

Get eastward (u) wind component from wind speed and direction.

Parameters
windSpeedwind speed [m/s]
windFromDirectionwind direction [degree]
Returns
u

Definition at line 347 of file Formulas.cc.

Here is the caller graph for this function:

◆ GetWind_V()

float ufo::formulas::GetWind_V ( float  windSpeed,
float  windFromDirection 
)

Get northward (v) wind component from wind speed and direction.

Parameters
windSpeedwind speed [m/s]
windFromDirectionwind direction [degree]
Returns
v

Definition at line 359 of file Formulas.cc.

Here is the caller graph for this function:

◆ GetWindDirection()

float ufo::formulas::GetWindDirection ( float  u,
float  v 
)

Converts u and v wind component into wind direction.

Wind direction is defined such that a northerly wind is 0°, an easterly wind is 90°, a southerly wind is 180°, and a westerly wind is 270°.

Parameters
ueastward (u) wind component[m/s]
vnorthward (v) wind component[m/s]
Returns
windDirection

Definition at line 323 of file Formulas.cc.

Here is the caller graph for this function:

◆ GetWindSpeed()

float ufo::formulas::GetWindSpeed ( float  u,
float  v 
)

Converts u and v wind component into wind speed.

Parameters
ueastward (u) wind component[m/s]
vnorthward (v) wind component[m/s]
Returns
windSpeed

Definition at line 337 of file Formulas.cc.

Here is the caller graph for this function:

◆ Height_To_Pressure_ICAO_atmos()

float ufo::formulas::Height_To_Pressure_ICAO_atmos ( float  Height,
MethodFormulation  formulation = formulas::MethodFormulation::DEFAULT 
)

Converts height to pressure using the International Civil Aviation Organization (ICAO) atmosphere.

Formulation available:

  • NCAR: as default
  • NOAA: as default
  • UKMO: as default
  • DEFAULT: using ICAO standard
Parameters
heightobservation height in geopotential metres [gpm]
Returns
pressure

Definition at line 224 of file Formulas.cc.

Here is the caller graph for this function:

◆ horizontalDrift()

void ufo::formulas::horizontalDrift ( const std::vector< size_t > &  locs,
const std::vector< bool > &  apply,
const std::vector< float > &  lat_in,
const std::vector< float > &  lon_in,
const std::vector< util::DateTime > &  time_in,
const std::vector< float > &  height,
const std::vector< float > &  windspd,
const std::vector< float > &  winddir,
std::vector< float > &  lat_out,
std::vector< float > &  lon_out,
std::vector< util::DateTime > &  time_out,
MethodFormulation  formulation = formulas::MethodFormulation::DEFAULT 
)

Compute horizontal drift latitude, longitude and time for an atmospheric profile.

This formula accepts input and output vectors that correspond to the entire data sample as well as a vector of the locations of the current profile in the entire sample. The latter vector is used to select the relevant observations from the entire sample prior to running the horizontal drift algorithm. The outputs of the algorithm are placed in the relevant locations in the entire sample.

Formulations available:

  • DEFAULT: Calculation is using Eq. 4. of Laroche and Sarrazin (2013). Reference: "Laroche, S. and Sarrazin, R., Impact of Radiosonde Balloon Drift on Numerical Weather Prediction and Verification, Weather and Forecasting, 28(3), 772-782, 2013."
  • UKMO: as default
  • NCAR: as default
  • NOAA: as default
Parameters
locsVector of locations of the current profile in the entire data sample.
applyVector specifying whether a location should be used or not (governed by the where clause).
lat_inVector of input latitudes in the entire sample [degrees].
lon_inVector of input longitudes in the entire sample [degrees].
time_inVector of input datetimes in the entire sample [ISO 8601 format].
heightVector of input heights in the entire sample [m].
windspdVector of input wind speeds in the entire sample [m/s].
winddirVector of input wind directions in the entire sample [degrees]. Wind direction is defined such that a northerly wind is 0°, an easterly wind is 90°, a southerly wind is 180°, and a westerly wind is 270°.
[out]lat_outVector of output latitudes in the entire sample [degrees].
[out]lon_outVector of output longitudes in the entire sample [degress].
[out]time_outVector of output datetimes in the entire sample [ISO 8601 format].
formulationMethod used to determine the horizontal drift positions.

Definition at line 380 of file Formulas.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pressure_To_Height()

float ufo::formulas::Pressure_To_Height ( float  pressure,
MethodFormulation  formulation = formulas::MethodFormulation::DEFAULT 
)

Converts pressure to height.

Formulation available:

  • NCAR: uses a fast approximation for pressures > 120 hPa and the ICAO atmosphere otherwise.
  • NOAA: as default
  • UKMO: as default
  • DEFAULT: uses the ICAO atmosphere for all pressures.
Parameters
pressureobservation pressure in Pa
Returns
height in geopotential metres

Definition at line 271 of file Formulas.cc.

Here is the caller graph for this function:

◆ Qsat_From_Psat()

float ufo::formulas::Qsat_From_Psat ( float  Psat,
float  P,
MethodFormulation  formulation = formulas::MethodFormulation::DEFAULT 
)

Calculates Saturated specific humidity or saturated vapour pressure using saturation vapour pressure.

Formulation available:

  • NCAR: as default
  • NOAA: as default
  • UKMO: as default
  • DEFAULT: Calculation is using the Sonntag (1994) formula. (With fix at low pressure)
Parameters
Psatsaturation vapour pressure of pure water vapour
PPressure
Returns
Saturated specific humidity or saturated vapour pressure

Definition at line 163 of file Formulas.cc.

Here is the caller graph for this function:

◆ RenumberScanPosition()

int ufo::formulas::RenumberScanPosition ( int  scanpos)

Get renumbered scan position 1,2,3,...

for satellite instrument which has been spatially resampled and for which scan position is 2,5,8,...

Parameters
scanpossatellite instrument scan position
Returns
newpos

Definition at line 372 of file Formulas.cc.

Here is the caller graph for this function:

◆ resolveFormulations()

MethodFormulation ufo::formulas::resolveFormulations ( const std::string &  input,
const std::string &  method 
)

Definition at line 30 of file Formulas.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resolveMethods()

MethodFormulation ufo::formulas::resolveMethods ( const std::string &  input)

Definition at line 22 of file Formulas.cc.

Here is the caller graph for this function:

◆ SatVaporPres_correction()

float ufo::formulas::SatVaporPres_correction ( float  e_sub_s,
float  temp_K,
float  pressure,
const MethodFormulation  formulation = formulas::MethodFormulation::DEFAULT 
)

Calculates saturated vapour pressure from temperature.

Formulation available:

  • NCAR: as Sonntag 1997
  • NOAA: as Sonntag 1997
  • UKMO: as Sonntag 1997
  • Sonntag: Correct the the saturation vapour pressure of pure water vapour using an enhancement factor needed for moist air. Reference: eg eqns 20, 22 of Sonntag, but for consistency with QSAT the formula below is from eqn A4.6 of Adrian Gill's book.
Parameters
e_sub_ssaturation vapour pressure
temp_Ktemperature [k]
pressureair pressure [Pa]
Returns
saturated vapour pressure

Definition at line 132 of file Formulas.cc.

Here is the caller graph for this function:

◆ SatVaporPres_fromTemp()

float ufo::formulas::SatVaporPres_fromTemp ( const float  temp_K,
const MethodFormulation  formulation = formulas::MethodFormulation::DEFAULT 
)

Calculates saturated vapour pressure from temperature.

Formulation available:

  • UKMO: as Sonntag 1997
  • Sonntag: Calculation is using the Eqn 7 Sonntag (1997) Reference: "Sonntag, D., Advancements in the field of hygrometry, Meteorol. Zeitschrift, N. F., 3, 51-66, 1994." .
  • Walko: Polynomial fit of Goff-Gratch (1946) formulation. (Walko, 1991)
  • Murphy: Alternative method to Walko 1991 (costs more CPU, more accurate) Reference: "Murphy and Koop, Review of the vapour pressure of ice and supercooled water for atmospheric applications, Q. J. R. Meteorol. Soc (2005), 131, pp. 1539-1565."
  • NCAR: as default
  • NOAA: as default
  • DEFAULT: Classical formula from Rogers and Yau (1989; Eq2.17)
Parameters
temp_KTemperature [k]
Returns
saturated vapour pressure

Definition at line 45 of file Formulas.cc.

Here is the caller graph for this function:

◆ VirtualTemp_From_Psat_P_T()

float ufo::formulas::VirtualTemp_From_Psat_P_T ( float  Psat,
float  P,
float  T,
MethodFormulation  formulation = formulas::MethodFormulation::DEFAULT 
)

Derive Virtual Temperature from saturation vapour pressure, pressure and temperature.

Formulation available:

  • NCAR: as default
  • NOAA: as default
  • UKMO: as default
  • DEFAULT: \( Tv = T * ((P + Psat / \epsilon) / (P + Psat)) \)
Parameters
Psatsaturation vapour pressure of pure water vapour
TTemperature
PPressure
Returns
Virtual Temperature

Definition at line 187 of file Formulas.cc.

Here is the caller graph for this function:

◆ VirtualTemp_From_Rh_Psat_P_T()

float ufo::formulas::VirtualTemp_From_Rh_Psat_P_T ( float  Rh,
float  Psat,
float  P,
float  T,
MethodFormulation  formulation = formulas::MethodFormulation::DEFAULT 
)

Derive Virtual Tempreture using Relative humidity, sat.

vapour pressure, pressure and temperature

Formulation available:

  • NCAR: as default
  • NOAA: as default
  • UKMO: as default
  • DEFAULT: \( \alpha = Psat * Rh * 0.01 \)
Parameters
RhRelative humidity
Psatsaturation vapour pressure of pure water vapour
TTemperature
PPressure
Returns
Virtual Temperature

Definition at line 204 of file Formulas.cc.

Here is the call graph for this function:
Here is the caller graph for this function: