Parallel Analog Ensemble
Public Member Functions | Static Public Attributes | Private Attributes | Friends | List of all members
ParameterGrib Class Reference

ParameterGrib stores parameter information including the extra information, e.g. ID, variable level, and the type of variable level. These information is very helpful when locating a specific variable in a Grib2 format file. More...

#include <ParameterGrib.h>

Inheritance diagram for ParameterGrib:
Parameter

Public Member Functions

 ParameterGrib ()
 
 ParameterGrib (const ParameterGrib &)
 
 ParameterGrib (string name, bool circular=Config::_CIRCULAR, long id=0, long level=0, std::string level_type="UNDEFINED")
 
virtual ~ParameterGrib ()
 
long getId () const
 
long getLevel () const
 
std::string getLevelType () const
 
ParameterGriboperator= (const ParameterGrib &)
 
bool operator< (const ParameterGrib &) const
 
void print (std::ostream &) const
 
- Public Member Functions inherited from Parameter
 Parameter ()
 
 Parameter (const Parameter &other)
 
 Parameter (std::string name, bool circular=Config::_CIRCULAR)
 
virtual ~Parameter ()
 
Parameteroperator= (const Parameter &rhs)
 
bool operator== (const Parameter &rhs) const
 
bool operator< (const Parameter &right) const
 
void setName (std::string)
 
void setCircular (bool)
 
std::string getName () const
 
bool getCircular () const
 
void print (std::ostream &) const
 

Static Public Attributes

static const std::string _key_id = "parameter"
 
static const std::string _key_level = "level"
 
static const std::string _key_level_type = "typeOfLevel"
 
static const std::string _key_values = "values"
 

Private Attributes

long id_
 
long level_
 
std::string level_type_
 

Friends

std::ostream & operator<< (std::ostream &, ParameterGrib const &)
 

Detailed Description

ParameterGrib stores parameter information including the extra information, e.g. ID, variable level, and the type of variable level. These information is very helpful when locating a specific variable in a Grib2 format file.

To find any supported variables, please use the database provided by ECMWF Eccodes:

https://apps.ecmwf.int/codes/grib/param-db/

To find the associated arguments for a variable, first identify the variable ID from the database, and then use the following eccodes commandline tool to find out what the level and the type of level are. For example, for the following variable,

https://apps.ecmwf.int/codes/grib/param-db/?id=132

the variable ID is 132. To show all the levels and types of levels contained in a specific file, you can use the command line tool:

$ grib_ls -w paramId=132 -p paramId,level,typeOfLevel,shortName,name nam_218_20160101_0000_000.grb2 nam_218_20160101_0000_000.grb2 paramId level typeOfLevel shortName name
132 50 isobaricInhPa v V component of wind 132 75 isobaricInhPa v V component of wind 132 100 isobaricInhPa v V component of wind 132 125 isobaricInhPa v V component of wind 132 150 isobaricInhPa v V component of wind 132 175 isobaricInhPa v V component of wind 132 200 isobaricInhPa v V component of wind 132 225 isobaricInhPa v V component of wind 132 250 isobaricInhPa v V component of wind 132 275 isobaricInhPa v V component of wind 132 300 isobaricInhPa v V component of wind 132 325 isobaricInhPa v V component of wind 132 350 isobaricInhPa v V component of wind 132 375 isobaricInhPa v V component of wind 132 400 isobaricInhPa v V component of wind 132 425 isobaricInhPa v V component of wind 132 450 isobaricInhPa v V component of wind 132 475 isobaricInhPa v V component of wind 132 500 isobaricInhPa v V component of wind 132 525 isobaricInhPa v V component of wind 132 550 isobaricInhPa v V component of wind 132 575 isobaricInhPa v V component of wind 132 600 isobaricInhPa v V component of wind 132 625 isobaricInhPa v V component of wind 132 650 isobaricInhPa v V component of wind 132 675 isobaricInhPa v V component of wind 132 700 isobaricInhPa v V component of wind 132 725 isobaricInhPa v V component of wind 132 750 isobaricInhPa v V component of wind 132 775 isobaricInhPa v V component of wind 132 800 isobaricInhPa v V component of wind 132 825 isobaricInhPa v V component of wind 132 850 isobaricInhPa v V component of wind 132 875 isobaricInhPa v V component of wind 132 900 isobaricInhPa v V component of wind 132 925 isobaricInhPa v V component of wind 132 950 isobaricInhPa v V component of wind 132 975 isobaricInhPa v V component of wind 132 1000 isobaricInhPa v V component of wind 132 3000 pressureFromGroundLayer v V component of wind 132 6000 pressureFromGroundLayer v V component of wind 132 9000 pressureFromGroundLayer v V component of wind 132 12000 pressureFromGroundLayer v V component of wind 132 15000 pressureFromGroundLayer v V component of wind 132 18000 pressureFromGroundLayer v V component of wind 132 0 tropopause v V component of wind 132 0 maxWind v V component of wind 132 0 unknown v V component of wind 132 80 heightAboveGround v V component of wind 49 of 445 messages in nam_218_20160101_0000_000.grb2

49 of 445 total messages in 1 files

In this way, you can locate any variables by a combination of variable ID, level, and the type of the variable level.

If you want to find some quick test data files, you can access them here.

https://github.com/Weiming-Hu/AnalogsEnsemble/tree/master/tests/Data

Constructor & Destructor Documentation

◆ ParameterGrib() [1/3]

ParameterGrib::ParameterGrib ( )

◆ ParameterGrib() [2/3]

ParameterGrib::ParameterGrib ( const ParameterGrib orig)

◆ ParameterGrib() [3/3]

ParameterGrib::ParameterGrib ( string  name,
bool  circular = Config::_CIRCULAR,
long  id = 0,
long  level = 0,
std::string  level_type = "UNDEFINED" 
)

◆ ~ParameterGrib()

ParameterGrib::~ParameterGrib ( )
virtual

Member Function Documentation

◆ getId()

long ParameterGrib::getId ( ) const

◆ getLevel()

long ParameterGrib::getLevel ( ) const

◆ getLevelType()

string ParameterGrib::getLevelType ( ) const

◆ operator<()

bool ParameterGrib::operator< ( const ParameterGrib rhs) const

◆ operator=()

ParameterGrib & ParameterGrib::operator= ( const ParameterGrib rhs)

◆ print()

void ParameterGrib::print ( std::ostream &  os) const

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  ,
ParameterGrib const &   
)
friend

Member Data Documentation

◆ _key_id

const string ParameterGrib::_key_id = "parameter"
static

◆ _key_level

const string ParameterGrib::_key_level = "level"
static

◆ _key_level_type

const string ParameterGrib::_key_level_type = "typeOfLevel"
static

◆ _key_values

const string ParameterGrib::_key_values = "values"
static

◆ id_

long ParameterGrib::id_
private

◆ level_

long ParameterGrib::level_
private

◆ level_type_

std::string ParameterGrib::level_type_
private

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