Crates.io | grib1_reader |
lib.rs | grib1_reader |
version | 0.2.1 |
source | src |
created_at | 2023-10-26 15:35:32.629348 |
updated_at | 2024-03-13 19:35:36.007258 |
description | A simple library capable of reading GRIB version 1 files |
homepage | https://github.com/christian-boks/grib1_reader |
repository | https://github.com/christian-boks/grib1_reader |
max_upload_size | |
id | 1014648 |
size | 23,264 |
Read a GRIB1 file and search for data based on parameter and level values. The results can either be decoded or extracted as a binary blob so it can be saved to a separate file.
Currently only the Grid 10 (RotatedLatLon) data representation type is supported
Add this to your Cargo.toml:
[dependencies]
grib1_reader = "0.2.0"
and this to your source code:
use grib1_reader::{Grib1Reader, SearchParams};
let file = File::open("data/sample.grib").await?;
let mut reader = Grib1Reader::new(BufReader::new(file));
let result = reader.read(vec![SearchParams { param: 33, level: 700 }]).await?;
println!("Results:");
for grib in result {
println!("{:#?}", &grib.pds);
if let Some(gds) = grib.gds {
println!("{:#?}", &gds);
}
}