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

This class is an access layer to netCDF files. More...

#include "../include/NetCdfFile.h"

Public Types

enum  Type {
  BYTE , CHAR , SHORT , INT ,
  FLOAT , DOUBLE , UBYTE , USHORT ,
  UINT , INT64
}
 

Public Member Functions

int init ()
 
 NetCdfFile (const char *filename, int access)
 
 NetCdfFile (const char *filename)
 
int setFD (int val)
 
int printErrors (int val)
 
int open (const char *filename, int access)
 
int open (const char *filename)
 
int defDim (const char *name, int size)
 
int defUnlimitDim (const char *name)
 
int endDef ()
 
int close ()
 
int getNumDim ()
 
int getNumVar ()
 
int getNumAttr ()
 
int getUnlimitDim ()
 
int getDim (const char *name)
 
const char * getDimName (int dim)
 
int getDimSize (int dim)
 
int setShape (int num,...)
 
int defVar (const char *name, int type, int ndims,...)
 
int defVar (const char *name, int type, IntArray &dims)
 
int defFloatVar (const char *name)
 
int defIntVar (const char *name)
 
int defShortVar (const char *name)
 
int defByteVar (const char *name)
 
int defCharVar (const char *name)
 
int getVar (const char *name)
 
const char * getVarName (int var)
 
int putGlobAttr (const char *name, const char *value)
 
bool hasGlobAttr (const char *name)
 
const char * getGlobAttr (const char *name)
 
int getGlobAttr (const char *name, String &string)
 
int getIntGlobAttr (const char *name)
 
float getFloatGlobAttr (const char *name)
 
const char * getGlobAttrName (int ind)
 
int putBaseAttr (int id, const char *long_name, const char *units)
 
int putRangeAttr (int id, float min, float max)
 
int putRangeAttr (int id, int min, int max)
 
int putFillAttr (int id)
 
int putFillAttr (int id, int val)
 
int getNumVarAttr (int var)
 
bool hasAttr (int var, const char *name)
 
const char * getAttr (int var, const char *name)
 
int getAttr (int var, const char *name, String &string)
 
int getIntAttr (int var, const char *name)
 
float getFloatAttr (int var, const char *name)
 
const char * getAttrName (int var, int ind)
 
int getNumVarDims (int var)
 
int getVarDims (int var, IntArray &dims)
 
int getVarType (int var)
 
const char * getVarTypeStr (int var)
 
int setPos (int num,...)
 
int setPos (IntArray &st)
 
int setRange (int num,...)
 
int setRange (IntArray &st, IntArray &cnt)
 
int put (int var, IntArray &st, const char *str)
 
int putStr (int var, const char *str)
 
int put (int var, float value)
 
int put (int var, float *array)
 
int put (int var, int value)
 
int put (int var, short value)
 
int put (int var, char value)
 
int put (int var, const char *array)
 
const char * get (int var, IntArray &st)
 
int getRow (int var, IntArray &st, FloatArray &array)
 
int getStr (int var, int len, char *str)
 
float getFloat (int var)
 
int getFloatArray (int var, float *array)
 
int getFloatArray (int var, FloatArray &array)
 
double getDouble (int var)
 
int getDoubleArray (int var, double *array)
 
char getChar (int var)
 
int getInt (int var)
 
char getByte (int var)
 
int getByteArray (int var, char *array)
 
int getIntArray (int var, int *array)
 
short getShort (int var)
 
int getShortArray (int var, short *array)
 

Detailed Description

This class is an access layer to netCDF files.

Author
Dan Vietor

Member Function Documentation

◆ close()

int NetCdfFile::close ( )

◆ getDim()

int NetCdfFile::getDim ( const char *  name)

Gets the index of the dimension given its name

Parameters
nameName of dimension
Return values
Indexof dimension

Referenced by WXP::SfcCdfFile::open(), WXP::SatCdfFile::readData(), and WXP::SatCdfFile::readHeader().

◆ getDimName()

const char * NetCdfFile::getDimName ( int  dim)

Gets the name of the dimension given its index

Parameters
dimIndex of dimension
Return values
Nameof dimension

◆ getDimSize()

int NetCdfFile::getDimSize ( int  dim)

Gets the size of the dimension given its index

Parameters
dimIndex of dimension
Return values
Sizeof dimension

Referenced by WXP::SfcCdfFile::open(), WXP::SatCdfFile::readData(), and WXP::SatCdfFile::readHeader().

◆ getGlobAttr()

int NetCdfFile::getGlobAttr ( const char *  name,
String string 
)

Gets a global attribute values as a string

Parameters
[in]nameName of global attribute
[out]

String class to save ouptut

◆ getIntGlobAttr()

int NetCdfFile::getIntGlobAttr ( const char *  name)

Gets a global attribute values as an integer

Parameters
[in]nameName of global attribute
Return values
Attributevalue

References WXP::Const::MISS.

Referenced by WXP::SatCdfFile::readHeader().

◆ getNumAttr()

int NetCdfFile::getNumAttr ( )

Gets the number of global attributes

Return values
Numberof global attributes

◆ getNumDim()

int NetCdfFile::getNumDim ( )

Gets the number of dimensions

Return values
Numberof dimensions

◆ getNumVar()

int NetCdfFile::getNumVar ( )

Gets the number of variables

Return values
Numberof variables

◆ getUnlimitDim()

int NetCdfFile::getUnlimitDim ( )

Gets the index of the unlimited dimension

Return values
Indexof dimension

◆ open() [1/2]

int NetCdfFile::open ( const char *  filename)

Opens a netCDF file for reading

Parameters
filenameInput filename

References open(), and WXP::FileAttr::READ.

◆ open() [2/2]

int NetCdfFile::open ( const char *  filename,
int  access 
)

Opens the netCDF file

Parameters
filenameFile to open
accessAccess ( FileAttr::READ, FileAttr::WRITE )
Return values
1on succcess

References WXP::FileAttr::APPEND, WXP::Wxp::exit(), WXP::Wxp::NORUN, WXP::FileAttr::READ, WXP::Wxp::validLicense(), and WXP::FileAttr::WRITE.

Referenced by open(), WXP::SatCdfFile::open(), and WXP::SfcCdfFile::open().

◆ setShape()

int NetCdfFile::setShape ( int  num,
  ... 
)

Sets the shape of data requests

Parameters
[in]numNumber of parameters
[in]...A list of integers for shape of request

Referenced by WXP::SfcCdfFile::open().


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