Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

GRIB_GRID Class Reference

Interface to grid as defined in GRIB version 1 files. More...

#include <GRIB.h>

List of all members.

Public Methods

 GRIB_GRID ()
 Constructor.

void Decode (unsigned char *pds, unsigned char *gds, unsigned char *bms, unsigned char *bds)
 Decode grid definition from all message parts. Do not use.

unsigned char * Encode ()
 Encode grid into a gds section. Do not use.

void set_size (int nx, int ny)
 Set grid dimensions.

void set_number (int code)
 Set grid number if standard grid is used. See GRIB documentation.

void set_regular_latlon (float lat1, float lon1, float lat2, float lon2, float dlat, float dlon)
 Set parameters of a regular latitude/longitude grid.

void set_gaussian_latlon (float lat1, float lon1, float lat2, float lon2, float dlon, float N)
 Set parameters of a Gaussian latitude/longitude grid.

void set_polar_stereo (float lat1, float lon1, float lov, float dx, float dy, bool pole)
 Set parameters for a polar stereographic grid.

void set_lambert_conformal (float lat1, float lon1, float lov, float latin1, float latin2, float latsp, float lonsp, float dx, float dy, bool pole, bool bipolar)
 Set parameters for a Lambert conformal grid.

void set_mercator (float lat1, float lon1, float lat2, float lon2, float dx, float dy, float latin)
 Set parameters for a Mercator grid.

void set_spaceview (float lap, float lop, float dx, float dy, float Xp, float Yp, float orient, float Nr)
 Set space view projection.

void set_spherical_harmonic (int J, int K, int M, int rt, int csm)
 Set spherical harmonics coefficients rapresentation.

void set_earth_spheroid ()
 Set earth sphere/spheroid flag.

void set_uv_grid ()
 Set flag for wind on SN-WE or grid reference.

void set_x_negative ()
 Reverse the order of X axis.

void set_y_negative ()
 Reverse the order of Y axis.

void set_fortran_indexing ()
 Fortran indexing: columnar order of grid parameter values.


Public Attributes

t_enum_GRIB_GRIDS type
 Type of the grid.

int grid_code
 Code if grid is defined without gds Use standard defined grid number as in GRIB documentation.

bool is_dirincgiven
 Directional increments are given or not.

bool is_earth_spheroid
 Earth assumed sperical or spheroid IAU 1965.

bool is_uv_grid
 U-V components of vectors are grid or sphere.

bool is_x_negative
 Point scan in -i (East-West).

bool is_y_negative
 Point scan in -j (North-South).

bool is_fortran
 Fortran indexing (column scan first).

long nxny
 Grid size as in grid definition.

int nx
 Grid size as in grid definition.

int ny
 Grid size as in grid definition.

unsigned char gds [44]
 Local storage for gds.

GRIB_GRID_regular_latlon ll
GRIB_GRID_polar_stereographic ps
GRIB_GRID_lambert_conformal lc
GRIB_GRID_gaussian_latlon gl
GRIB_GRID_mercator mc
GRIB_GRID_spherical_harmonic sa
GRIB_GRID_spaceview sp

Friends

std::ostream & operator<< (std::ostream &os, GRIB_GRID &g)
 Overloaded output to stream.


Detailed Description

Interface to grid as defined in GRIB version 1 files.

Definition at line 758 of file GRIB.h.


Constructor & Destructor Documentation

GRIB_GRID::GRIB_GRID  
 

Constructor.

Definition at line 1150 of file GRIB.cpp.

References GRIB_GRID_UNKNOWN, grid_code, is_dirincgiven, is_earth_spheroid, is_fortran, is_uv_grid, is_x_negative, is_y_negative, nx, nxny, ny, and type.


Member Function Documentation

void GRIB_GRID::Decode unsigned char *    pds,
unsigned char *    gds,
unsigned char *    bms,
unsigned char *    bds
 

Decode grid definition from all message parts. Do not use.

Parameters:
pds:  Encoded pds section of GRIB
gds:  Encoded gds section of GRIB
bms:  Encoded bms section of GRIB
bds:  Encoded bds section of GRIB

Definition at line 1450 of file GRIB.cpp.

