WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
WXP::Calc Class Reference

This class contains functions for doing simple meteorological computations. More...

#include "../include/Calc.h"

Static Public Member Functions

static float windSpd (float u, float v)
 
static float windDir (float u, float v)
 
static float windU (float dir, float spd)
 
static float windV (float dir, float spd)
 
static float vaporPres (float t)
 
static float windChillTemp (float temp, float ws)
 
static float windChillTemp2 (float temp, float ws)
 
static float windChill (float temp, float ws)
 
static float heatIndex (float temp, float dewp)
 
static float humiture (float temp, float dewp)
 
static float tempHumIndex (float temp, float dewp)
 
static float sfcPrAlt (float alt, float el)
 
static float presAlt (float pres)
 
static float mixRatio (float temp, float pr)
 
static float specHum (float temp, float pr)
 
static float dewTemp (float temp, float rh)
 
static float potTemp (float temp, float pr)
 
static float virtTemp (float temp, float dewp, float pr)
 
static float virtPotTemp (float temp, float dewp, float pr)
 
static float tempOnSatAd (float pot, float pr)
 
static float tempOnDryAd (float pot, float pr)
 
static float thetaeOnSatAd (float temp, float pr)
 
static float tempVaporPres (float e)
 
static float tempOnMixRat (float w, float pr)
 
static float relHum (float t, float td)
 
static float convTemp (float wbar, float pc, float pr)
 
static float lclPres (float ts, float tds, float ps)
 
static float lclTemp (float ts, float ps, float plcl)
 
static int lcl (float ts, float tds, float ps, LclData &ldat)
 
static LclData lcl (float ts, float tds, float ps)
 
static float equivPotTemp (float temp, float dewp, float pr)
 
static float wetBulb (float temp, float dewp, float pr)
 
static float wetBulbPotTemp (float temp, float dewp, float pr)
 
static float stdAtmsPres (float height)
 
static float interpLinear (float x, float x1, float x2, float y1, float y2)
 
static float interpTemp (float t1, float t2, float p1, float p2, float pr)
 
static float earthDist (float lat1, float lon1, float lat2, float lon2)
 
static float earthAngle (float lat1, float lon1, float lat2, float lon2)
 
static float dist (float x1, float y1, float x2, float y2)
 
static float Min (float x, float y)
 
static float Max (float x, float y)
 
static float ADD (float x, float y)
 
static float DIF (float x, float y)
 
static float MUL (float x, float y)
 
static float DIV (float x, float y)
 

Detailed Description

This class contains functions for doing simple meteorological computations.

Author
Dan Vietor

Member Function Documentation

◆ ADD()

static float WXP::Calc::ADD ( float  x,
float  y 
)
inlinestatic

Add two values and check for missing

References WXP::Const::MISS.

Referenced by WXP::MosUFile::decodeETA().

◆ convTemp()

float Calc::convTemp ( float  wbar,
float  pc,
float  pr 
)
static

Convective temperature in Kelvin

Parameters
wbarMean mixing ratio in gm/kg from prCcl
pcPressure in mb at the CCL from prCcl
prSurface pressure in millibars

References potTemp(), tempOnDryAd(), and tempOnMixRat().

◆ dewTemp()

float Calc::dewTemp ( float  temp,
float  rh 
)
static

Dewpoint temperature in Kelvin

Parameters
tempTemperature in Kelvin
rhRelative humidity in %

References WXP::Const::MISS, tempVaporPres(), and vaporPres().

Referenced by WXP::SynopTool::decode(), and WXP::RadMask::getSiteFilter().

◆ DIF()

static float WXP::Calc::DIF ( float  x,
float  y 
)
inlinestatic

Difference two values and check for missing

References WXP::Const::MISS.

Referenced by WXP::MosDataTool::compute(), and WXP::SfcDataTool::compute().

◆ dist()

float Calc::dist ( float  x1,
float  y1,
float  x2,
float  y2 
)
static

Compute the distance between two points in plot units

Parameters
x1X coordinate of first point
y1Y coordinate of first point
x2X coordinate of second point
y2Y coordinate of second point
Returns
Distance

References WXP::Const::MISS.

Referenced by WXP::RcmDecode::decode(), and WXP::RcmDecode::filterOverlap().

◆ DIV()

static float WXP::Calc::DIV ( float  x,
float  y 
)
inlinestatic

Divide two values and check for missing

References WXP::Const::MISS.

Referenced by WXP::SfcDataTool::compute().

◆ earthAngle()

float Calc::earthAngle ( float  lat1,
float  lon1,
float  lat2,
float  lon2 
)
static

Compute the spherical angle between two points in degrees

