This class does math on grids. More...
#include "../include/GridMath.h"
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) |
This class does math on grids.
Adds a number of grids O = I0 + I1 + ...
| ogrid | Output grid |
| grids | Input grids to be added |
References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Const::MISS, and WXP::Grid::setValue().
Adds two grids O = A + B
| ogrid | Output grid |
| 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().
Adds two grids O = O + I
| ogrid | Output grid |
| 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().
This function adjusts U and V wind components from a north-east coordinate system to a grid coordinate system.
| ogrid | Output grid |
| 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
| ogrid | Output grid |
| 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().
Subtracts two grids O = A - B
| ogrid | Output grid |
| 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().
Subtracts two grids O = O - I
| ogrid | Output grid |
| 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().
Divides two grids O = A / B
| ogrid | Output grid |
| 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().
Interpolates between grids
| ogrid | Output grid |
| 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().
Compares a domain to a grids
References WXP::DomainVal::compare(), WXP::Domain::get(), and WXP::Grid::getDomainVal().
Compares the domains of two grids
References WXP::DomainVal::compare(), and WXP::Grid::getDomainVal().
Referenced by add(), adjustUV(), diff(), div(), interp(), maxSpd(), mult(), and WXP::GridBox::set().
Compares a domain to a grids
References WXP::DomainVal::compareProj(), WXP::Domain::get(), and WXP::Grid::getDomainVal().
Compares the domains of two grids
References WXP::DomainVal::compareProj(), and WXP::Grid::getDomainVal().
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.
| ogrid | Output grid |
| 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.
Gets max of a number of grids
| ogrid | Output grid |
| grids | Input grids |
References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Const::MISS, and WXP::Grid::setValue().
Referenced by maxSpd().
Computes the max wind speed
| ugrid | U wind component grid | |
| vgrid | V wind component grid |
References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), isDomainEqual(), max(), and WXP::Const::MISS.
Gets min of a number of grids
| ogrid | Output grid |
| grids | Input grids |
References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Const::MISS, and WXP::Grid::setValue().
Multiplies two grids O = A * B
| ogrid | Output grid |
| 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
| ogrid | Output grid |
| off | Offset value |
References WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), WXP::Const::MISS, and WXP::Grid::setValue().
Remaps grid to new domain
| ogrid | Output grid in new domain |
| 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
| ogrid | Output grid |
| 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] |
Changes the units of a grid
| grid | Grid to change | |
| units | New units (C to F, ft to m) |
References WXP::Unit::convert(), WXP::Unit::equal(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), WXP::Grid::setValue(), WXP::Unit::valid(), and WXP::StrLib::valid().
Referenced by WXP::UpaPlot::draw(), WXP::SfcPlot::draw(), WXP::MosPlot::draw(), WXP::GridPlot::draw(), and WXP::RadMask::getGrids().
1.6.1