2 stable releases

Uses old Rust 2015

1.0.1 Oct 16, 2017

#4 in #iris

41 downloads per month
Used in seedlink

MIT license

115KB
2.5K SLoC

miniseed

MiniSEED Library for rust

This is a interface library over the libmseed C library that can be found at https://github.com/iris-edu/libmseed

For information about the data formats, see:

Usage

Add this to your Cargo.toml:

[dependencies]
miniseed = "1.0.0"

and this to your crate root:

extern crate miniseed;

Example

extern crate miniseed;

use miniseed::ms_record;

fn main() {
    let file = "tests/sample.miniseed";
    let m = ms_record::read(file);
    println!("{}", m);
}

Documentation

https://docs.rs/miniseed/


lib.rs:

MiniSEED Library for rust

This is an wrapper around the IRIS libmseed library at https://github.com/iris-edu/libmseed

Currently, it can read miniseed records from a file or parse from a in memory buffer. The underlying data and timing information can be obtained from a ms_record.

use miniseed::ms_record;
let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.to_string(), "PN_PPNAF_00_HHZ, 1, D, 512, 206 samples, 100 Hz, 2016-10-30 18:02:58.230 UTC");
use miniseed::ms_record;
use std::fs::File;
use std::io::Read;

let mut file = File::open("tests/sample.miniseed").unwrap();
let mut buf = vec![];
let _ = file.read_to_end(&mut buf).unwrap();

let rec = ms_record::parse(&buf);
assert_eq!(rec.to_string(), "PN_PPNAF_00_HHZ, 1, D, 512, 206 samples, 100 Hz, 2016-10-30 18:02:58.230 UTC");

Dependencies

~1–2.8MB
~53K SLoC