References BDS_NumBits, BDS_NValues, gds, GDS_DataType, GDS_Gaussian_nlat, GDS_grid(), GDS_Harmonic_mode, GDS_Harmonic_nj, GDS_Harmonic_nk, GDS_Harmonic_nm, GDS_Harmonic_type, GDS_Lambert_dx, GDS_Lambert_dy, GDS_Lambert_La1, GDS_Lambert_Latin1, GDS_Lambert_Latin2, GDS_Lambert_LatSP, GDS_Lambert_Lo1, GDS_Lambert_LonSP, GDS_Lambert_Lov, GDS_Lambert_NP, GDS_LatLon_dx, GDS_LatLon_dy, GDS_LatLon_La1, GDS_LatLon_La2, GDS_LatLon_Lo1, GDS_LatLon_Lo2, GDS_LEN, GDS_Merc_dx, GDS_Merc_dy, GDS_Merc_La1, GDS_Merc_La2, GDS_Merc_Latin, GDS_Merc_Lo1, GDS_Merc_Lo2, GDS_Polar_Dx, GDS_Polar_Dy, GDS_Polar_La1, GDS_Polar_Lo1, GDS_Polar_Lov, GDS_Polar_pole, GDS_Spaceview_dx, GDS_Spaceview_dy, GDS_Spaceview_lap, GDS_Spaceview_lop, GDS_Spaceview_nr, GDS_Spaceview_or, GDS_Spaceview_Xp, GDS_Spaceview_Yp, gl, GRIB_GRID_GAUSSIAN, GRIB_GRID_LAMBERT_CONFORMAL, GRIB_GRID_MERCATOR, GRIB_GRID_POLAR_STEREOGRAPHIC, GRIB_GRID_REGULAR_LATLON, GRIB_GRID_SPACEVIEW, GRIB_GRID_SPHERICAL_HARMONIC_COE, grid_code, is_dirincgiven, is_earth_spheroid, is_fortran, is_uv_grid, is_x_negative, is_y_negative, lc, ll, mc, nx, nxny, ny, PDS_Grid, ps, sa, GRIB_GRID_spaceview::set(), GRIB_GRID_spherical_harmonic::set(), GRIB_GRID_mercator::set(), GRIB_GRID_lambert_conformal::set(), GRIB_GRID_polar_stereographic::set(), GRIB_GRID_gaussian_latlon::set(), GRIB_GRID_regular_latlon::set(), sp, and type.

Referenced by GRIB_MESSAGE::Decode().

unsigned char * GRIB_GRID::Encode  
 

Encode grid into a gds section. Do not use.

Definition at line 1323 of file GRIB.cpp.

References GRIB_GRID_lambert_conformal::bipolar, GRIB_GRID_regular_latlon::dlat, GRIB_GRID_regular_latlon::dlon, GRIB_GRID_spaceview::dx, GRIB_GRID_mercator::dx, GRIB_GRID_lambert_conformal::dx, GRIB_GRID_polar_stereographic::dx, GRIB_GRID_spaceview::dy, GRIB_GRID_mercator::dy, GRIB_GRID_lambert_conformal::dy, GRIB_GRID_polar_stereographic::dy, gds, GRIB_GRID_LAMBERT_CONFORMAL, GRIB_GRID_MERCATOR, GRIB_GRID_POLAR_STEREOGRAPHIC, GRIB_GRID_REGULAR_LATLON, GRIB_GRID_SPACEVIEW, GRIB_GRID_SPHERICAL_HARMONIC_COE, grid_code, GRIB_GRID_spherical_harmonic::J, GRIB_GRID_spherical_harmonic::K, GRIB_GRID_spaceview::lap, GRIB_GRID_mercator::lat1, GRIB_GRID_lambert_conformal::lat1, GRIB_GRID_polar_stereographic::lat1, GRIB_GRID_regular_latlon::lat1, GRIB_GRID_mercator::lat2, GRIB_GRID_regular_latlon::lat2, GRIB_GRID_mercator::latin, GRIB_GRID_lambert_conformal::latin1, GRIB_GRID_lambert_conformal::latin2, GRIB_GRID_lambert_conformal::latsp, lc, ll, GRIB_GRID_mercator::lon1, GRIB_GRID_lambert_conformal::lon1, GRIB_GRID_polar_stereographic::lon1, GRIB_GRID_regular_latlon::lon1, GRIB_GRID_mercator::lon2, GRIB_GRID_regular_latlon::lon2, GRIB_GRID_lambert_conformal::lonsp, GRIB_GRID_spaceview::lop, GRIB_GRID_lambert_conformal::lov, GRIB_GRID_polar_stereographic::lov, GRIB_GRID_spherical_harmonic::M, mc, mk_GDS(), GRIB_GRID_spaceview::Nr, nx, ny, GRIB_GRID_spaceview::orient, GRIB_GRID_lambert_conformal::pole, GRIB_GRID_polar_stereographic::pole, ps, GRIB_GRID_spherical_harmonic::representation, sa, sp, GRIB_GRID_spherical_harmonic::storage_method, WGRIB_ENCODE_2BYTES, WGRIB_ENCODE_BYTE, WGRIB_ENCODE_END, WGRIB_ENCODE_INIT, WGRIB_ENCODE_S2BYTES, WGRIB_ENCODE_S3BYTES, GRIB_GRID_spaceview::Xp, and GRIB_GRID_spaceview::Yp.

