Rust reader and writer implementation for the om
file format.
The file format is documented in the open-meteo/om-file-format repository.
cargo test
Assuming the file data.om
directly contains a floating point array with 3 dimensions
use omfiles_rs::io::reader::OmFileReader;
let file = "data.om";
let reader = OmFileReader::from_file(file).expect(format!("Failed to open file: {}", file).as_str());
// read root variable into a (dynamical) 3D array
let data = reader.read::<f32>(&[50u64..51, 20..21, 10..200], None, None).expect("Failed to read data");
// Metadata information
let dimensions = reader.get_dimensions();
let chunk_size = reader.get_chunk_dimensions();
println!("Dimensions: {:?}", dimensions);
println!("Chunk size: {:?}", chunk_size);
- Read data from
om
v2 and v3 files - Write data to
om
v3 files - Integrates with the
ndarray
crate for data representation - Tested on Linux, MacOS and Windows in CI