OpenCPN Partial API docs
Loading...
Searching...
No Matches
GribRecord Class Reference

Represents a meteorological data grid from a GRIB (Gridded Binary) file. More...

#include <GribRecord.h>

Inheritance diagram for GribRecord:
GribV1Record GribV2Record

Public Member Functions

 GribRecord (const GribRecord &rec)
 Copy constructor performs a deep copy of the GribRecord.
 
void multiplyAllData (double k)
 
void Substract (const GribRecord &rec, bool positive=true)
 
void Average (const GribRecord &rec)
 
bool isOk () const
 
bool isDataKnown () const
 
bool isEof () const
 
bool isDuplicated () const
 
zuchar getDataType () const
 Returns the type of meteorological parameter stored in this grid.
 
void setDataType (const zuchar t)
 
zuchar getLevelType () const
 Returns the type of vertical level for this grid's data.
 
zuint getLevelValue () const
 Returns the numeric value associated with the level type.
 
zuint getDataCenterModel () const
 Returns the numerical weather prediction model/center that produced this data.
 
zuchar getIdCenter () const
 Returns the originating center ID as defined by WMO (World Meteorological Organization).
 
zuchar getIdModel () const
 Returns the model/process ID within the originating center.
 
zuchar getIdGrid () const
 Returns the grid definition template number.
 
std::string getKey () const
 
int getPeriodP1 () const
 Returns the start of the period (P1) used for this record.
 
int getPeriodP2 () const
 Returns the end of the period (P2) used for this record.
 
zuint getPeriodSec () const
 Returns the forecast period in seconds from reference time.
 
zuchar getTimeRange () const
 Returns the time range indicator that defines how P1 and P2 should be interpreted.
 
int getNi () const
 Returns the number of points in the longitude (i) direction of the grid.
 
int getNj () const
 Returns the number of points in the latitude (j) direction of the grid.
 
double getDi () const
 Returns the grid spacing in longitude (i) direction in degrees.
 
double getDj () const
 Returns the grid spacing in latitude (j) direction in degrees.
 
double getValue (int i, int j) const
 Returns the data value at a specific grid point.
 
void setValue (zuint i, zuint j, double v)
 
double getInterpolatedValue (double px, double py, bool numericalInterpolation=true, bool dir=false) const
 Get spatially interpolated value at exact lat/lon position.
 
double getX (int i) const
 Converts grid index i to longitude in degrees.
 
double getY (int j) const
 Converts grid index j to latitude in degrees.
 
void getXY (int i, int j, double *x, double *y) const
 Converts grid indices to longitude/latitude coordinates.
 
double getLatMin () const
 
double getLonMin () const
 
double getLatMax () const
 
double getLonMax () const
 
bool hasValue (int i, int j) const
 
bool isDefined (int i, int j) const
 
time_t getRecordRefDate () const
 
const char * getStrRecordRefDate () const
 
time_t getRecordCurrentDate () const
 
const char * getStrRecordCurDate () const
 
void setRecordCurrentDate (time_t t)
 
void print ()
 
bool isFilled ()
 
void setFilled (bool val=true)
 

Static Public Member Functions

static GribRecordInterpolatedRecord (const GribRecord &rec1, const GribRecord &rec2, double d, bool dir=false)
 Creates a new GribRecord by temporally interpolating between two time points.
 
static GribRecordInterpolated2DRecord (GribRecord *&rety, const GribRecord &rec1x, const GribRecord &rec1y, const GribRecord &rec2x, const GribRecord &rec2y, double d)
 Creates temporally interpolated records for vector fields (wind, currents).
 
static GribRecordMagnitudeRecord (const GribRecord &rec1, const GribRecord &rec2)
 
static void Polar2UV (GribRecord *pDIR, GribRecord *pSPEED)
 Converts wind or current values from polar (direction/speed) to cartesian (U/V) components.
 
static std::string makeKey (int dataType, int levelType, int levelValue)
 
static bool getInterpolatedValues (double &M, double &A, const GribRecord *GRX, const GribRecord *GRY, double px, double py, bool numericalInterpolation=true)
 Gets spatially interpolated wind or current vector values at a specific latitude/longitude point.
 

Protected Member Functions

time_t makeDate (zuint year, zuint month, zuint day, zuint hour, zuint min, zuint sec)
 

Static Protected Member Functions