Referenced by GRIB_MESSAGE::Encode().

void GRIB_GRID::set_earth_spheroid  
 

Set earth sphere/spheroid flag.

Definition at line 1244 of file GRIB.cpp.

References is_earth_spheroid.

void GRIB_GRID::set_fortran_indexing  
 

Fortran indexing: columnar order of grid parameter values.

Definition at line 1248 of file GRIB.cpp.

References is_fortran.

void GRIB_GRID::set_gaussian_latlon float    lat1,
float    lon1,
float    lat2,
float    lon2,
float    dlon,
float    N
 

Set parameters of a Gaussian latitude/longitude grid.

Parameters:
lat1:  Latitude of first point
lon1:  Longitude of first point
lat2:  Latitude of last point
lon2:  Longitude of last point
dlon:  Longitude directional increment
N:  number of latitude circles between a pole and the equator

Definition at line 1187 of file GRIB.cpp.

References gl, GRIB_GRID_GAUSSIAN, grid_code, GRIB_GRID_gaussian_latlon::set(), and type.

void GRIB_GRID::set_lambert_conformal float    lat1,
float    lon1,
float    lov,
float    latin1,
float    latin2,
float    latsp,
float    lonsp,
float    dx,
float    dy,
bool    pole,
bool    bipolar
 

Set parameters for a Lambert conformal grid.

Parameters:
lat1:  Latitude of first point
lon1:  Longitude of first point
lov:  Grid orientation: longitude parallel to y-axis
latin1:  First secant latitude
latin2:  Second secant latitude (= first if tangent)
latsp:  Latitude of south pole
lonsp:  Longitude of south pole
dx:  WE resolution in Km
dy:  SN resolution in Km
pole:  is North Pole on projection plan ?
bipolar:  is projection bipolar and symmetric ?

Definition at line 1206 of file GRIB.cpp.

References GRIB_GRID_LAMBERT_CONFORMAL, grid_code, lc, GRIB_GRID_lambert_conformal::set(), and type.

void GRIB_GRID::set_mercator float    lat1,
float    lon1,
float    lat2,
float    lon2,
float    dx,
float    dy,
float    latin
 

Set parameters for a Mercator grid.

Parameters:
lat1:  Latitude of first point
lon1:  Longitude of first point
lat2:  Latitude of last point
lon2:  Longitude of last point
dx:  WE resolution in Km
dy:  SN resolution in Km
latin:  Latitude of intersection with earth

Definition at line 1218 of file GRIB.cpp.

References GRIB_GRID_MERCATOR, grid_code, mc, GRIB_GRID_mercator::set(), and type.

void GRIB_GRID::set_number int    code
 

Set grid number if standard grid is used. See GRIB documentation.

Parameters:
code:  pre-defined or site specific grid code nmber

Definition at line 1171 of file GRIB.cpp.

References grid_code.

void GRIB_GRID::set_polar_stereo float    lat1,
float    lon1,
float    lov,
float    dx,
float    dy,
bool    pole
 

Set parameters for a polar stereographic grid.

Parameters:
lat1:  Latitude of first point
lon1:  Longitude of first point
lov:  Grid orientation: longitude parallel to y-axis
dx:  WE resolution in Km
dy:  SN resolution in Km
pole:  is North Pole on projection plan ?

