#grib #data #file-search #version #reader #reading #grib1

grib1_reader

A simple library capable of reading GRIB version 1 files

3 unstable releases

0.2.1 Mar 13, 2024
0.2.0 Mar 5, 2024
0.1.0 Oct 26, 2023

#6 in #grib

Download history 3/week @ 2024-02-16 6/week @ 2024-02-23 93/week @ 2024-03-01 124/week @ 2024-03-08 29/week @ 2024-03-15 4/week @ 2024-03-22 44/week @ 2024-03-29 17/week @ 2024-04-05

61 downloads per month

MIT/Apache

23KB
435 lines

GRIB1 Reader

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

Usage

Add this to your Cargo.toml:

[dependencies]
grib1_reader = "0.2.0"

and this to your source code:

use grib1_reader::{Grib1Reader, SearchParams};

Example

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);
    }
}

lib.rs:

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.

Dependencies

~2.6–4MB
~71K SLoC