static bool GetInterpolatedParameters (const GribRecord &rec1, const GribRecord &rec2, double &La1, double &Lo1, double &La2, double &Lo2, double &Di, double &Dj, int &im1, int &jm1, int &im2, int &jm2, int &Ni, int &Nj, int &rec1offi, int &rec1offj, int &rec2offi, int &rec2offj)
 

Protected Attributes

int id
 Unique identifier for this record.
 
bool ok
 Indicates record validity.
 
bool knownData
 Indicates whether the data type in this record is recognized by the parser.
 
bool waveData
 Differentiates wave-related parameters (height, direction, period) from other meteorological data for specialized processing.
 
bool IsDuplicated
 Indicates if this record was created through copying rather than direct reading.
 
bool eof
 Signals when the end of the GRIB file has been reached during parsing.
 
std::string dataKey
 Unique string identifier constructed from data type, level type, and level value.
 
char strRefDate [32]
 
char strCurDate [32]
 
int dataCenterModel
 Identifies the numerical weather model that produced this data.
 
bool m_bfilled
 Indicates whether the data array has been populated.
 
zuchar editionNumber
 GRIB edition number, indicating the version of the GRIB specification used.
 
zuchar idCenter
 Originating center ID as defined by WMO common table C-1.
 
zuchar idModel
 Model identifier within the originating center.
 
zuchar idGrid
 Grid identifier used by the originating center.
 
zuchar dataType
 Parameter identifier as defined by GRIB tables.
 
zuchar levelType
 Vertical level type indicator.
 
zuint levelValue
 Numeric value associated with levelType.
 
bool hasBMS
 Indicates presence of a bitmap section.
 
zuint refyear
 Components of the reference time for this forecast.
 
zuint refmonth
 
zuint refday
 
zuint refhour
 
zuint refminute
 
zuint periodP1
 Time range indicators for this forecast step.
 
zuint periodP2
 
zuchar timeRange
 Statistical processing indicator.
 
zuint periodsec
 Forecast period in seconds.
 
time_t refDate
 Unix timestamp of model initialization time.
 
time_t curDate
 Unix timestamp of when this forecast is valid.
 
zuchar NV
 
zuchar PV
 
zuchar gridType
 
zuint Ni
 
zuint Nj
 
double La1
 
double Lo1
 Grid origin coordinates.
 
double La2
 
double Lo2
 Grid end coordinates.
 
double latMin
 
double lonMin
 
double latMax
 
double lonMax
 
double Di
 
double Dj
 
zuchar resolFlags
 
zuchar scanFlags
 
bool hasDiDj
 
bool isEarthSpheric
 
bool isUeastVnorth
 
bool isScanIpositive
 
bool isScanJpositive
 
bool isAdjacentI
 
zuint BMSsize
 
zuchar * BMSbits
 
double * data
 

Detailed Description

Represents a meteorological data grid from a GRIB (Gridded Binary) file.

A GribRecord contains a regular latitude/longitude grid of values representing a single meteorological parameter (e.g., wind component, pressure, temperature) at a specific:

  • Time (forecast or analysis time)
  • Vertical level (e.g., surface, pressure level, height above ground)
  • Parameter type (defined by GRIB edition and originating center)

Grid Structure:

  • Origin point (La1, Lo1) and end point (La2, Lo2)
  • Number of points in each direction (Ni, Nj)
  • Grid spacing (Di, Dj)
  • Data array of size Ni × Nj containing values at each grid point

Features:

  • Provides spatial interpolation for points between grid points.
  • Handles vector fields (e.g., wind, currents) with special interpolation for magnitude and direction.
  • Supports bitmap sections for irregular data coverage.
  • Can be created from file data or generated through temporal/spatial interpolation.
  • Derived quantities like wind speed from U/V components.
  • Unit conversions and statistical calculations.

Definition at line 182 of file GribRecord.h.

Constructor & Destructor Documentation

◆ GribRecord() [1/2]

GribRecord::GribRecord ( const GribRecord rec)

Copy constructor performs a deep copy of the GribRecord.

Definition at line 58 of file GribRecord.cpp.

◆ GribRecord() [2/2]

GribRecord::GribRecord ( )
inline

Definition at line 186 of file GribRecord.h.

◆ ~GribRecord()

GribRecord::~GribRecord ( )
virtual

Definition at line 441 of file GribRecord.cpp.

Member Function Documentation

◆ Average()

void GribRecord::Average ( const GribRecord rec)

Definition at line 390 of file GribRecord.cpp.