Definition at line 1197 of file GRIB.cpp.

References GRIB_GRID_POLAR_STEREOGRAPHIC, grid_code, ps, GRIB_GRID_polar_stereographic::set(), and type.

void GRIB_GRID::set_regular_latlon float    lat1,
float    lon1,
float    lat2,
float    lon2,
float    dlat,
float    dlon
 

Set parameters of a regular latitude/longitude grid.

Parameters:
lat1:  Latitude of first point
lon1:  Longitude of first point
lat2:  Latitude of last point
lon2:  Longitude of last point
dlat:  Latitude directional increment
dlon:  Longitude directional increment

Definition at line 1177 of file GRIB.cpp.

References GRIB_GRID_REGULAR_LATLON, grid_code, ll, GRIB_GRID_regular_latlon::set(), and type.

void GRIB_GRID::set_size int    nx,
int    ny
 

Set grid dimensions.

Parameters:
nx:  WE direction
ny:  SN direction

Definition at line 1163 of file GRIB.cpp.

References nx, nxny, and ny.

void GRIB_GRID::set_spaceview float    lap,
float    lop,
float    dx,
float    dy,
float    Xp,
float    Yp,
float    orient,
float    Nr
 

Set space view projection.

Parameters:
lap:  Latitude of sub-satellite point
lop:  Longitude of sub-satellite point
dx:  Apparent diameter of earth in grid lenght, X direction
dy:  Apparent diameter of earth in grid lenght, Y direction
Xp:  X-coordinate of sub-satellite point
Yp:  Y-coordinate of sub-satellite point
orient:  Grid orientation in mdeg
Nr:  Camera altitude from earth center in ER units

Definition at line 1227 of file GRIB.cpp.

References GRIB_GRID_SPACEVIEW, grid_code, GRIB_GRID_spaceview::set(), sp, and type.

void GRIB_GRID::set_spherical_harmonic int    J,
int    K,
int    M,
int    rt,
int    csm
 

Set spherical harmonics coefficients rapresentation.

Parameters:
J:  J pentagonal resolution parameter
K:  K pentagonal resolution parameter
M:  M pentagonal resolution parameter
rt:  Representation type
csm:  Coefficient storage method

Definition at line 1236 of file GRIB.cpp.

References GRIB_GRID_SPHERICAL_HARMONIC_COE, grid_code, sa, GRIB_GRID_spherical_harmonic::set(), and type.

void GRIB_GRID::set_uv_grid  
 

Set flag for wind on SN-WE or grid reference.

Definition at line 1245 of file GRIB.cpp.

References is_uv_grid.

void GRIB_GRID::set_x_negative  
 

Reverse the order of X axis.

Definition at line 1246 of file GRIB.cpp.

References is_x_negative.

void GRIB_GRID::set_y_negative  
 

Reverse the order of Y axis.

Definition at line 1247 of file GRIB.cpp.

References is_y_negative.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &    os,
GRIB_GRID &    g
[friend]
 

Overloaded output to stream.

Definition at line 1250 of file GRIB.cpp.


Member Data Documentation

unsigned char GRIB_GRID::gds[44]
 

Local storage for gds.

Definition at line 928 of file GRIB.h.

Referenced by Decode(), Encode(), and operator<<().

GRIB_GRID_gaussian_latlon GRIB_GRID::gl
 

Definition at line 884 of file GRIB.h.

Referenced by Decode(), operator<<(), set_gaussian_latlon(), and GRIB_MESSAGE::set_grid().

int GRIB_GRID::grid_code
 

Code if grid is defined without gds Use standard defined grid number as in GRIB documentation.

Definition at line 897 of file GRIB.h.

Referenced by Decode(), GRIB_MESSAGE::Encode(), Encode(), GRIB_GRID(), operator<<(), set_gaussian_latlon(), GRIB_MESSAGE::set_grid(), set_lambert_conformal(), set_mercator(), set_number(), set_polar_stereo(), set_regular_latlon(), set_spaceview(), and set_spherical_harmonic().

bool GRIB_GRID::is_dirincgiven
 

Directional increments are given or not.

Definition at line 900 of file GRIB.h.

