WXP C++ Library Version 6.74.9
|
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) |
This class reads MOS data files.
MosUFile::MosUFile | ( | ) |
Constructor. Initializes class values
MosUFile::~MosUFile | ( | ) |
Destructor.
References WXP::WmoParse::close().
int MosUFile::close | ( | ) |
Closes the data file
References WXP::WmoParse::close().
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.
str | String to decode. |
data | Output 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().
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.
str | String to decode. |
data | Output data |
References decodeETA().
int MosUFile::decodeNGM | ( | const char * | str, |
MosUData & | data | ||
) |
int MosUFile::getDate | ( | Date & | rdate | ) |
Gets the date of the file
rdate | Date class to put date information |
const char * MosUFile::getModel | ( | ) |
Gets the current model label from the model type
References getModel().
Referenced by getModel().
|
static |
Gets the model label from the model type
mod | The model type |
|
inline |
Returns the latest WMO header
References WXP::WmoParse::getHeader().
|
inline |
Returns true if file open
int MosUFile::open | ( | const char * | filename, |
int | rtype | ||
) |
Opens a MOS data file
filename | Filename to open |
rtype | Type of file to open |
References WXP::WmoParse::isOpen(), and WXP::WmoParse::open().
int MosUFile::read | ( | MosUData & | data | ) |
Reads in a single report and populates the MosData class
data | The MosData class to put the data into. |
References WXP::DateVal::day, decodeETA(), WXP::DateTool::decodeMonth(), decodeNGM(), WXP::WmoParse::getLine(), WXP::WmoParse::getLoc(), WXP::DateVal::hour, WXP::MosUData::init(), WXP::WmoParse::isNewProd(), WXP::DateVal::month, WXP::Wxp::outDebug(), WXP::Date::set(), and WXP::DateVal::year.
int MosUFile::rewind | ( | ) |
Rewinds the MOS file
References WXP::WmoParse::rewind().
int MosUFile::setModel | ( | const char * | str | ) |
int MosUFile::setModel | ( | int | mod | ) |
Sets the model to search for in the file. This should be set before opening the file.
mod | Integral model designator |
References WXP::WmoParse::setHeader().
Referenced by setModel().