pub struct SacFile {
pub header: SacHeader,
pub data: Vec<f32>,
}Expand description
A complete SAC file with header and time-series data.
Fields§
§header: SacHeaderSAC header.
data: Vec<f32>Time-series samples (float32).
Implementations§
Source§impl SacFile
impl SacFile
Sourcepub fn from_data(data: Vec<f32>, delta: f32) -> Self
pub fn from_data(data: Vec<f32>, delta: f32) -> Self
Create a new SAC file from data and a sampling interval.
Sourcepub fn serialize_header(&self) -> Vec<u8> ⓘ
pub fn serialize_header(&self) -> Vec<u8> ⓘ
Serialize the SAC header to 632 bytes (simplified).
Sourcepub fn npts_from_header(buf: &[u8]) -> i32
pub fn npts_from_header(buf: &[u8]) -> i32
Deserialize npts from a SAC 632-byte header.
Sourcepub fn num_samples(&self) -> usize
pub fn num_samples(&self) -> usize
Return the number of samples.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SacFile
impl RefUnwindSafe for SacFile
impl Send for SacFile
impl Sync for SacFile
impl Unpin for SacFile
impl UnsafeUnpin for SacFile
impl UnwindSafe for SacFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.