Parameters
lat1Latitude of first point
lon1Longitude of first point
lat2Latitude of second point
lon2Longitude of second point
Returns
Angle between points

References WXP::Const::DRC, WXP::Const::MISS, and WXP::Const::RDC.

Referenced by WXP::ImageMath::blank(), and earthDist().

◆ earthDist()

float Calc::earthDist ( float  lat1,
float  lon1,
float  lat2,
float  lon2 
)
static

Compute the spherical distance between two points in meters

Parameters
lat1Latitude of first point
lon1Longitude of first point
lat2Latitude of second point
lon2Longitude of second point
Returns
Distance in meters

References WXP::Const::DRC, WXP::Const::EARTH, and earthAngle().

Referenced by WXP::Domain::calcEarthDist(), and WXP::CityTool::compareData().

◆ equivPotTemp()

float Calc::equivPotTemp ( float  temp,
float  dewp,
float  pr 
)
static

Equivalent potential temperature in Kelvin

Parameters
tempTemperature in Kelvin
dewpDewpoint in Kelvin
prPressure in millibars

References lclPres(), lclTemp(), WXP::Const::MISS, potTemp(), and thetaeOnSatAd().

Referenced by WXP::UpaCalc::calc(), and WXP::SfcDataTool::compute().

◆ heatIndex()

float Calc::heatIndex ( float  temp,
float  dewp 
)
static

Heat index in Kelvin Source: NWS Southern Region SSD Technical Attachment 8/12/86. Heat Index was originally known as the apparent temperature index. JAM - July, 1979.

Parameters
tempTemperature in Kelvin
dewpDewpoint in Kelvin

References WXP::Convert::FtoK(), WXP::Convert::KtoF(), WXP::Const::MISS, and vaporPres().

Referenced by WXP::MosDataTool::compute(), and WXP::SfcDataTool::compute().

◆ humiture()

float Calc::humiture ( float  temp,
float  dewp 
)
static

Humiture in Fahrenheit

Parameters
tempTemperature in Kelvin
dewpDewpoint in Kelvin

References WXP::Convert::KtoF(), WXP::Const::MISS, and vaporPres().

Referenced by WXP::MosDataTool::compute(), and WXP::SfcDataTool::compute().

◆ interpLinear()

float Calc::interpLinear ( float  x,
float  x1,
float  x2,
float  y1,
float  y2 
)
static

Interpolates between two values

Parameters
xX value to interpolate to
x1First X
x2Second X
y1First Y
y2Second Y
Returns
Y value corresponding to X

◆ interpTemp()

float Calc::interpTemp ( float  t1,
float  t2,
float  p1,
float  p2,
float  pr 
)
static

Temperature interpolated between two pressure levels in Kelvin

Parameters
t1Temperature in K at bottom of the layer
t2Temperature in K at top of the layer
p1Pressure in mb at bottom of the layer
p2Pressure in mb at top of the layer
prPressure in mb at level of interest
Returns
interpolated temperature

References WXP::Const::MISS.

◆ lcl() [1/2]

LclData Calc::lcl ( float  ts,
float  tds,
float  ps 
)
static

Compute LCL parameters

Parameters
tsTemperature in K at the surface
tdsDewpoint temperature in K at the surface
psPressure in mb at the surface
Returns
LCL parameters (p in mb,t in K)

References lcl().

◆ lcl() [2/2]

int Calc::lcl ( float  ts,
float  tds,
float  ps,
LclData ldat 
)
static

Compute LCL parameters

Parameters
tsTemperature in K at the surface
tdsDewpoint temperature in K at the surface
psPressure in mb at the surface
Return values
ldatLCL parameters (p in mb,t in K)

References WXP::Const::MISS, mixRatio(), WXP::LclData::p, potTemp(), WXP::LclData::t, tempOnDryAd(), and tempOnMixRat().

Referenced by WXP::ParcelParams::calc(), lcl(), and lclPres().

◆ lclPres()

float Calc::lclPres ( float  ts,
float  tds,
float  ps 
)
static

Pressure at the LCL in millibars

Parameters
tsTemperature in K at the surface
tdsDewpoint temperature in K at the surface
psPressure in mb at the surface

References lcl(), and WXP::LclData::p.

Referenced by WXP::SfcDataTool::compute(), equivPotTemp(), wetBulb(), and wetBulbPotTemp().

◆ lclTemp()

float Calc::lclTemp ( float  ts,
float  ps,
float  plcl 
)
static

Temperature at the LCL in K

Parameters
tsTemperature in K at the surface
psPressure in mb at the surface
plclPressure at the LCL (from lclPres)

References potTemp(), and tempOnDryAd().

Referenced by equivPotTemp(), wetBulb(), and wetBulbPotTemp().

