WXP::Grid Class Reference

This class defines a grid. More...

#include "../include/Grid.h"

List of all members.

Public Member Functions

 Grid ()
 Grid (int rnx, int rny)
 Grid (const Grid &grid)
 ~Grid ()
int init ()
int copy (const Grid &grid)
int copyInfo (const Grid &grid)
int copyData (const Grid &grid)
Grid operator= (const Grid &grid)
int setType (int val)
int getType ()
int setSource (int val)
int getSource ()
int setVersion (int val)
int getVersion ()
int setDatim (const char *str)
const char * getDatim ()
int setInfo (const char *str)
const char * getInfo ()
int setDate (Date &d)
int setDate (DateVal &dv)
Date getDate ()
Date getDate (Date &rdate)
DateVal getDateVal ()
int setSize (int x, int y)
int getSize (int &x, int &y)
int getNx ()
int getNy ()
float getDx ()
float getDy ()
int setGridType (int type)
int getGridType ()
int setDomain (DomainVal &dv)
int setDomain (Domain &dom)
DomainVal getDomainVal ()
Domain getDomain ()
int getDomain (Domain &dom)
int getProj ()
int tran (EarthPoint ept, Point &pt)
int tran (Point pt, EarthPoint &ept)
int tran (GridPoint gpt, Point &pt)
int tran (Point pt, GridPoint &gpt)
int tran (EarthPoint ept, GridPoint &gpt)
int tran (GridPoint gpt, EarthPoint &ept)
int tran (Domain &dom, Point pt1, Point &pt2)
int tran (Point pt1, Domain &dom, Point &pt2)
int setModel (int val)
int getModel ()
int setGenName (const char *str)
const char * getGenName ()
int setVar (VarSpec v)
int getVar (VarSpec &v)
VarSpec getVarSpec ()
int setLevel (const char *str)
int setLevel (Level &l)
int getLevel (Level &l)
Level getLevel ()
int getLevelType ()
int setForeTime (const char *str)
int setForeTime (ForeTime &t)
int getForeTime (ForeTime &t)
ForeTime getForeTime ()
float getForeHour ()
int getForeSecs ()
int setVar (const char *str)
int setVar (Variable &v)
const char * getUnits ()
int setUnits (const char *units)
Variable getVar ()
GridSpec getSpec ()
int getSpec (GridSpec &spec)
int allocData ()
int allocLocate ()
int setValue (int x, int y, float val)
float getValue (int x, int y)
float getValue1 (int x, int y)
float getValue (GridPoint gpt)
float getValue (EarthPoint ept)
float getValue (Point pt)
bool isLocate ()
bool isData ()
bool isValue ()
int setLocate (int x, int y, Point &pt)
int getLocate (int x, int y, Point &pt)
Point getLocate (int x, int y)
float getAverage ()
int getRange (float &min, float &max)
int getRange (Range &range)
int scale (float scale)
int offset (float offset)
int print ()
int printInfo ()
int printStats ()
int printData ()

Static Public Member Functions

static int copyInfo (Grid &grid1, const Grid &grid2)
static int copyData (Grid &grid1, const Grid &grid2)
static int copy (Grid &grid1, const Grid &grid2)

Detailed Description

This class defines a grid.

Author:
Dan Vietor

Constructor & Destructor Documentation

Grid::Grid (  ) 

Constructor for Grid Initializes the grid parameters.

References init().

Grid::Grid ( int  rnx,
int  rny 
)

Constructor for Grid Initializes the grid parameters.

References allocData(), init(), and setSize().

Grid::Grid ( const Grid grid  ) 

Copy constructor for the grid class

Parameters:
grid Grid class to copy from
Grid::~Grid (  ) 

Destructor for Grid Deletes allocated data for grid (if needed).


Member Function Documentation

int Grid::allocData (  ) 
int Grid::allocLocate (  ) 

Allocates the location points for the grid

Referenced by WXP::UpaXSectCont::draw().

float Grid::getAverage (  ) 

Gets the average value from the grid

Returns:
Average

References WXP::Const::MISS.

DateVal Grid::getDateVal (  ) 

Get the date from the grid

Returns:
Date values

References WXP::Date::get().

Referenced by WXP::GribFile::makeDatim().

const char * Grid::getDatim (  ) 

Gets the date/time string

Returns:
The date/time string
int Grid::getDomain ( Domain dom  ) 

Gets the domain of the grid

Return values:
dom The Domain class to put parameters
Domain Grid::getDomain (  ) 

Gets the domain of the grid

Returns:
Domain object containing domain parameters

Referenced by WXP::GridMath::adjustUV(), WXP::GridPlot::getDomain(), and WXP::GridCont::getDomain().

DomainVal Grid::getDomainVal (  ) 

Gets the domain of the grid

Returns:
DomainVal struct containing domain parameters

