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

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

#include <grib_record.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 (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 () const
 
bool IsFilled () const
 
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 known_data
 Indicates whether the data type in this record is recognized by the parser.
 
bool wave_data
 Differentiates wave-related parameters (height, direction, period) from other meteorological data for specialized processing.
 
bool is_duplicated
 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 data_key
 Unique string identifier constructed from data type, level type, and level value.
 
char str_ref_date [32]
 
char str_cur_date [32]
 
int data_center_model
 Identifies the numerical weather model that produced this data.
 
bool is_filled
 Indicates whether the data array has been populated.
 
zuchar edition_number
 GRIB edition number, indicating the version of the GRIB specification used.
 
zuchar id_center
 Originating center ID as defined by WMO common table C-1.
 
zuchar id_model
 Model identifier within the originating center.
 
zuchar id_grid
 Grid identifier used by the originating center.
 
zuchar data_type
 Parameter identifier as defined by GRIB tables.
 
zuchar level_type
 Vertical level type indicator.
 
zuint level_value
 Numeric value associated with level_type.
 
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 period_p1
 Time range indicators for this forecast step.
 
zuint period_p2
 
zuchar time_range
 Statistical processing indicator.
 
zuint periodsec
 Forecast period in seconds.
 
time_t ref_date
 Unix timestamp of model initialization time.
 
time_t cur_date
 Unix timestamp of when this forecast is valid.
 
zuchar NV
 
zuchar PV
 
zuchar grid_type
 
zuint Ni
 
zuint Nj
 
double La1
 
double Lo1
 Grid origin coordinates.
 
double La2
 
double Lo2
 Grid end coordinates.
 
double lat_min
 
double lon_min
 
double lat_max
 
double lon_max
 
double Di
 
double Dj
 
zuchar resol_flags
 
zuchar scan_flags
 
bool has_di_dj
 
bool is_earth_spheric
 
bool is_ueast_vnorth
 
bool is_scan_i_positive
 
bool is_scan_j_positive
 
bool is_adjacent_i
 
zuint bms_size
 
zuchar * bms_bits
 
double * data
 

Detailed Description

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 186 of file grib_record.h.

Constructor & Destructor Documentation

◆ GribRecord() [1/2]

GribRecord::GribRecord ( const GribRecord rec)

Copy constructor performs a deep copy of the GribRecord.

Definition at line 61 of file grib_record.cpp.

◆ GribRecord() [2/2]

GribRecord::GribRecord ( )
inline

Definition at line 190 of file grib_record.h.

◆ ~GribRecord()

GribRecord::~GribRecord ( )
virtual

Definition at line 445 of file grib_record.cpp.

Member Function Documentation

◆ Average()

void GribRecord::Average ( const GribRecord rec)

Definition at line 394 of file grib_record.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 352 of file grib_record.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 302 of file grib_record.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 464 of file grib_record.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 471 of file grib_record.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 368 of file grib_record.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 391 of file grib_record.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 380 of file grib_record.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 77 of file grib_record.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 523 of file grib_record.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 654 of file grib_record.cpp.

◆ GetKey()

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

Definition at line 394 of file grib_record.h.

◆ GetLatMax()

double GribRecord::GetLatMax ( ) const
inline

Definition at line 573 of file grib_record.h.

◆ GetLatMin()

double GribRecord::GetLatMin ( ) const
inline

Definition at line 571 of file grib_record.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 319 of file grib_record.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 332 of file grib_record.h.

◆ GetLonMax()

double GribRecord::GetLonMax ( ) const
inline

Definition at line 574 of file grib_record.h.

◆ GetLonMin()

double GribRecord::GetLonMin ( ) const
inline

Definition at line 572 of file grib_record.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 452 of file grib_record.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 458 of file grib_record.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 409 of file grib_record.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 421 of file grib_record.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 431 of file grib_record.h.

◆ GetRecordCurrentDate()

time_t GribRecord::GetRecordCurrentDate ( ) const
inline

Definition at line 588 of file grib_record.h.

◆ GetRecordRefDate()

time_t GribRecord::GetRecordRefDate ( ) const
inline

Definition at line 584 of file grib_record.h.

◆ GetStrRecordCurDate()

const char * GribRecord::GetStrRecordCurDate ( ) const
inline

Definition at line 589 of file grib_record.h.

◆ GetStrRecordRefDate()

const char * GribRecord::GetStrRecordRefDate ( ) const
inline