◆ getDataCenterModel()

zuint GribRecord::getDataCenterModel ( ) const
inline

Returns the numerical weather prediction model/center that produced this data.

Known data centers and models include:

  • NOAA_GFS: NOAA Global Forecast System
  • NOAA_NCEP_WW3: NOAA NCEP Wave Watch III model
  • NOAA_RTOFS: NOAA Real-Time Ocean Forecast System
  • FNMOC_WW3_GLB: US Navy FNMOC global Wave Watch III
  • ECMWF_ERA5: European ECMWF ERA5 reanalysis
  • KNMI_HIRLAM: Netherlands KNMI HIRLAM model
  • OTHER_DATA_CENTER: Other/unknown sources
Returns
Identifier for the data source model as defined in DataCenterModel enum
Note
Different centers may use different parameters, units, grid structures, and update frequencies

Definition at line 348 of file GribRecord.h.

◆ getDataType()

zuchar GribRecord::getDataType ( ) const
inline

Returns the type of meteorological parameter stored in this grid.

Standard meteorological parameters are defined as constants, including:

  • GRB_PRESSURE (2): Atmospheric pressure in Pa
  • GRB_TEMP (11): Temperature in K
  • GRB_WIND_VX (33): West-East wind component in m/s
  • GRB_WIND_VY (34): South-North wind component in m/s
  • GRB_HUMID_REL (52): Relative humidity in %
  • GRB_PRECIP_TOT (61): Total precipitation in l/m2
  • GRB_CLOUD_TOT (71): Total cloud cover in %
Returns
Parameter type identifier as unsigned char
See also
The full list of parameter codes is defined at the top of GribRecord.h
Note
Parameter definitions can vary between GRIB1 and GRIB2 formats

Definition at line 298 of file GribRecord.h.

◆ getDi()

double GribRecord::getDi ( ) const
inline

Returns the grid spacing in longitude (i) direction in degrees.

Returns
Grid spacing in degrees longitude

Definition at line 460 of file GribRecord.h.

◆ getDj()

double GribRecord::getDj ( ) const
inline

Returns the grid spacing in latitude (j) direction in degrees.

Returns
Grid spacing in degrees latitude
Note
Can be negative if grid runs from north to south

Definition at line 467 of file GribRecord.h.

◆ getIdCenter()

zuchar GribRecord::getIdCenter ( ) const
inline

Returns the originating center ID as defined by WMO (World Meteorological Organization).

Standard center IDs include:

  • 7: US National Weather Service (NWS)
  • 34: Japanese Meteorological Agency (JMA)
  • 58: European Centre for Medium-Range Weather Forecasts (ECMWF)
  • 59: German Weather Service (DWD)
  • 85: French Weather Service (Météo-France)
Returns
Center identification code as defined in GRIB Table 0

Definition at line 364 of file GribRecord.h.

◆ getIdGrid()

zuchar GribRecord::getIdGrid ( ) const
inline

Returns the grid definition template number.

Identifies how the grid coordinates are defined, including:

  • Projection type (latitude/longitude, polar stereographic, etc.)
  • Grid point layout and scanning mode
  • Earth shape assumptions
Returns
Grid definition identifier as defined in GRIB specifications

Definition at line 387 of file GribRecord.h.

◆ getIdModel()

zuchar GribRecord::getIdModel ( ) const
inline

Returns the model/process ID within the originating center.

Each center can run multiple forecast models or analysis processes. This ID distinguishes between them (e.g., global vs. regional models). The meaning depends on the center ID.

Returns
Model/process identification number specific to the originating center
See also
getIdCenter()

Definition at line 376 of file GribRecord.h.

◆ GetInterpolatedParameters()

bool GribRecord::GetInterpolatedParameters ( const GribRecord rec1,
const GribRecord rec2,
double &  La1,
double &  Lo1,
double &  La2,
double &  Lo2,
double &  Di,
double &  Dj,
int &  im1,
int &  jm1,
int &  im2,
int &  jm2,
int &  Ni,
int &  Nj,
int &  rec1offi,
int &  rec1offj,
int &  rec2offi,
int &  rec2offj 
)
staticprotected

Definition at line 74 of file GribRecord.cpp.

◆ getInterpolatedValue()

double GribRecord::getInterpolatedValue ( double  px,
double  py,
bool  numericalInterpolation = true,
bool  dir = false 
) const

Get spatially interpolated value at exact lat/lon position.

