WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
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.

Member Function Documentation

◆ close()

int MosUFile::close ( )

Closes the data file

◆ 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

◆ 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

◆ read()

int MosUFile::read ( MosUData & data)

Reads in a single report and populates the MosData class

Return values
dataThe MosData class to put the data into.

References WXP::DateVal::day, decodeETA(), WXP::DateTool::decodeMonth(), decodeNGM(), WXP::DateVal::hour, WXP::MosUData::init(), WXP::DateVal::month, WXP::Wxp::outDebug(), and WXP::DateVal::year.

◆ rewind()

int MosUFile::rewind ( )

Rewinds the MOS file

◆ 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

Referenced by setModel().


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