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

This class reads MOS data files. More...

#include "../include/MosUFile.h"

Public Types

enum  Model { NONE , NGM , ETA , NAM }
 
enum  Type { UNK , WMO , BUFR , CDF }
 

Public Member Functions

 MosUFile ()
 
 MosUFile (const char *filename, int type)
 
 MosUFile (const char *filename)
 
 MosUFile (Filename &filename, int type)
 
 MosUFile (Filename &filename)
 
 ~MosUFile ()
 
int init ()
 
int setModel (int mod)
 
int setModel (const char *str)
 
const char * getModel ()
 
int open (const char *filename, int type)
 
int open (const char *filename)
 
int open (Filename &filename, int type)
 
int open (Filename &filename)
 
int rewind ()
 
int close ()
 
bool isOpen ()
 
int getDate (Date &rdate)
 
int read (MosUData &data)
 
int decodeNGM (const char *str, MosUData &data)
 
int decodeETA (const char *str, MosUData &data)
 
int decodeNAM (const char *str, MosUData &data)
 
const char * getWmo ()
 

Static Public Member Functions

static const char * getModel (int mod)
 

Detailed Description

This class reads MOS data files.

Author
Dan Vietor

Constructor & Destructor Documentation

◆ MosUFile()

MosUFile::MosUFile ( )

Constructor. Initializes class values

◆ ~MosUFile()

MosUFile::~MosUFile ( )

Destructor.

References WXP::WmoParse::close().

Member Function Documentation

◆ close()

int MosUFile::close ( )

Closes the data file

References WXP::WmoParse::close().

◆ decodeETA()

int MosUFile::decodeETA ( const char *  str,
MosUData data 
)

Decodes a single line of data from the Eta MOS data file and inserts data into the class. It decodes the header for initial time info as well.

Parameters
strString to decode.
Return values
dataOutput data

References WXP::Calc::ADD(), WXP::Date::getHour(), WXP::StrLib::length(), WXP::Const::MISS, WXP::Calc::MUL(), WXP::Scanp::offset(), WXP::Wxp::outDebug(), WXP::Scanp::scan(), and WXP::Scanp::set().

Referenced by decodeNAM(), and read().

◆ decodeNAM()

int MosUFile::decodeNAM ( const char *  str,
MosUData data 
)

Decodes a single line of data from the NAM MOS data file and inserts data into the class. It decodes the header for initial time info as well.

Parameters
strString to decode.
Return values
dataOutput data

References decodeETA().

◆ decodeNGM()

int MosUFile::decodeNGM ( const char *  str,
MosUData data 
)

Decodes a single line of data from the MOS data file and inserts data into the class. It decodes the header for initial time info as well.

Parameters
strString to decode.
Return values
dataOutput data

Referenced by read().

◆ getDate()

int MosUFile::getDate ( Date rdate)

Gets the date of the file

Return values
rdateDate class to put date information

◆ getModel() [1/2]

const char * MosUFile::getModel ( )

Gets the current model label from the model type

Returns
The label

References getModel().

Referenced by getModel().

◆ getModel() [2/2]

const char * MosUFile::getModel ( int  mod)
static

Gets the model label from the model type

Parameters
modThe model type
Returns
The label

◆ getWmo()

const char * WXP::MosUFile::getWmo ( )
inline

Returns the latest WMO header

References WXP::WmoParse::getHeader().

◆ isOpen()

bool WXP::MosUFile::isOpen ( )
inline

Returns true if file open

◆ open()

int MosUFile::open ( const char *  filename,
int  rtype 
)

Opens a MOS data file

Parameters
filenameFilename to open
rtypeType of file to open

References WXP::WmoParse::isOpen(), and WXP::WmoParse::open().

◆ read()

int MosUFile::read ( MosUData data)

◆ rewind()

int MosUFile::rewind ( )

Rewinds the MOS file

References WXP::WmoParse::rewind().

◆ setModel() [1/2]

int MosUFile::setModel ( const char *  str)

Sets the model type

Parameters
strThe model type

References WXP::StrLib::iequal(), and setModel().

◆ setModel() [2/2]

int MosUFile::setModel ( int  mod)

Sets the model to search for in the file. This should be set before opening the file.

Parameters
modIntegral model designator

References WXP::WmoParse::setHeader().

Referenced by setModel().


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