This method performs specialized vector interpolation for meteorological vector fields like wind or ocean currents.

Parameters
pxLongitude in degrees.
pyLatitude in degrees.
numericalInterpolationUse bilinear interpolation if true.
dirHandle directional interpolation if true (e.g. for wind direction).
Returns
Spatially interpolated value or GRIB_NOTDEF if outside grid.

Definition at line 519 of file GribRecord.cpp.

◆ getInterpolatedValues()

bool GribRecord::getInterpolatedValues ( double &  M,
double &  A,
const GribRecord GRX,
const GribRecord GRY,
double  px,
double  py,
bool  numericalInterpolation = true 
)
static

Gets spatially interpolated wind or current vector values at a specific latitude/longitude point.

Takes X and Y component records and interpolates both magnitude and angle using bilinear interpolation between grid points.

Parameters
M[out] Vector magnitude at the interpolated point (preserves input units). This is the speed or strength of the wind/current, typically measured in meters per second (m/s).
A[out] Vector direction in meteorological degrees at the interpolated point. This is the direction the wind/current is coming FROM, measured in meteorological degrees (0 = North, 90 = East).
GRXX-component record of the vector field (u-component, West-East)
GRYY-component record of the vector field (v-component, South-North)
px[in] Longitude in degrees of the interpolation point.
py[in] Latitude in degrees of the interpolation point.
numericalInterpolationIf true, uses bilinear interpolation; if false, uses nearest neighbor interpolation.
Note
The method expects the input components to follow meteorological conventions where u is positive eastward and v is positive northward

Definition at line 650 of file GribRecord.cpp.

◆ getKey()

std::string GribRecord::getKey ( ) const
inline

Definition at line 390 of file GribRecord.h.

◆ getLatMax()

double GribRecord::getLatMax ( ) const
inline

Definition at line 569 of file GribRecord.h.

◆ getLatMin()

double GribRecord::getLatMin ( ) const
inline

Definition at line 567 of file GribRecord.h.

◆ getLevelType()

zuchar GribRecord::getLevelType ( ) const
inline

Returns the type of vertical level for this grid's data.

Level types define the vertical coordinate system, including:

  • LV_GND_SURF (1): Ground or water surface
  • LV_ISOBARIC (100): Constant pressure surface (e.g. 850 hPa)
  • LV_MSL (102): Mean sea level
  • LV_ABOV_GND (105): Height above ground
  • LV_ABOV_MSL (103): Height above mean sea level
Returns
Level type identifier as unsigned char
See also
levelValue() for the specific value within this level type

Definition at line 315 of file GribRecord.h.

◆ getLevelValue()

zuint GribRecord::getLevelValue ( ) const
inline

Returns the numeric value associated with the level type.

The meaning of this value depends on getLevelType():

  • For LV_ISOBARIC: Pressure in hectoPascals (e.g., 850 for 850 hPa)
  • For LV_ABOV_GND/LV_ABOV_MSL: Height in meters
  • For LV_GND_SURF/LV_MSL: Value is typically 0
Returns
Level value as unsigned int
See also
getLevelType() to determine how to interpret this value

Definition at line 328 of file GribRecord.h.

◆ getLonMax()

double GribRecord::getLonMax ( ) const
inline

Definition at line 570 of file GribRecord.h.

◆ getLonMin()

double GribRecord::getLonMin ( ) const
inline

Definition at line 568 of file GribRecord.h.

◆ getNi()

int GribRecord::getNi ( ) const
inline

Returns the number of points in the longitude (i) direction of the grid.

Returns
Number of grid points along longitude

Definition at line 448 of file GribRecord.h.

◆ getNj()

int GribRecord::getNj ( ) const
inline

Returns the number of points in the latitude (j) direction of the grid.

Returns
Number of grid points along latitude

Definition at line 454 of file GribRecord.h.

◆ getPeriodP1()

int GribRecord::getPeriodP1 ( ) const
inline

Returns the start of the period (P1) used for this record.

The meaning depends on the time range indicator (getTimeRange()):

  • For forecasts: Hours after reference time.
  • For accumulations: Start of accumulation period.
  • For averages: Start of averaging period.
Returns
Period start indicator in units determined by time range.
See also
getTimeRange()

Definition at line 405 of file GribRecord.h.

◆ getPeriodP2()

int GribRecord::getPeriodP2 ( ) const
inline