Definition at line 585 of file grib_record.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 444 of file grib_record.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 484 of file grib_record.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 544 of file grib_record.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 566 of file grib_record.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 555 of file grib_record.h.

◆ HasValue()

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

Definition at line 780 of file grib_record.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 232 of file grib_record.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 163 of file grib_record.cpp.

◆ IsDataKnown()

bool GribRecord::IsDataKnown ( ) const
inline

Definition at line 282 of file grib_record.h.

◆ IsDefined()

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

Definition at line 579 of file grib_record.h.

◆ isDuplicated()

bool GribRecord::isDuplicated ( ) const
inline

Definition at line 284 of file grib_record.h.

◆ IsEof()

bool GribRecord::IsEof ( ) const
inline

Definition at line 283 of file grib_record.h.

◆ IsFilled()

bool GribRecord::IsFilled ( ) const
inline

Definition at line 592 of file grib_record.h.

◆ IsOk()

bool GribRecord::IsOk ( ) const
inline

Definition at line 281 of file grib_record.h.

◆ MagnitudeRecord()

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

Definition at line 317 of file grib_record.cpp.

◆ MakeDate()

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

Definition at line 492 of file grib_record.cpp.

◆ MakeKey()

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

Definition at line 433 of file grib_record.cpp.

◆ multiplyAllData()

void GribRecord::multiplyAllData ( double  k)

Definition at line 460 of file grib_record.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 344 of file grib_record.cpp.

◆ Print()

void GribRecord::Print ( ) const

Definition at line 50 of file grib_record.cpp.

◆ SetDataType()

void GribRecord::SetDataType ( zuchar  t)

Definition at line 428 of file grib_record.cpp.

◆ SetFilled()

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

Definition at line 593 of file grib_record.h.

◆ SetRecordCurrentDate()

void GribRecord::SetRecordCurrentDate ( time_t  t)

Definition at line 473 of file grib_record.cpp.

◆ SetValue()

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

Definition at line 486 of file grib_record.h.

◆ Substract()

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

Definition at line 366 of file grib_record.cpp.

Member Data Documentation

◆ bms_bits

zuchar* GribRecord::bms_bits
protected

Definition at line 768 of file grib_record.h.

◆ bms_size

zuint GribRecord::bms_size
protected

Definition at line 767 of file grib_record.h.

◆ cur_date

time_t GribRecord::cur_date
protected

Unix timestamp of when this forecast is valid.

Definition at line 750 of file grib_record.h.

◆ data

double* GribRecord::data
protected

Definition at line 770 of file grib_record.h.

◆ data_center_model

int GribRecord::data_center_model
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 667 of file grib_record.h.

◆ data_key

std::string GribRecord::data_key
protected

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

Used for record lookup and comparison.

Definition at line 652 of file grib_record.h.

◆ data_type

zuchar GribRecord::data_type
protected

Parameter identifier as defined by GRIB tables.

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

Definition at line 703 of file grib_record.h.

◆ Di

double GribRecord::Di
protected

Definition at line 758 of file grib_record.h.

◆ Dj

double GribRecord::Dj
protected

Definition at line 758 of file grib_record.h.

◆ edition_number

zuchar GribRecord::edition_number
protected

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

Determines how subsequent sections should be parsed.

Definition at line 681 of file grib_record.h.

◆ eof

bool GribRecord::eof
protected

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

Definition at line 647 of file grib_record.h.

◆ grid_type

zuchar GribRecord::grid_type
protected

Definition at line 753 of file grib_record.h.

◆ has_di_dj

bool GribRecord::has_di_dj
protected

Definition at line 760 of file grib_record.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 720 of file grib_record.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 617 of file grib_record.h.

◆ id_center

zuchar GribRecord::id_center
protected

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

Identifies which meteorological center generated the forecast.

Definition at line 688 of file grib_record.h.

◆ id_grid

zuchar GribRecord::id_grid
protected

Grid identifier used by the originating center.

Specifies the coordinate system and projection of the data grid.

Definition at line 698 of file grib_record.h.

◆ id_model

zuchar GribRecord::id_model
protected

Model identifier within the originating center.

Distinguishes between different forecast models run by the same center.

Definition at line 693 of file grib_record.h.

◆ is_adjacent_i

bool GribRecord::is_adjacent_i
protected

Definition at line 765 of file grib_record.h.

◆ is_duplicated

