WXP::GridMath Class Reference
[Compute objects]

This class does math on grids. More...

#include "../include/GridMath.h"

List of all members.

Static Public Member Functions

static int process (const char *func, Grid &ogrid, Grids &grids)
static bool checkVar (Grid &grid, const char *var)
static int setInfo (Grid &ogrid, const char *name, const char *units)
static int units (Grid &grid, const char *units)
static bool isDomainEqual (Grid &grd1, Grid &grd2)
static bool isDomainEqual (Grid &grd1, Domain &dom)
static bool isProjEqual (Grid &grd1, Grid &grd2)
static bool isProjEqual (Grid &grd1, Domain &dom)
static float maxSpd (Grid &ugrid, Grid &vgrid)
static int remap (Grid &ogrid, Domain &domain, Grid &igrid)
static int cutoff (Grid &ogrid, const char *cmd, float cutoff, float nval, Grid &igrid)
static int scale (Grid &ogrid, float scale)
static int offset (Grid &ogrid, float off)
static int interp (Grid &ogrid, Grid &grid1, float ival, Grid &grid2)
static int add (Grid &ogrid, Grid &igrid)
static int add (Grid &ogrid, Grid &agrid, Grid &bgrid)
static int add (Grid &ogrid, Grids &grids)
static int avg (Grid &ogrid, Grids &grids)
static int diff (Grid &ogrid, Grid &igrid)
static int diff (Grid &ogrid, Grid &grida, Grid &gridb)
static int mult (Grid &ogrid, Grid &grida, Grid &gridb)
static int div (Grid &ogrid, Grid &grida, Grid &gridb)
static int max (Grid &ogrid, Grids &grids)
static int min (Grid &ogrid, Grids &grids)
static int adjustUV (Grid &ugrid, Grid &vgrid)
static int locatePoint (Grid &ogrid, Grid &grid, const char *oper)
static int coriolis (Grid &ogrid, Grid &grid, const char *oper)
static int dx (Grid &ogrid, Grid &grid)
static int dy (Grid &ogrid, Grid &grid)
static int laplacian (Grid &ogrid, Grid &grid)
static int converge (Grid &ogrid, Grid &ugrid, Grid &vgrid, Grid &zgrid)
static int converge (Grid &ogrid, Grid &ugrid, Grid &vgrid)
static int vorticity (Grid &ogrid, Grid &ugrid, Grid &vgrid)
static int deformation1 (Grid &ogrid, Grid &ugrid, Grid &vgrid)
static int deformation2 (Grid &ogrid, Grid &ugrid, Grid &vgrid)
static int advection (Grid &ogrid, Grid &ugrid, Grid &vgrid, Grid &zgrid)
static int windSpd (Grid &ogrid, Grid &ugrid, Grid &vgrid)
static int dewTemp (Grid &ogrid, Grid &tgrid, Grid &rgrid)
static int mixRatio (Grid &ogrid, Grid &tgrid, Grid &rgrid)
static int windChill (Grid &ogrid, const char *func, Grid &tgrid, Grid &sgrid)
static int potTemp (Grid &ogrid, Grid &grid)
static int showalter (Grid &ogrid, Grid &t8grid, Grid &r8grid, Grid &t5grid)
static int adjustDir (Grid &ugrid, Grid &vgrid, Domain &dom)

Detailed Description

This class does math on grids.

Author:
Dan Vietor

Member Function Documentation

int GridMath::add ( Grid ogrid,
Grids grids 
) [static]

Adds a number of grids O = I0 + I1 + ...

Return values:
ogrid Output grid
Parameters:
grids Input grids to be added

References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Const::MISS, and WXP::Grid::setValue().

int GridMath::add ( Grid ogrid,
Grid agrid,
Grid bgrid 
) [static]

Adds two grids O = A + B

Return values:
ogrid Output grid
Parameters:
agrid Input grid, will be added to ogrid
bgrid Input grid, will be added to ogrid

References WXP::Grid::allocData(), WXP::String::get(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), isDomainEqual(), WXP::Const::MISS, WXP::Grid::setInfo(), WXP::Grid::setValue(), and WXP::VarSpec::toInfoLabel().

int GridMath::add ( Grid ogrid,
Grid igrid 
) [static]

Adds two grids O = O + I

Return values:
ogrid Output grid
Parameters:
igrid Input grid, will be added to ogrid

References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), isDomainEqual(), WXP::Const::MISS, and WXP::Grid::setValue().

int GridMath::adjustUV ( Grid ugrid,
Grid vgrid 
) [static]

This function adjusts U and V wind components from a north-east coordinate system to a grid coordinate system.

Return values:
ogrid Output grid
Parameters:
agrid Input grid
bgrid Input grid

References WXP::Domain::adjustDir(), WXP::Const::DRC, WXP::Grid::getDomain(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), isDomainEqual(), WXP::Const::MISS, WXP::Point::set(), WXP::Grid::setValue(), WXP::Domain::tran(), WXP::Calc::windDir(), WXP::Calc::windSpd(), WXP::Calc::windU(), and WXP::Calc::windV().

int GridMath::cutoff ( Grid ogrid,
const char *  cmd,
float  cutoff,
float  nval,
Grid igrid 
) [static]

Cuts off valus in a grid. This would make all values lower than a cutoff to nval

Return values:
ogrid Output grid
Parameters:
cmd Command (lower, higher)
cutoff Cutoff value
nval New value to set gridpoints to
igrid Grid to use

References WXP::Grid::allocData(), WXP::StrLib::equal(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), WXP::Const::MISS, and WXP::Grid::setValue().

int GridMath::diff ( Grid ogrid,
Grid agrid,
Grid bgrid 
) [static]

Subtracts two grids O = A - B

Return values:
ogrid Output grid
Parameters:
agrid Input grid
bgrid Input grid