Returns the end of the period (P2) used for this record.

The meaning depends on the time range indicator (getTimeRange()):

  • For forecasts: Usually same as P1
  • For accumulations: End of accumulation period
  • For averages: End of averaging period
Returns
Period end indicator in units determined by time range
See also
getTimeRange()

Definition at line 417 of file GribRecord.h.

◆ getPeriodSec()

zuint GribRecord::getPeriodSec ( ) const
inline

Returns the forecast period in seconds from reference time.

This is the time offset from the model reference time (analysis time) when this data is valid.

Returns
Time offset in seconds from reference time.
See also
getRecordRefDate()

Definition at line 427 of file GribRecord.h.

◆ getRecordCurrentDate()

time_t GribRecord::getRecordCurrentDate ( ) const
inline

Definition at line 584 of file GribRecord.h.

◆ getRecordRefDate()

time_t GribRecord::getRecordRefDate ( ) const
inline

Definition at line 580 of file GribRecord.h.

◆ getStrRecordCurDate()

const char * GribRecord::getStrRecordCurDate ( ) const
inline

Definition at line 585 of file GribRecord.h.

◆ getStrRecordRefDate()

const char * GribRecord::getStrRecordRefDate ( ) const
inline

Definition at line 581 of file GribRecord.h.

◆ getTimeRange()

zuchar GribRecord::getTimeRange ( ) const
inline

Returns the time range indicator that defines how P1 and P2 should be interpreted.

Common values include:

  • 0: Product valid at reference time + P1
  • 1: Product valid for reference time + P1 to reference time + P2
  • 2: Product averaged from reference time + P1 to reference time + P2
  • 4: Product accumulated from reference time + P1 to reference time + P2
Returns
Time range indicator as defined in GRIB specifications

Definition at line 440 of file GribRecord.h.

◆ getValue()

double GribRecord::getValue ( int  i,
int  j 
) const
inline

Returns the data value at a specific grid point.

The grid is stored as a one-dimensional array in row-major order (longitude varies fastest).

Parameters
iIndex in longitude direction (0 to Ni-1)
jIndex in latitude direction (0 to Nj-1)
Returns
Data value at grid point (i,j)
Note
No bounds checking is performed

Definition at line 480 of file GribRecord.h.

◆ getX()

double GribRecord::getX ( int  i) const
inline

Converts grid index i to longitude in degrees.

Uses the grid's origin (Lo1) and spacing (Di) to convert from grid index to geographic coordinate.

Parameters
iGrid index in longitude direction (0 to Ni-1)
Returns
Longitude in degrees

Definition at line 540 of file GribRecord.h.

◆ getXY()

void GribRecord::getXY ( int  i,
int  j,
double *  x,
double *  y 
) const
inline

Converts grid indices to longitude/latitude coordinates.

Convenience method that performs both X and Y conversions.

Parameters
iGrid index in longitude direction
jGrid index in latitude direction
[out]xPointer to store longitude in degrees
[out]yPointer to store latitude in degrees

Definition at line 562 of file GribRecord.h.

◆ getY()

double GribRecord::getY ( int  j) const
inline

Converts grid index j to latitude in degrees.

Uses the grid's origin (La1) and spacing (Dj) to convert from grid index to geographic coordinate.

Parameters
jGrid index in latitude direction (0 to Nj-1)
Returns
Latitude in degrees
Note
Returns decreasing latitudes when Dj is negative

Definition at line 551 of file GribRecord.h.

◆ hasValue()

bool GribRecord::hasValue ( int  i,
int  j 
) const
inline

Definition at line 776 of file GribRecord.h.

◆ Interpolated2DRecord()

GribRecord * GribRecord::Interpolated2DRecord ( GribRecord *&  rety,
const GribRecord rec1x,
const GribRecord rec1y,
const GribRecord rec2x,
const GribRecord rec2y,
double  d 
)
static

Creates temporally interpolated records for vector fields (wind, currents).

Unlike scalar interpolation, vector fields require both X and Y components to be interpolated together to preserve the vector characteristics. This method:

  1. Converts X,Y components to magnitude and direction at each grid point/
  2. Interpolates magnitude linearly between times.
  3. Interpolates direction using proper angular interpolation.
  4. Converts back to X,Y components.