References WXP::Domain::get().

Referenced by WXP::GridMath::isDomainEqual(), WXP::GridMath::isProjEqual(), and WXP::GribFile::readBDB().

float Grid::getDx (  ) 

Gets the grid domain dx value

Returns:
Dx value

References WXP::Domain::getDx().

float Grid::getDy (  ) 

Gets the grid domain dx value

Returns:
Dx value

References WXP::Domain::getDy().

float Grid::getForeHour (  ) 

Gets the forecast time of the grid

Return values:
t Input forecast time class
int Grid::getForeSecs (  ) 

Gets the forecast time of the grid

Return values:
t Input forecast time class
ForeTime Grid::getForeTime (  ) 

Gets the forecast time of the grid

Returns:
Output forecast time class
int Grid::getForeTime ( ForeTime t  ) 

Gets the forecast time of the grid

Return values:
t Input forecast time class

Referenced by WXP::GribFile::makeDatim(), and WXP::GribFile::makeInfo().

const char * Grid::getInfo (  ) 

Gets the content/information string

Returns:
The information string
Level Grid::getLevel (  ) 

Gets the vertical level of the grid

Returns:
Output Level class
int Grid::getLevel ( Level l  ) 

Gets the vertical level of the grid

Return values:
l Input Level class

Referenced by WXP::GribFile::makeInfo().

int Grid::getLevelType (  ) 

Get the vertical level type

Returns:
level type
int Grid::getNx (  ) 
int Grid::getNy (  ) 
int Grid::getProj (  ) 

Gets the grid domain projection ID

Returns:
Numeric projection ID

References WXP::Domain::getProj().

int Grid::getRange ( float &  min,
float &  max 
)

Gets the max and min values from the grid

Return values:
min Minimum value of grid
max Maximum value of grid

References WXP::Const::MISS.

int Grid::getSize ( int &  x,
int &  y 
)

Gets the size of the grid

Return values:
x The number of gridpoints in X
y The number of gridpoints in Y
int Grid::getSource (  ) 

Gets the source of the data

Returns:
Source of data

Referenced by WXP::GribFile::setPDB().

int Grid::getSpec ( GridSpec gs  ) 

Outputs grid specifications to GridSpec class

Return values:
Output GridSpec class

References WXP::GridSpec::set().

GridSpec Grid::getSpec (  ) 

Outputs grid specifications to GridSpec class

Returns:
Output GridSpec class

References WXP::GridSpec::set().

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

int Grid::getType (  ) 

Get the grid type

Returns:
grid type
float Grid::getValue ( Point  pt  ) 

Gets a value from the grid

Parameters:
pt Point class specifying projection location
Returns:
Value from grid or MISS

References getValue(), and WXP::Domain::tran().

float Grid::getValue ( EarthPoint  ept  ) 

Gets a value from the grid

Parameters:
ept Earthpoint class specifying location (lat,lon)
Returns:
Value from grid or MISS

References getValue(), and WXP::Domain::tran().

float Grid::getValue ( GridPoint  gpt  ) 

Gets a value from the grid

Parameters:
gpt Gridpoint class specifying location
Returns:
Value from grid or MISS

References WXP::Const::MISS.

float Grid::getValue ( int  x,
int  y 
)
Variable Grid::getVar (  ) 

Gets the variable parameters

Returns:
Output variable class
int Grid::getVersion (  ) 

Gets the version number

Returns:
The version number
int Grid::init (  ) 
int Grid::offset ( float  offset  ) 

Offsets the values in a grid

Parameters:
offset Offsets factor to apply

References WXP::Const::MISS.

Grid Grid::operator= ( const Grid grid  ) 

Assignment operator. Used to overload copying

Parameters:
grid String class to copy from
int Grid::print (  ) 

Prints class information to standard output

References WXP::String::get(), and WXP::Domain::print().

Referenced by WXP::RcmPlot::draw().

int Grid::printInfo (  ) 

Prints basic grid information to standard output

References WXP::String::get().

int Grid::scale ( float  scale  ) 

Scales the values in a grid

Parameters:
scale Scale factor to apply

References WXP::Const::MISS.

int Grid::setDate ( DateVal dv  ) 

Sets the date of the grid

Parameters:
dv Date values to set date

References WXP::Date::set().

int Grid::setDate ( Date d  ) 

Sets the date of the grid

Parameters:
d Date class to use

Referenced by WXP::GribFile::setPDB().

int Grid::setDatim ( const char *  str  ) 

Sets the date/time string

Parameters:
str Date/time string

References WXP::StrLib::copy().

Referenced by WXP::RcmPlot::draw(), and WXP::GribFile::makeDatim().

int Grid::setDomain ( DomainVal dv  ) 

Sets the domain of the grid.

Parameters:
dv DomainVal struct containing domain parameters

