pub struct LatLonGrid {
pub shape: (usize, usize),
pub first_point: (f64, f64),
pub last_point: (f64, f64),
pub i_consecutive: bool,
}Expand description
An auxiliary struct for creating the definition of a latitude/longitude grid
(def::grib2::template::param_set::LatLonGrid)
in a more intuitive way.
You can specify any value within the range of -360 degrees to 360 degrees for the longitude values of the first and last points. However, to distinguish the grid area, set the longitude value at the western end of the grid to a value smaller than that at the eastern end.
For example:
- For a grid extending eastward from 0° to 5°W, specify the first point’s longitude as 0.0 and the last point’s longitude as 355.0.
- For a grid extending westward from 0° to 5°W, specify the first point’s longitude as 0.0 and the last point’s longitude as -5.0.
- For a grid extending eastward from 180° to 175°W, specify the first point’s longitude as -180.0 and the last point’s longitude as 175.0.
- For a grid extending westward from 180° to 175°W, specify the first point’s longitude as 180.0 and the last point’s longitude as 175.0.
Longitude values are automatically normalized during conversion to
def::grib2::template::param_set::LatLonGrid
to comply with GRIB2 specification.
Fields§
§shape: (usize, usize)Shape of the grid, in the form (ni, nj).
first_point: (f64, f64)First coordinate point, in the form (lat, lon). The order in which you
specify the “first” point should correspond to the order of the array of
grid point values.
last_point: (f64, f64)The coordinate point diagonally opposite the first coordinate point, in
the form (lat, lon).
i_consecutive: boolWhether the grid point values consecutive in the i-direction
(longitude direction) or not.
Implementations§
Source§impl LatLonGrid
impl LatLonGrid
Sourcepub fn num_points(&self) -> usize
pub fn num_points(&self) -> usize
Returns the number of points of the grid.
Sourcepub fn scanning_mode(&self) -> ScanningMode
pub fn scanning_mode(&self) -> ScanningMode
Returns the scanning mode of the grid.