Parameters
rety[out] Pointer to store interpolated Y-component record
rec1xX-component record at earlier time t1 (e.g., wind u-component)
rec1yY-component record at earlier time t1 (e.g., wind v-component)
rec2xX-component record at later time t2
rec2yY-component record at later time t2
dInterpolation factor between [0,1] where:
  • 0 returns values from time t1
  • 1 returns values from time t2
Returns
Pointer to interpolated X-component record, or NULL if:
  • Input records have mismatched grids
  • Any input record is invalid
  • Memory allocation fails

Definition at line 228 of file GribRecord.cpp.

◆ InterpolatedRecord()

GribRecord * GribRecord::InterpolatedRecord ( const GribRecord rec1,
const GribRecord rec2,
double  d,
bool  dir = false 
)
static

Creates a new GribRecord by temporally interpolating between two time points.

Performs linear interpolation between two GribRecords that:

  • Represent the same parameter (e.g., temperature, pressure).
  • Have the same grid structure.
  • Exist at different times.

The interpolation is done value-by-value across the entire grid using:

  • Linear interpolation for scalar values
  • Angular interpolation for directional values (when dir=true) to properly handle the 0°/360° wrapping
Parameters
rec1GribRecord at earlier time t1
rec2GribRecord at later time t2
dInterpolation factor between [0,1] where:
  • 0 means use values from rec1
  • 1 means use values from rec2
  • 0.5 means halfway between rec1 and rec2
dirIf true, treats values as angles in degrees and uses proper angular interpolation (e.g., for wind direction)
Returns
New GribRecord containing the interpolated values, or NULL if:
  • Input records have different grid structures
  • Input records are invalid
  • Memory allocation fails
Note
For vector fields (e.g., wind, currents), use Interpolated2DRecord() instead to properly handle both components together

Definition at line 159 of file GribRecord.cpp.

◆ isDataKnown()

bool GribRecord::isDataKnown ( ) const
inline

Definition at line 278 of file GribRecord.h.

◆ isDefined()

bool GribRecord::isDefined ( int  i,
int  j 
) const
inline

Definition at line 575 of file GribRecord.h.

◆ isDuplicated()

bool GribRecord::isDuplicated ( ) const
inline

Definition at line 280 of file GribRecord.h.

◆ isEof()

bool GribRecord::isEof ( ) const
inline

Definition at line 279 of file GribRecord.h.

◆ isFilled()

bool GribRecord::isFilled ( )
inline

Definition at line 588 of file GribRecord.h.

◆ isOk()

bool GribRecord::isOk ( ) const
inline

Definition at line 277 of file GribRecord.h.

◆ MagnitudeRecord()

GribRecord * GribRecord::MagnitudeRecord ( const GribRecord rec1,
const GribRecord rec2 
)
static

Definition at line 313 of file GribRecord.cpp.

◆ makeDate()

time_t GribRecord::makeDate ( zuint  year,
zuint  month,
zuint  day,
zuint  hour,
zuint  min,
zuint  sec 
)
protected

Definition at line 488 of file GribRecord.cpp.

◆ makeKey()

std::string GribRecord::makeKey ( int  dataType,
int  levelType,
int  levelValue 
)
static

Definition at line 429 of file GribRecord.cpp.

◆ multiplyAllData()

void GribRecord::multiplyAllData ( double  k)

Definition at line 456 of file GribRecord.cpp.

◆ Polar2UV()

void GribRecord::Polar2UV ( GribRecord pDIR,
GribRecord pSPEED 
)
static

Converts wind or current values from polar (direction/speed) to cartesian (U/V) components.

U component represents East/West velocity (positive = eastward) V component represents North/South velocity (positive = northward)

Parameters
pDIRDirection record in meteorological degrees (0 = N, 90 = E).
pSPEEDSpeed record (units preserved).
Note
Modifies input records: pDIR becomes U component, pSPEED becomes V component.

Definition at line 340 of file GribRecord.cpp.

◆ print()

void GribRecord::print ( )

Definition at line 47 of file GribRecord.cpp.

◆ setDataType()

void GribRecord::setDataType ( const zuchar  t)

Definition at line 424 of file GribRecord.cpp.

◆ setFilled()

void GribRecord::setFilled ( bool  val = true)
inline

Definition at line 589 of file GribRecord.h.

◆ setRecordCurrentDate()

void GribRecord::setRecordCurrentDate ( time_t  t)

Definition at line 469 of file GribRecord.cpp.

◆ setValue()

void GribRecord::setValue ( zuint  i,
zuint  j,
double  v 
)
inline

