Struct miniseed::ms_record [] [src]

pub struct ms_record(_);

MiniSEED Record

Methods

impl ms_record
[src]

[src]

Get pointer to wrapped MSRecord value

[src]

Create a null pointer as a MSRecord

[src]

Read a file and return a 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");

[src]

Return the MiniSEED Record FSDH Header, this is typically used internally

let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
let hdr = rec.header();

[src]

Return the start time

let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.start().to_string(), "2016-10-30 18:02:58.230 UTC");

[src]

Return the end time

let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.end().to_string(), "2016-10-30 18:03:00.279999 UTC");

[src]

Return the time of the next sample beyond the record assuming a constant sample rate

let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.end1().to_string(), "2016-10-30 18:03:00.290 UTC");

[src]

Return the sample rate

let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.delta(), 0.01);

[src]

Return the data sample type

  • c - Character data
  • i - i32 data
  • f - f32 data
  • d - f64 data
let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.data_type(), 'i');

[src]

Return the data sample type

see data_type()

[src]

Return the number of points or samples

let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.npts(), 206);

[src]

Return the timing of each sample

let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
println!("{:?}", rec.time());

[src]

Return the data as f64

use miniseed::ms_record;
let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.data_f64()[0], 1.0);

[src]

Return the data as f32

use miniseed::ms_record;
let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.data_f32()[0], 4.75878e-12);

[src]

Return the data as i32

let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.data_i32()[0], 339598);

[src]

Return the minimum data value

let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.min(), 333405.0);

[src]

Return the maximum data value

let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.max(), 342105.0);

[src]

Return the unique record identifier or ID

let file = "tests/sample.miniseed";
let rec = ms_record::read(file);
assert_eq!(rec.id(), "PN_PPNAF_00_HHZ");

[src]

Parse a SeedLink data buffer and return a 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");

[src]

Trait Implementations

impl Send for ms_record
[src]

impl Sync for ms_record
[src]

impl Debug for ms_record
[src]

[src]

Formats the value using the given formatter.

impl Display for ms_record
[src]

[src]

Formats the value using the given formatter. Read more

impl Drop for ms_record
[src]

[src]

Executes the destructor for this type. Read more