References WXP::Grid::allocData(), WXP::String::get(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), WXP::Grid::init(), isDomainEqual(), WXP::Const::MISS, WXP::Grid::setInfo(), WXP::Grid::setValue(), and WXP::VarSpec::toInfoLabel().

int GridMath::diff ( Grid ogrid,
Grid igrid 
) [static]

Subtracts two grids O = O - I

Return values:
ogrid Output grid
Parameters:
igrid Input grid, will be subtracted from ogrid

References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), isDomainEqual(), WXP::Const::MISS, and WXP::Grid::setValue().

int GridMath::div ( Grid ogrid,
Grid agrid,
Grid bgrid 
) [static]

Divides two grids O = A / B

Return values:
ogrid Output grid
Parameters:
agrid Input grid
bgrid Input grid

References WXP::Grid::allocData(), WXP::String::get(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), WXP::Grid::init(), isDomainEqual(), WXP::Const::MISS, WXP::Grid::setInfo(), WXP::Grid::setValue(), and WXP::VarSpec::toInfoLabel().

int GridMath::interp ( Grid ogrid,
Grid agrid,
float  factor,
Grid bgrid 
) [static]

Interpolates between grids

Return values:
ogrid Output grid
Parameters:
agrid First grid to be used
factor Interpolation factor
bgrid Second grid to be used

References WXP::Grid::allocData(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), isDomainEqual(), WXP::Const::MISS, and WXP::Grid::setValue().

bool GridMath::isDomainEqual ( Grid grd,
Domain dom 
) [static]

Compares a domain to a grids

Parameters:
grd Grid
dom Domain to compare to
Returns:
Whether two domains are equal

References WXP::DomainVal::compare(), WXP::Domain::get(), and WXP::Grid::getDomainVal().

bool GridMath::isDomainEqual ( Grid grd1,
Grid grd2 
) [static]

Compares the domains of two grids

Parameters:
grd1 Grid 1
grd2 Grid 2
Returns:
Whether two domains are equal

References WXP::DomainVal::compare(), and WXP::Grid::getDomainVal().

Referenced by add(), adjustUV(), diff(), div(), interp(), maxSpd(), mult(), and WXP::GridBox::set().

bool GridMath::isProjEqual ( Grid grd,
Domain dom 
) [static]

Compares a domain to a grids

Parameters:
grd Grid
dom Domain to compare to
Returns:
Whether two domains are equal

References WXP::DomainVal::compareProj(), WXP::Domain::get(), and WXP::Grid::getDomainVal().

bool GridMath::isProjEqual ( Grid grd1,
Grid grd2 
) [static]

Compares the domains of two grids

Parameters:
grd1 Grid 1
grd2 Grid 2
Returns:
Whether two domains are equal

References WXP::DomainVal::compareProj(), and WXP::Grid::getDomainVal().

int GridMath::locatePoint ( Grid ogrid,
Grid grid,
const char *  oper 
) [static]

Outputs a grid with location information for each gridpoint. For example, lat will return a grid with each gridpoint containing the latitude of that gridpoint.

Return values:
ogrid Output grid
Parameters:
grid Input grid
oper Operation (lat, lon, projx, projy)

References WXP::Grid::allocData(), WXP::StrLib::equal(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::EarthPoint::lat, WXP::EarthPoint::lon, WXP::GridPoint::set(), WXP::Grid::setInfo(), WXP::Grid::setValue(), WXP::Grid::tran(), WXP::Point::x, and WXP::Point::y.

int GridMath::max ( Grid ogrid,
Grids grids 
) [static]

Gets max of a number of grids

Return values:
ogrid Output grid
Parameters:
grids Input grids

References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Const::MISS, and WXP::Grid::setValue().

Referenced by maxSpd().

float GridMath::maxSpd ( Grid ugrid,
Grid vgrid 
) [static]

Computes the max wind speed

Parameters:
ugrid U wind component grid
vgrid V wind component grid
Returns:
maximum speed

References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), isDomainEqual(), max(), and WXP::Const::MISS.

int GridMath::min ( Grid ogrid,
Grids grids 
) [static]

Gets min of a number of grids

Return values:
ogrid Output grid
Parameters:
grids Input grids

References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Const::MISS, and WXP::Grid::setValue().

int GridMath::mult ( Grid ogrid,
Grid agrid,
Grid bgrid 
) [static]

Multiplies two grids O = A * B

Return values:
ogrid Output grid
Parameters:
agrid Input grid
bgrid Input grid

References WXP::Grid::allocData(), WXP::String::get(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), WXP::Grid::init(), isDomainEqual(), WXP::Const::MISS, WXP::Grid::setInfo(), WXP::Grid::setValue(), and WXP::VarSpec::toInfoLabel().

int GridMath::offset ( Grid ogrid,
float  off 
) [static]

Offset grid values

Return values:
ogrid Output grid
Parameters:
off Offset value

References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), WXP::Const::MISS, and WXP::Grid::setValue().

int GridMath::remap ( Grid ogrid,
Domain domain,
Grid igrid 
) [static]

Remaps grid to new domain

Return values:
ogrid Output grid in new domain
Parameters:
domain New domain
igrid Grid to remap

References WXP::Grid::allocData(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), WXP::Domain::isSet(), WXP::GridPoint::set(), WXP::Grid::setDomain(), WXP::Grid::setValue(), and WXP::Grid::tran().

Referenced by WXP::RadMask::getGrids().

int GridMath::scale ( Grid ogrid,
float  scale 
) [static]

Scales grid values

Return values:
ogrid Output grid
Parameters:
scale Scale value

References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), WXP::Const::MISS, and WXP::Grid::setValue().

int GridMath::units ( Grid grid,
const char *  units 
) [static]

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