Definition at line 482 of file GribRecord.h.

◆ Substract()

void GribRecord::Substract ( const GribRecord rec,
bool  positive = true 
)

Definition at line 362 of file GribRecord.cpp.

Member Data Documentation

◆ BMSbits

zuchar* GribRecord::BMSbits
protected

Definition at line 764 of file GribRecord.h.

◆ BMSsize

zuint GribRecord::BMSsize
protected

Definition at line 763 of file GribRecord.h.

◆ curDate

time_t GribRecord::curDate
protected

Unix timestamp of when this forecast is valid.

Definition at line 746 of file GribRecord.h.

◆ data

double* GribRecord::data
protected

Definition at line 766 of file GribRecord.h.

◆ dataCenterModel

int GribRecord::dataCenterModel
protected

Identifies the numerical weather model that produced this data.

Standard WMO values from GRIB2 Table C-11 include:

  • 7: US National Weather Service, National Centers for Environmental Prediction (NCEP)
  • 34: Japanese Meteorological Agency - Tokyo (JMA)
  • 58: European Centre for Medium-Range Weather Forecasts (ECMWF)
  • 59: DWD (German Weather Service)
  • 85: French Weather Service (Meteo France)
  • 251: Norwegian Meteorological Institute

Definition at line 663 of file GribRecord.h.

◆ dataKey

std::string GribRecord::dataKey
protected

Unique string identifier constructed from data type, level type, and level value.

Used for record lookup and comparison.

Definition at line 648 of file GribRecord.h.

◆ dataType

zuchar GribRecord::dataType
protected

Parameter identifier as defined by GRIB tables.

Specifies what physical quantity is represented (wind, temperature, etc).

Definition at line 699 of file GribRecord.h.

◆ Di

double GribRecord::Di
protected

Definition at line 754 of file GribRecord.h.

◆ Dj

double GribRecord::Dj
protected

Definition at line 754 of file GribRecord.h.

◆ editionNumber

zuchar GribRecord::editionNumber
protected

GRIB edition number, indicating the version of the GRIB specification used.

Determines how subsequent sections should be parsed.

Definition at line 677 of file GribRecord.h.

◆ eof

bool GribRecord::eof
protected

Signals when the end of the GRIB file has been reached during parsing.

Definition at line 643 of file GribRecord.h.

◆ gridType

zuchar GribRecord::gridType
protected

Definition at line 749 of file GribRecord.h.

◆ hasBMS

bool GribRecord::hasBMS
protected

Indicates presence of a bitmap section.

When true, the data section uses a bitmap to indicate valid data points.

Definition at line 716 of file GribRecord.h.

◆ hasDiDj

bool GribRecord::hasDiDj
protected

Definition at line 756 of file GribRecord.h.

◆ id

int GribRecord::id
protected

Unique identifier for this record.

Set during file reading for original records. Monotonically increasing for records read from file.

Definition at line 613 of file GribRecord.h.

◆ idCenter

zuchar GribRecord::idCenter
protected

Originating center ID as defined by WMO common table C-1.

Identifies which meteorological center generated the forecast.

Definition at line 684 of file GribRecord.h.

◆ idGrid

zuchar GribRecord::idGrid
protected

Grid identifier used by the originating center.

Specifies the coordinate system and projection of the data grid.

Definition at line 694 of file GribRecord.h.

◆ idModel

zuchar GribRecord::idModel
protected

Model identifier within the originating center.

Distinguishes between different forecast models run by the same center.

Definition at line 689 of file GribRecord.h.

◆ isAdjacentI

bool GribRecord::isAdjacentI
protected

Definition at line 761 of file GribRecord.h.

◆ IsDuplicated

bool GribRecord::IsDuplicated
protected

Indicates if this record was created through copying rather than direct reading.

Tracks whether this record was copied to maintain data continuity. This happens with wave data gaps or initial values for cumulative parameters.

Definition at line 639 of file GribRecord.h.

◆ isEarthSpheric

bool GribRecord::isEarthSpheric
protected

Definition at line 757 of file GribRecord.h.

◆ isScanIpositive

bool GribRecord::isScanIpositive
protected

Definition at line 759 of file GribRecord.h.

◆ isScanJpositive

bool GribRecord::isScanJpositive
protected

Definition at line 760 of file GribRecord.h.

◆ isUeastVnorth

bool GribRecord::isUeastVnorth
protected

Definition at line 758 of file GribRecord.h.