Referenced by Decode(), GRIB_GRID(), operator<<(), and GRIB_MESSAGE::set_grid().

bool GRIB_GRID::is_earth_spheroid
 

Earth assumed sperical or spheroid IAU 1965.

Definition at line 903 of file GRIB.h.

Referenced by Decode(), GRIB_GRID(), operator<<(), set_earth_spheroid(), and GRIB_MESSAGE::set_grid().

bool GRIB_GRID::is_fortran
 

Fortran indexing (column scan first).

Definition at line 915 of file GRIB.h.

Referenced by Decode(), GRIB_GRID(), operator<<(), set_fortran_indexing(), and GRIB_MESSAGE::set_grid().

bool GRIB_GRID::is_uv_grid
 

U-V components of vectors are grid or sphere.

Definition at line 906 of file GRIB.h.

Referenced by Decode(), GRIB_GRID(), operator<<(), GRIB_MESSAGE::set_grid(), and set_uv_grid().

bool GRIB_GRID::is_x_negative
 

Point scan in -i (East-West).

Definition at line 909 of file GRIB.h.

Referenced by Decode(), GRIB_GRID(), operator<<(), GRIB_MESSAGE::set_grid(), and set_x_negative().

bool GRIB_GRID::is_y_negative
 

Point scan in -j (North-South).

Definition at line 912 of file GRIB.h.

Referenced by Decode(), GRIB_GRID(), operator<<(), GRIB_MESSAGE::set_grid(), and set_y_negative().

GRIB_GRID_lambert_conformal GRIB_GRID::lc
 

Definition at line 883 of file GRIB.h.

Referenced by Decode(), Encode(), operator<<(), GRIB_MESSAGE::set_grid(), and set_lambert_conformal().

GRIB_GRID_regular_latlon GRIB_GRID::ll
 

Definition at line 881 of file GRIB.h.

Referenced by Decode(), Encode(), operator<<(), GRIB_MESSAGE::set_grid(), and set_regular_latlon().

GRIB_GRID_mercator GRIB_GRID::mc
 

Definition at line 885 of file GRIB.h.

Referenced by Decode(), Encode(), operator<<(), GRIB_MESSAGE::set_grid(), and set_mercator().

int GRIB_GRID::nx
 

Grid size as in grid definition.

Definition at line 923 of file GRIB.h.

Referenced by Decode(), Encode(), GRIB_GRID(), operator<<(), GRIB_MESSAGE::set_grid(), and set_size().

long GRIB_GRID::nxny
 

Grid size as in grid definition.

Definition at line 921 of file GRIB.h.

Referenced by GRIB_MESSAGE::Decode(), Decode(), GRIB_GRID(), operator<<(), GRIB_MESSAGE::set_grid(), and set_size().

int GRIB_GRID::ny
 

Grid size as in grid definition.

Definition at line 925 of file GRIB.h.

Referenced by Decode(), Encode(), GRIB_GRID(), operator<<(), GRIB_MESSAGE::set_grid(), and set_size().

GRIB_GRID_polar_stereographic GRIB_GRID::ps
 

Definition at line 882 of file GRIB.h.

Referenced by Decode(), Encode(), operator<<(), GRIB_MESSAGE::set_grid(), and set_polar_stereo().

GRIB_GRID_spherical_harmonic GRIB_GRID::sa
 

Definition at line 886 of file GRIB.h.

Referenced by Decode(), Encode(), operator<<(), GRIB_MESSAGE::set_grid(), and set_spherical_harmonic().

GRIB_GRID_spaceview GRIB_GRID::sp
 

Definition at line 887 of file GRIB.h.

Referenced by Decode(), Encode(), operator<<(), GRIB_MESSAGE::set_grid(), and set_spaceview().

t_enum_GRIB_GRIDS GRIB_GRID::type
 

Type of the grid.

Definition at line 891 of file GRIB.h.

Referenced by Decode(), GRIB_GRID(), operator<<(), set_gaussian_latlon(), GRIB_MESSAGE::set_grid(), set_lambert_conformal(), set_mercator(), set_polar_stereo(), set_regular_latlon(), set_spaceview(), and set_spherical_harmonic().


The documentation for this class was generated from the following files:
Generated on Fri Sep 10 09:52:08 2004 for GRIBLIB by doxygen1.2.18