◆ Max()

static float WXP::Calc::Max ( float  x,
float  y 
)
inlinestatic

Maximum value of two values

◆ Min()

static float WXP::Calc::Min ( float  x,
float  y 
)
inlinestatic

Minimum value of two values

◆ mixRatio()

float Calc::mixRatio ( float  temp,
float  pr 
)
static

Mixing ratio in gm/kg

Parameters
tempTemperature in K or vapor pressure in mb
prPressure in millibars

References WXP::Const::MISS, and vaporPres().

Referenced by WXP::UpaCalc::calc(), WXP::SfcDataTool::compute(), lcl(), tempOnSatAd(), thetaeOnSatAd(), and virtTemp().

◆ MUL()

static float WXP::Calc::MUL ( float  x,
float  y 
)
inlinestatic

Multiply two values and check for missing

References WXP::Const::MISS.

Referenced by WXP::MosUFile::decodeETA().

◆ potTemp()

float Calc::potTemp ( float  temp,
float  pr 
)
static

Potential temperature in Kelvin

Parameters
tempTemperature in Kelvin
prPressure in millibars

References WXP::Const::MISS.

Referenced by WXP::ParcelParams::calc(), WXP::UpaCalc::calc(), WXP::SfcDataTool::compute(), convTemp(), equivPotTemp(), lcl(), lclTemp(), tempOnSatAd(), WXP::Domain::tran(), WXP::Domain::tran(), and virtPotTemp().

◆ presAlt()

float Calc::presAlt ( float  pres)
static

Pressure altitude in m given pressure in millibars

Parameters
presPressure in millibars

◆ relHum()

float Calc::relHum ( float  t,
float  td 
)
static

Relative humidity in percent

Parameters
tTemperature in Kelvin or Celsius
tdDewpoint in Kelvin or Celsius

References WXP::Convert::CtoK(), WXP::Const::MISS, and vaporPres().

Referenced by WXP::UpaCalc::calc(), WXP::MosDataTool::compute(), WXP::SfcDataTool::compute(), and WXP::SfcData::outString().

◆ sfcPrAlt()

float Calc::sfcPrAlt ( float  alt,
float  el 
)
static

Surface pressure in mb given altimeter setting

Parameters
altAltimeter setting in millibars
elElevation in meters

References WXP::Const::MISS.

Referenced by WXP::SfcDataTool::compute().

◆ specHum()

float Calc::specHum ( float  temp,
float  pr 
)
static

Specific humidity in gm/kg

Parameters
tempTemperature in K or vapor pressure in mb
prPressure in millibars

References WXP::Const::MISS, and vaporPres().

Referenced by WXP::UpaCalc::calc(), and WXP::SfcDataTool::compute().

◆ tempHumIndex()

float Calc::tempHumIndex ( float  temp,
float  dewp 
)
static

Temperature humidity index in Fahrenheit

Parameters
tempTemperature in Fahrenheit
dewpDewpoint in Fahrenheit

References WXP::Const::MISS.

◆ tempOnDryAd()

float Calc::tempOnDryAd ( float  pot,
float  pr 
)
static

Temperature on a dry adiabat in Kelvin

Parameters
potPotential temperature in Kelvin
prPressure in millibars

Referenced by WXP::ParcelParams::calc(), convTemp(), WXP::ThermPlot::draw(), lcl(), lclTemp(), and WXP::ParcelParams::set().

◆ tempOnMixRat()

float Calc::tempOnMixRat ( float  w,
float  pr 
)
static

Temperature on a mixing ratio line

Parameters
wMixing ratio in gm/kg
prPressure in millibars

Referenced by convTemp(), WXP::ThermPlot::draw(), lcl(), and WXP::ParcelParams::set().

◆ tempOnSatAd()

float Calc::tempOnSatAd ( float  pot,
float  pr 
)
static

Temperature on a saturation adiabat in Kelvin

Parameters
potEquivalent potential temperature in K
prPressure in mb

References WXP::Const::MISS, mixRatio(), and potTemp().

Referenced by WXP::ParcelParams::calc(), WXP::ThermPlot::draw(), wetBulb(), and wetBulbPotTemp().

◆ tempVaporPres()

float Calc::tempVaporPres ( float  e)
static

Temperature in Kelvin given a specific vapor pressure

Parameters
eVapor pressure in millibars

Referenced by dewTemp().

◆ thetaeOnSatAd()

float Calc::thetaeOnSatAd ( float  temp,
float  pr 
)
static

Equivalent potential temperature on a saturation adiabat in Kelvin

Parameters
tempTemperature in Kelvin
prPressure in millibars

References mixRatio().