◆ knownData

bool GribRecord::knownData
protected

Indicates whether the data type in this record is recognized by the parser.

Used to skip unknown data types during processing.

Definition at line 626 of file GribRecord.h.

◆ La1

double GribRecord::La1
protected

Definition at line 751 of file GribRecord.h.

◆ La2

double GribRecord::La2
protected

Definition at line 752 of file GribRecord.h.

◆ latMax

double GribRecord::latMax
protected

Definition at line 753 of file GribRecord.h.

◆ latMin

double GribRecord::latMin
protected

Definition at line 753 of file GribRecord.h.

◆ levelType

zuchar GribRecord::levelType
protected

Vertical level type indicator.

Specifies the type of vertical coordinate (pressure level, height above ground, etc).

Definition at line 705 of file GribRecord.h.

◆ levelValue

zuint GribRecord::levelValue
protected

Numeric value associated with levelType.

For example, the specific pressure level in hectopascals.

Definition at line 710 of file GribRecord.h.

◆ Lo1

double GribRecord::Lo1
protected

Grid origin coordinates.

Definition at line 751 of file GribRecord.h.

◆ Lo2

double GribRecord::Lo2
protected

Grid end coordinates.

Definition at line 752 of file GribRecord.h.

◆ lonMax

double GribRecord::lonMax
protected

Definition at line 753 of file GribRecord.h.

◆ lonMin

double GribRecord::lonMin
protected

Definition at line 753 of file GribRecord.h.

◆ m_bfilled

bool GribRecord::m_bfilled
protected

Indicates whether the data array has been populated.

Used to track partial loading states during record construction.

Definition at line 668 of file GribRecord.h.

◆ Ni

zuint GribRecord::Ni
protected

Definition at line 750 of file GribRecord.h.

◆ Nj

zuint GribRecord::Nj
protected

Definition at line 750 of file GribRecord.h.

◆ NV

zuchar GribRecord::NV
protected

Definition at line 748 of file GribRecord.h.

◆ ok

bool GribRecord::ok
protected

Indicates record validity.

A record may be invalid if source records have mismatched dimensions, missing data arrays, failed interpolation, or the source records themselves are invalid when creating derived records.

Definition at line 621 of file GribRecord.h.

◆ periodP1

zuint GribRecord::periodP1
protected

Time range indicators for this forecast step.

Used to calculate the valid time period for this data.

Definition at line 727 of file GribRecord.h.

◆ periodP2

zuint GribRecord::periodP2
protected

Definition at line 727 of file GribRecord.h.

◆ periodsec

zuint GribRecord::periodsec
protected

Forecast period in seconds.

Time offset from the reference time.

Definition at line 738 of file GribRecord.h.

◆ PV

zuchar GribRecord::PV
protected

Definition at line 748 of file GribRecord.h.

◆ refDate

time_t GribRecord::refDate
protected

Unix timestamp of model initialization time.

Definition at line 742 of file GribRecord.h.

◆ refday

zuint GribRecord::refday
protected

Definition at line 721 of file GribRecord.h.

◆ refhour

zuint GribRecord::refhour
protected

Definition at line 721 of file GribRecord.h.

◆ refminute

zuint GribRecord::refminute
protected

Definition at line 721 of file GribRecord.h.

◆ refmonth

zuint GribRecord::refmonth
protected

Definition at line 721 of file GribRecord.h.

◆ refyear

zuint GribRecord::refyear
protected

Components of the reference time for this forecast.

Specifies when the forecast model was initialized.

Definition at line 721 of file GribRecord.h.

◆ resolFlags

zuchar GribRecord::resolFlags
protected

Definition at line 755 of file GribRecord.h.

◆ scanFlags

zuchar GribRecord::scanFlags
protected

Definition at line 755 of file GribRecord.h.

◆ strCurDate

char GribRecord::strCurDate[32]
protected

Definition at line 650 of file GribRecord.h.

◆ strRefDate

char GribRecord::strRefDate[32]
protected

Definition at line 649 of file GribRecord.h.

◆ timeRange

zuchar GribRecord::timeRange
protected

Statistical processing indicator.

Describes how the data was processed over time (e.g., accumulation, average).

Definition at line 733 of file GribRecord.h.

◆ waveData

bool GribRecord::waveData
protected

Differentiates wave-related parameters (height, direction, period) from other meteorological data for specialized processing.

Definition at line 631 of file GribRecord.h.


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