WXP::Calc Class Reference
[Compute objects]

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

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

List of all members.

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 eqPotTemp (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 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

static float WXP::Calc::ADD ( float  x,
float  y 
) [inline, static]

Add two values and check for missing

References WXP::Const::MISS.

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

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

Convective temperature in Kelvin

Parameters:
wbar Mean mixing ratio in gm/kg from prCcl
pc Pressure in mb at the CCL from prCcl
pr Surface pressure in millibars

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

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

Dewpoint temperature in Kelvin

Parameters:
temp Temperature in Kelvin
rh Relative humidity in %

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

Referenced by WXP::SynopTool::decode().

static float WXP::Calc::DIF ( float  x,
float  y 
) [inline, static]

Difference two values and check for missing

References WXP::Const::MISS.

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

static float WXP::Calc::DIV ( float  x,
float  y 
) [inline, static]

Divide two values and check for missing

References WXP::Const::MISS.

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

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

Compute the spherical angle between two points in degrees

Parameters:
lat1 Latitude of first point
lon1 Longitude of first point
lat2 Latitude of second point
lon2 Longitude of second point

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

Referenced by earthDist().

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

Compute the spherical distance between two points in meters

Parameters:
lat1 Latitude of first point
lon1 Longitude of first point
lat2 Latitude of second point
lon2 Longitude of second point

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

Referenced by WXP::Domain::calcEarthDist().

float Calc::eqPotTemp ( float  temp,
float  dewp,
float  pr 
) [static]

Equivalent potential temperature in Kelvin

Parameters:
temp Temperature in Kelvin
dewp Dewpoint in Kelvin
pr Pressure in millibars

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

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

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:
temp Temperature in Kelvin
dewp Dewpoint in Kelvin

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

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

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

Humiture in Fahrenheit

Parameters:
temp Temperature in Kelvin
dewp Dewpoint in Kelvin

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

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

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

Interpolates between two values

Parameters:
x X value to interpolate to
x1 First X
x2 Second X
y1 First Y
y2 Second Y
Returns:
Y value corresponding to X
float Calc::interpTemp ( float  t1,
float  t2,
float  p1,
float  p2,
float  pr 
) [static]

Temperature interpolated between two pressure levels in Kelvin

Parameters:
t1 Temperature in K at bottom of the layer
t2 Temperature in K at top of the layer
p1 Pressure in mb at bottom of the layer
p2 Pressure in mb at top of the layer
pr Pressure in mb at level of interest

References WXP::Const::MISS.

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

Compute LCL parameters

Parameters:
ts Temperature in K at the surface
tds Dewpoint temperature in K at the surface
ps Pressure in mb at the surface
Returns:
LCL parameters (p in mb,t in K)

References lcl().

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

Compute LCL parameters

Parameters:
ts Temperature in K at the surface
tds Dewpoint temperature in K at the surface
ps Pressure in mb at the surface
Return values:
ldat LCL parameters (p in mb,t in K)

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

Referenced by lcl(), and lclPres().

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

Pressure at the LCL in millibars

Parameters:
ts Temperature in K at the surface
tds Dewpoint temperature in K at the surface
ps Pressure in mb at the surface

References lcl().

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

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

Temperature at the LCL in K

Parameters:
ts Temperature in K at the surface
ps Pressure in mb at the surface
plcl Pressure at the LCL (from lclPres)

References potTemp(), and tempOnDryAd().

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

static float WXP::Calc::Max ( float  x,
float  y 
) [inline, static]

Maximum value of two values

static float WXP::Calc::Min ( float  x,
float  y 
) [inline, static]

Minimum value of two values

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

Mixing ratio in gm/kg

Parameters:
temp Temperature in K or vapor pressure in mb
pr Pressure in millibars

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

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

static float WXP::Calc::MUL ( float  x,
float  y 
) [inline, static]

Multiply two values and check for missing

References WXP::Const::MISS.

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

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

Potential temperature in Kelvin

Parameters:
temp Temperature in Kelvin
pr Pressure in millibars

References WXP::Const::MISS.

Referenced by WXP::SfcDataTool::compute(), convTemp(), eqPotTemp(), lcl(), lclTemp(), WXP::Domain::pan(), tempOnSatAd(), WXP::Domain::tran(), virtPotTemp(), and WXP::Domain::zoom().

float Calc::presAlt ( float  pres  )  [static]

Pressure altitude in m given pressure in millibars

Parameters:
pres Pressure in millibars
float Calc::relHum ( float  t,
float  td 
) [static]

Relative humidity in percent

Parameters:
t Temperature in Kelvin or Celsius
td Dewpoint in Kelvin or Celsius

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

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

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

Surface pressure in mb given altimeter setting

Parameters:
alt Altimeter setting in millibars
el Elevation in meters

References WXP::Const::MISS.

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

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

Specific humidity in gm/kg

Parameters:
temp Temperature in K or vapor pressure in mb
pr Pressure in millibars

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

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

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

Temperature humidity index in Fahrenheit

Parameters:
temp Temperature in Fahrenheit
dewp Dewpoint in Fahrenheit

References WXP::Const::MISS.

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

Temperature on a dry adiabat in Kelvin

Parameters:
pot Potential temperature in Kelvin
pr Pressure in millibars

Referenced by convTemp(), lcl(), and lclTemp().

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

Temperature on a mixing ratio line

Parameters:
w Mixing ratio in gm/kg
pr Pressure in millibars

Referenced by convTemp(), and lcl().

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

Temperature on a saturation adiabat in Kelvin

Parameters:
pot Equivalent potential temperature in K
pr Pressure in mb

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

Referenced by wetBulb(), and wetBulbPotTemp().

float Calc::tempVaporPres ( float  e  )  [static]

Temperature in Kelvin given a specific vapor pressure

Parameters:
e Vapor pressure in millibars

Referenced by dewTemp().

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

Equivalent potential temperature on a saturation adiabat in Kelvin

Parameters:
temp Temperature in Kelvin
pr Pressure in millibars

References mixRatio().

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

float Calc::vaporPres ( float  t  )  [static]

Saturation vapor pressure in millibars

Parameters:
t Temperature in Kelvin

References WXP::Const::MISS.

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

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

Virtual potential temperature in Kelvin

Parameters:
temp Temperature in Kelvin
dewp Dewpoint in Kelvin
pr Pressure in millibars

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

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

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

Virtual temperature in Kelvin

Parameters:
temp Temperature in Kelvin
dewp Dewpoint in Kelvin or mixing ratio in gm/kg
pr Pressure in millibars

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

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

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

Wet bulb temperature in Kelvin

Parameters:
temp Temperature in Kelvin
dewp Dewpoint in Kelvin
pr Pressure in millibars

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

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

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

Wet bulb potential temperature in Kelvin

Parameters:
temp Temperature in Kelvin
dewp Dewpoint in Kelvin
pr Pressure in millibars

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

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

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

Wind chill in Watts per square meter

Parameters:
temp Temperature in Kelvin
ws Wind speed in meters per second

References WXP::Const::MISS.

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

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

Wind chill in Kelvin

Parameters:
temp Temperature in Kelvin
ws Wind speed in meters per second

References WXP::Const::MISS.

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

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

Wind chill (new version) in Kelvin

Parameters:
temp Temperature in Kelvin
ws Wind speed in meters per second

References WXP::Const::MISS.

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

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

Wind direction computed from U,V components

Parameters:
u U wind component
v V wind component

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

Referenced by WXP::GridMath::adjustUV().

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

Wind speed computed from U,V components

Parameters:
u U wind component
v V wind component

References WXP::Const::MISS.

Referenced by WXP::GridMath::adjustUV().

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

U wind component computed from direction and speed

Parameters:
dir Wind direction
spd Wind speed

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

Referenced by WXP::GridMath::adjustUV().

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

V wind component computed from direction and speed

Parameters:
dir Wind direction
spd Wind speed

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

Referenced by WXP::GridMath::adjustUV().


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

Generated on 8 Jan 2010 for WXP C++ Library by  doxygen 1.6.1