Referenced by WXP::ParcelParams::calc(), WXP::ThermPlot::draw(), equivPotTemp(), wetBulb(), and wetBulbPotTemp().

◆ vaporPres()

float Calc::vaporPres ( float  t)
static

Saturation vapor pressure in millibars

Parameters
tTemperature in Kelvin

References WXP::Const::MISS.

Referenced by WXP::UpaCalc::calc(), WXP::MosDataTool::compute(), WXP::SfcDataTool::compute(), dewTemp(), heatIndex(), humiture(), mixRatio(), relHum(), and specHum().

◆ virtPotTemp()

float Calc::virtPotTemp ( float  temp,
float  dewp,
float  pr 
)
static

Virtual potential temperature in Kelvin

Parameters
tempTemperature in Kelvin
dewpDewpoint in Kelvin
prPressure in millibars

References WXP::Const::MISS, potTemp(), and virtTemp().

Referenced by WXP::UpaCalc::calc(), and WXP::SfcDataTool::compute().

◆ virtTemp()

float Calc::virtTemp ( float  temp,
float  dewp,
float  pr 
)
static

Virtual temperature in Kelvin

Parameters
tempTemperature in Kelvin
dewpDewpoint in Kelvin or mixing ratio in gm/kg
prPressure in millibars

References WXP::Const::MISS, and mixRatio().

Referenced by WXP::UpaCalc::calc(), WXP::SfcDataTool::compute(), and virtPotTemp().

◆ wetBulb()

float Calc::wetBulb ( float  temp,
float  dewp,
float  pr 
)
static

Wet bulb temperature in Kelvin

Parameters
tempTemperature in Kelvin
dewpDewpoint in Kelvin
prPressure in millibars

References lclPres(), lclTemp(), WXP::Const::MISS, tempOnSatAd(), and thetaeOnSatAd().

Referenced by WXP::SfcDataTool::compute().

◆ wetBulbPotTemp()

float Calc::wetBulbPotTemp ( float  temp,
float  dewp,
float  pr 
)
static

Wet bulb potential temperature in Kelvin

Parameters
tempTemperature in Kelvin
dewpDewpoint in Kelvin
prPressure in millibars

References lclPres(), lclTemp(), WXP::Const::MISS, tempOnSatAd(), and thetaeOnSatAd().

Referenced by WXP::SfcDataTool::compute().

◆ windChill()

float Calc::windChill ( float  temp,
float  ws 
)
static

Wind chill in Watts per square meter

Parameters
tempTemperature in Kelvin
wsWind speed in meters per second

References WXP::Const::MISS.

Referenced by WXP::MosDataTool::compute(), and WXP::SfcDataTool::compute().

◆ windChillTemp()

float Calc::windChillTemp ( float  temp,
float  ws 
)
static

Wind chill in Kelvin

Parameters
tempTemperature in Kelvin
wsWind speed in meters per second

References WXP::Const::MISS.

Referenced by WXP::MosDataTool::compute(), and WXP::SfcDataTool::compute().

◆ windChillTemp2()

float Calc::windChillTemp2 ( float  temp,
float  ws 
)
static

Wind chill (new version) in Kelvin

Parameters
tempTemperature in Kelvin
wsWind speed in meters per second

References WXP::Const::MISS.

Referenced by WXP::MosDataTool::compute(), and WXP::SfcDataTool::compute().

◆ windDir()

float Calc::windDir ( float  u,
float  v 
)
static

Wind direction computed from U,V components

Parameters
uU wind component
vV wind component

References WXP::Const::MISS, and WXP::Const::RDC.

Referenced by WXP::GridMath::adjustUV(), and WXP::Wind::setVect().

◆ windSpd()

float Calc::windSpd ( float  u,
float  v 
)
static

Wind speed computed from U,V components

Parameters
uU wind component
vV wind component

References WXP::Const::MISS.

Referenced by WXP::GridMath::adjustUV(), and WXP::Wind::setVect().

◆ windU()

float Calc::windU ( float  dir,
float  spd 
)
static

U wind component computed from direction and speed

Parameters
dirWind direction
spdWind speed

References WXP::Const::DRC, and WXP::Const::MISS.

Referenced by WXP::GridMath::adjustUV(), WXP::WindPlot::drawVect(), WXP::Wind::toVect(), and WXP::Wind::toVect().

◆ windV()

float Calc::windV ( float  dir,
float  spd 
)
static

V wind component computed from direction and speed

Parameters
dirWind direction
spdWind speed

References WXP::Const::DRC, and WXP::Const::MISS.

Referenced by WXP::GridMath::adjustUV(), WXP::WindPlot::drawVect(), WXP::Wind::toVect(), and WXP::Wind::toVect().


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