References WXP::DomainVal::nx, WXP::DomainVal::ny, and WXP::Domain::set().

Referenced by WXP::GribFile::getHeader(), WXP::GribFile::read(), WXP::GridMath::remap(), and WXP::GridPiece::set().

int Grid::setForeTime ( ForeTime t  ) 

Sets the forecast time of the grid

Parameters:
t Input forecast time class

References WXP::VarSpec::set().

int Grid::setForeTime ( const char *  str  ) 

Sets the forecast time of the grid

Parameters:
t Input forecast time class

References WXP::VarSpec::set(), and WXP::ForeTime::set().

Referenced by WXP::GribFile::setPDB().

int Grid::setGenName ( const char *  str  ) 

Sets the model generation name

Parameters:
str Name

References WXP::StrLib::copy().

Referenced by WXP::GribFile::setPDB().

int Grid::setInfo ( const char *  str  ) 
int Grid::setLevel ( Level l  ) 

Sets the vertical level of the grid

Parameters:
l Input Level class

References WXP::VarSpec::set().

int Grid::setLevel ( const char *  str  ) 

Sets the vertical level of the grid

Parameters:
l Input Level class

References WXP::VarSpec::set(), and WXP::Level::set().

Referenced by WXP::GribFile::setPDB().

int Grid::setLocate ( int  x,
int  y,
Point pt 
)

Sets a location in the grid

Parameters:
x X location in grid
y Y location in grid
pt Location of gridpoint on projection

References WXP::Point::x, and WXP::Point::y.

Referenced by WXP::UpaXSectCont::draw().

int Grid::setSize ( int  x,
int  y 
)

Sets the grid size

Parameters:
x The number of gridpoints in X
y The number of gridpoints in Y

References WXP::Domain::set().

Referenced by WXP::UpaXSectCont::draw(), and Grid().

int Grid::setSource ( int  val  ) 

Set the source of the data

Parameters:
val Source of data

Referenced by WXP::GribFile::setPDB().

int Grid::setType ( int  val  ) 

Set the grid type

Parameters:
val Type of grid

Referenced by WXP::GribFile::setPDB().

int Grid::setValue ( int  x,
int  y,
float  val 
)
int Grid::setVar ( Variable v  ) 

Sets the variable parameters

Parameters:
v Input variable class

References WXP::VarSpec::set().

int Grid::setVar ( const char *  str  ) 

Sets the variable parameters

Parameters:
v Input variable class

References WXP::Variable::print(), WXP::VarSpec::set(), and WXP::Variable::set().

int Grid::setVersion ( int  val  ) 

Sets the version of the data

Parameters:
val The version number

Referenced by WXP::GribFile::setPDB().

int Grid::tran ( Point  pt1,
Domain dom,
Point pt2 
)

Translates coordinates from the domain of the grid to another domain

Parameters:
pt1 Input point on grid projection plane
dom Secondary domain
Return values:
pt2 Output point on secondary projection plane

References WXP::Domain::translate().

int Grid::tran ( Domain dom,
Point  pt1,
Point pt2 
)

Translates coordinates from another domain to the domain of the grid

Parameters:
dom Secondary domain
pt1 Input point on secondary projection plane
Return values:
pt2 Output point on grid projection plane

References WXP::Domain::translate().

int Grid::tran ( GridPoint  gpt,
EarthPoint ept 
)

Translates coordinates given the domain of the grid

Parameters:
gpt Input grid point
Return values:
ept Output earth point

References WXP::Domain::tran().

int Grid::tran ( EarthPoint  ept,
GridPoint gpt 
)

Translates coordinates given the domain of the grid

Parameters:
ept Input earth point
Return values:
gpt Output grid point

References WXP::Domain::tran().

int Grid::tran ( Point  pt,
GridPoint gpt 
)

Translates coordinates given the domain of the grid

Parameters:
pt Input point on projection plane
Return values:
gpt Output grid point

References WXP::Domain::tran().

int Grid::tran ( GridPoint  gpt,
Point pt 
)

Translates coordinates given the domain of the grid

Parameters:
gpt Input grid point
Return values:
pt Output point on projection plane

References WXP::Domain::tran().

int Grid::tran ( Point  pt,
EarthPoint ept 
)

Translates coordinates given the domain of the grid

Parameters:
pt Input point on projection plane
Return values:
ept Output earth point

References WXP::Domain::tran().

int Grid::tran ( EarthPoint  ept,
Point pt 
)

Translates coordinates given the domain of the grid

Parameters:
ept Input earth point
Return values:
pt Output point on projection plane

References WXP::Domain::tran().

Referenced by WXP::GridVect::callback(), WXP::GridPlot::callback(), WXP::GridCont::callback(), WXP::GridMath::locatePoint(), WXP::GridMath::remap(), and WXP::GridBox::set().


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