Expand description
Pure-Rust GRIB file reader.
The current implementation supports the production-critical baseline for both GRIB1 and GRIB2: regular latitude/longitude grids, simple packing, and GRIB2 complex packing with general group splitting.
§Example
use grib_reader::GribFile;
let file = GribFile::open("gfs.grib2")?;
println!("messages: {}", file.message_count());
for msg in file.messages() {
println!(
" {} {:?} {:04}-{:02}-{:02}T{:02}:{:02}:{:02}Z",
msg.parameter_name(),
msg.grid_shape(),
msg.reference_time().year,
msg.reference_time().month,
msg.reference_time().day,
msg.reference_time().hour,
msg.reference_time().minute,
msg.reference_time().second,
);
}
let data = file.message(0)?.read_data_as_f64()?;
println!("shape: {:?}", data.shape());Re-exports§
pub use data::DecodeSample;
Modules§
- data
- Data Section (Section 7) decoding.
- error
- grib1
- GRIB Edition 1 parsing.
- grid
- indicator
- Section 0: Indicator Section parsing for GRIB1 and GRIB2.
- metadata
- parameter
- product
- sections
- GRIB2 section scanning and logical field indexing.
Structs§
- Analysis
OrForecast Template - Product Definition Template 4.0: analysis or forecast at a horizontal level.
- Binary
Data Section - Complex
Packing Params - Parameters for complex packing (Templates 5.2 and 5.3).
- Fixed
Surface - A fixed surface from Product Definition templates.
- Grib1
Product Definition - GRIB1 product definition metadata.
- Grib
File - A GRIB file containing one or more logical fields.
- Grid
Description - Identification
- Section 1: Identification Section.
- LatLon
Grid - Template 3.0: Regular latitude/longitude grid.
- Message
- A single logical GRIB field.
- Message
Iter - Iterator over fields in a GRIB file.
- Message
Metadata - A parsed GRIB field.
- Open
Options - Configuration for opening GRIB data.
- Parameter
- Edition-independent parameter identity.
- Product
Definition - Section 4: Product Definition Section.
- Reference
Time - Common reference time representation for GRIB fields.
- Simple
Packing Params - Parameters for simple packing (Template 5.0).
- Spatial
Differencing Params - Parameters specific to template 5.3 spatial differencing.
Enums§
- Data
Representation - Data representation template number and parameters.
- Error
- Forecast
Time Unit - Semantic forecast-time units shared across GRIB editions.
- Grid
Definition - Grid definition extracted from Section 3.
- Product
Definition Template - Typed GRIB2 Product Definition templates.