Module cryiorust::esperanto[][src]

Expand description

Agilent (Oxford) Esperanto format reader and writer.

The reader supports uncompressed (only 32 bit signed integers) and Bitfield compressed frames.

Example usage:

use std::path::Path;
use cryiorust::esperanto::Esperanto;
use cryiorust::frame::Frame;

fn test_read<P: AsRef<Path>>(path: P) {
    let frame = Esperanto::read_file(path).unwrap();
    assert_eq!(frame.dim1(), 2048, "dim1 != 2048");
    assert_eq!(frame.dim2(), 2048, "dim2 != 2048");
    assert_eq!(frame.sum(), 424962850., "frame sum != 424962850");
    assert_eq!(frame.min(), 86., "frame min != 86");
    assert_eq!(frame.max(), 62570., "frame max != 62570");
    assert_eq!(
        frame.array()[frame.dim2() * 1272 + 303],
        58608.,
        "frame[1272, 303] != 58608"
    );
    let temp = tempfile::NamedTempFile::new().unwrap();
    frame.write_file(temp.path()).unwrap();
}

Structs

Main exported struct.