WXP C++ Library Version 6.74.9
|
This class reads MOS data files. More...
#include "../include/MosFile.h"
Public Types | |
enum | Model { NONE , NGM , ETA , NAM , AVN , GFS , MRF , GFSX , LAMP , PFM } |
enum | Type { UNK , WMO , BUFR , CDF } |
Public Member Functions | |
MosFile () | |
MosFile (const char *filename, int type) | |
MosFile (const char *filename) | |
MosFile (Filename &filename, int type) | |
MosFile (Filename &filename) | |
~MosFile () | |
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 (MosData &data) |
int | decodeNGM (const char *str, MosData &data) |
int | decodeETA (const char *str, MosData &data) |
int | decodeNAM (const char *str, MosData &data) |
int | decodeAVN (const char *str, MosData &data) |
int | decodeGFS (const char *str, MosData &data) |
int | decodeMRF (const char *str, MosData &data) |
int | decodeGFSX (const char *str, MosData &data) |
int | decodeLAMP (const char *str, MosData &data) |
const char * | getWmo () |
Static Public Member Functions | |
static const char * | getModel (int mod) |
This class reads MOS data files.
enum WXP::MosFile::Model |
enum WXP::MosFile::Type |
MosFile::MosFile | ( | ) |
Constructor. Initializes class values
References init().
MosFile::MosFile | ( | const char * | filename, |
int | rtype | ||
) |
MosFile::MosFile | ( | const char * | filename | ) |
MosFile::MosFile | ( | Filename & | filename, |
int | rtype | ||
) |
MosFile::MosFile | ( | Filename & | filename | ) |
MosFile::~MosFile | ( | ) |
Destructor.
References WXP::WmoParse::close(), and WMO.
int MosFile::close | ( | ) |
Closes the data file
References WXP::WmoParse::close(), and WMO.
int MosFile::decodeAVN | ( | const char * | str, |
MosData & | data | ||
) |
Decodes a single line of GFS MOS data from the 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 decodeGFS().
Referenced by read().
int MosFile::decodeETA | ( | const char * | str, |
MosData & | data | ||
) |
Decodes a single line of NAM MOS data from the 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 decodeNAM().
int MosFile::decodeGFS | ( | const char * | str, |
MosData & | data | ||
) |
Decodes a single line of Aviation MOS data from the 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::StrLib::contains(), WXP::DateVal::day, WXP::StrLib::equal(), WXP::Date::getHour(), WXP::DateVal::hour, WXP::StrLib::length(), WXP::Const::MISS, WXP::DateVal::month, WXP::Date::set(), WXP::StrLib::subString(), WXP::StrLib::toInt(), and WXP::DateVal::year.
Referenced by decodeAVN(), and read().
int MosFile::decodeGFSX | ( | const char * | str, |
MosData & | data | ||
) |
Decodes a single line of MRF MOS data from the 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::StrLib::contains(), WXP::DateVal::day, WXP::StrLib::equal(), WXP::Date::getHour(), WXP::DateVal::hour, WXP::StrLib::length(), WXP::Const::MISS, WXP::DateVal::month, WXP::Date::set(), WXP::StrLib::subString(), WXP::StrLib::toInt(), and WXP::DateVal::year.
Referenced by decodeMRF(), and read().
int MosFile::decodeLAMP | ( | const char * | str, |
MosData & | data | ||
) |
Decodes a single line of LAMP MOS data from the 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::StrLib::contains(), WXP::DateVal::day, WXP::StrLib::equal(), WXP::DateVal::hour, WXP::StrLib::length(), WXP::Const::MISS, WXP::DateVal::month, WXP::Date::set(), WXP::StrLib::subString(), WXP::StrLib::toInt(), and WXP::DateVal::year.
Referenced by read().
int MosFile::decodeMRF | ( | const char * | str, |
MosData & | data | ||
) |
Decodes a single line of GFSX MOS data from the 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 decodeGFSX().
Referenced by read().
int MosFile::decodeNAM | ( | const char * | str, |
MosData & | data | ||
) |
Decodes a single line of Eta MOS data from the 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::StrLib::contains(), WXP::DateVal::day, WXP::StrLib::equal(), WXP::Date::getHour(), WXP::DateVal::hour, WXP::StrLib::length(), WXP::Const::MISS, WXP::DateVal::month, WXP::Date::set(), WXP::StrLib::subString(), WXP::StrLib::toInt(), and WXP::DateVal::year.
Referenced by decodeETA(), and read().
int MosFile::decodeNGM | ( | const char * | str, |
MosData & | data | ||
) |
Decodes a single line of NGM MOS data from the 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::StrLib::contains(), WXP::DateVal::day, WXP::StrLib::equal(), WXP::Date::getHour(), WXP::DateVal::hour, WXP::StrLib::length(), WXP::Const::MISS, WXP::DateVal::month, WXP::Date::set(), WXP::StrLib::subString(), WXP::StrLib::toInt(), and WXP::DateVal::year.
Referenced by read().
int MosFile::getDate | ( | Date & | rdate | ) |
Gets the date of the file
rdate | Date class to put date information |
Referenced by WXP::MosRaw::compute(), and WXP::MosPlot::draw().
const char * MosFile::getModel | ( | ) |
Returns the model name label of open file
References getModel().
Referenced by WXP::MosRaw::compute(), WXP::MosPlot::draw(), and getModel().
|
static |
|
inline |
Returns the latest WMO header
References WXP::WmoParse::getHeader().
int MosFile::init | ( | ) |
|
inline |
Returns true if file open
Referenced by WXP::MosRaw::compute(), and WXP::MosPlot::draw().
int MosFile::open | ( | const char * | file | ) |
int MosFile::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(), WXP::WmoParse::open(), and WMO.
Referenced by WXP::MosRaw::compute(), WXP::MosPlot::draw(), MosFile(), MosFile(), MosFile(), MosFile(), open(), and open().
int MosFile::open | ( | Filename & | file | ) |
int MosFile::open | ( | Filename & | filename, |
int | rtype | ||
) |
Opens the MOS data file
filename | The file name |
rtype | The file type (WMO, BUFR, CDF) |
References WXP::Filename::getDate(), WXP::WmoParse::isOpen(), WXP::WmoParse::open(), and WMO.
int MosFile::read | ( | MosData & | data | ) |
Reads in a single report and populates the MosData class
data | The MosData class to put the data into. |
References AVN, decodeAVN(), decodeGFS(), decodeGFSX(), decodeLAMP(), decodeMRF(), decodeNAM(), decodeNGM(), ETA, WXP::WmoParse::getLine(), GFS, GFSX, WXP::MosData::init(), LAMP, MRF, NAM, NGM, and WMO.
Referenced by WXP::MosRaw::compute(), and WXP::MosPlot::draw().
int MosFile::rewind | ( | ) |
Rewinds the MOS file
References WXP::WmoParse::rewind(), and WMO.
Referenced by WXP::MosPlot::draw().
int MosFile::setModel | ( | const char * | str | ) |
Sets the model name to search for data
str | The mdodel type |
References AVN, ETA, GFS, GFSX, WXP::StrLib::iequal(), LAMP, MRF, NAM, NGM, and setModel().
int MosFile::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 AVN, ETA, GFS, GFSX, LAMP, MRF, NAM, NGM, and WXP::WmoParse::setHeader().
Referenced by WXP::MosRaw::compute(), WXP::MosPlot::draw(), init(), and setModel().