write_hdf5

Function write_hdf5 

Source
pub fn write_hdf5<P: AsRef<Path>>(
    path: P,
    datasets: HashMap<String, ArrayD<f64>>,
) -> Result<()>
Expand description

Write data to an HDF5 file

§Arguments

  • path - Path to the HDF5 file
  • datasets - Map of dataset paths to arrays

§Example

use scirs2_core::ndarray::array;
use std::collections::HashMap;
use scirs2_io::hdf5::write_hdf5;

let mut datasets = HashMap::new();
datasets.insert("data/temperature".to_string(), array![[1.0, 2.0], [3.0, 4.0]].into_dyn());
datasets.insert("data/pressure".to_string(), array![100.0, 200.0, 300.0].into_dyn());

write_hdf5("output.h5", datasets)?;