bool GribRecord::is_duplicated
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 643 of file grib_record.h.

◆ is_earth_spheric

bool GribRecord::is_earth_spheric
protected

Definition at line 761 of file grib_record.h.

◆ is_filled

bool GribRecord::is_filled
protected

Indicates whether the data array has been populated.

Used to track partial loading states during record construction.

Definition at line 672 of file grib_record.h.

◆ is_scan_i_positive

bool GribRecord::is_scan_i_positive
protected

Definition at line 763 of file grib_record.h.

◆ is_scan_j_positive

bool GribRecord::is_scan_j_positive
protected

Definition at line 764 of file grib_record.h.

◆ is_ueast_vnorth

bool GribRecord::is_ueast_vnorth
protected

Definition at line 762 of file grib_record.h.

◆ known_data

bool GribRecord::known_data
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 630 of file grib_record.h.

◆ La1

double GribRecord::La1
protected

Definition at line 755 of file grib_record.h.

◆ La2

double GribRecord::La2
protected

Definition at line 756 of file grib_record.h.

◆ lat_max

double GribRecord::lat_max
protected

Definition at line 757 of file grib_record.h.

◆ lat_min

double GribRecord::lat_min
protected

Definition at line 757 of file grib_record.h.

◆ level_type

zuchar GribRecord::level_type
protected

Vertical level type indicator.

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

Definition at line 709 of file grib_record.h.

◆ level_value

zuint GribRecord::level_value
protected

Numeric value associated with level_type.

For example, the specific pressure level in hectopascals.

Definition at line 714 of file grib_record.h.

◆ Lo1

double GribRecord::Lo1
protected

Grid origin coordinates.

Definition at line 755 of file grib_record.h.

◆ Lo2

double GribRecord::Lo2
protected

Grid end coordinates.

Definition at line 756 of file grib_record.h.

◆ lon_max

double GribRecord::lon_max
protected

Definition at line 757 of file grib_record.h.

◆ lon_min

double GribRecord::lon_min
protected

Definition at line 757 of file grib_record.h.

◆ Ni

zuint GribRecord::Ni
protected

Definition at line 754 of file grib_record.h.

◆ Nj

zuint GribRecord::Nj
protected

Definition at line 754 of file grib_record.h.

◆ NV

zuchar GribRecord::NV
protected

Definition at line 752 of file grib_record.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 625 of file grib_record.h.

◆ period_p1

zuint GribRecord::period_p1
protected

Time range indicators for this forecast step.

Used to calculate the valid time period for this data.

Definition at line 731 of file grib_record.h.

◆ period_p2

zuint GribRecord::period_p2
protected

Definition at line 731 of file grib_record.h.

◆ periodsec

zuint GribRecord::periodsec
protected

Forecast period in seconds.

Time offset from the reference time.

Definition at line 742 of file grib_record.h.

◆ PV

zuchar GribRecord::PV
protected

Definition at line 752 of file grib_record.h.

◆ ref_date

time_t GribRecord::ref_date
protected

Unix timestamp of model initialization time.

Definition at line 746 of file grib_record.h.

◆ refday

zuint GribRecord::refday
protected

Definition at line 725 of file grib_record.h.

◆ refhour

zuint GribRecord::refhour
protected

Definition at line 725 of file grib_record.h.

◆ refminute

zuint GribRecord::refminute
protected

Definition at line 725 of file grib_record.h.

◆ refmonth

zuint GribRecord::refmonth
protected

Definition at line 725 of file grib_record.h.

◆ refyear

zuint GribRecord::refyear
protected

Components of the reference time for this forecast.

Specifies when the forecast model was initialized.

Definition at line 725 of file grib_record.h.

◆ resol_flags

zuchar GribRecord::resol_flags
protected

Definition at line 759 of file grib_record.h.

◆ scan_flags

zuchar GribRecord::scan_flags
protected

Definition at line 759 of file grib_record.h.

◆ str_cur_date

char GribRecord::str_cur_date[32]
protected

Definition at line 654 of file grib_record.h.

◆ str_ref_date

char GribRecord::str_ref_date[32]
protected

Definition at line 653 of file grib_record.h.

◆ time_range

zuchar GribRecord::time_range
protected

Statistical processing indicator.

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

Definition at line 737 of file grib_record.h.

◆ wave_data

bool GribRecord::wave_data
protected

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

Definition at line 635 of file grib_record.h.


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