pub struct Hdu { /* private fields */ }
Expand description
Represent an HDU as defined in FITS standard 4.1.
Implementations
sourceimpl Hdu
impl Hdu
sourcepub fn new<T: FitsDataType>(shape: &[usize], data: Vec<T>) -> Hdu
pub fn new<T: FitsDataType>(shape: &[usize], data: Vec<T>) -> Hdu
Create a new HDU with the shape and data given as parameters.
The HDU must be added to a Fits
object to be written persistently
to disk.
sourcepub fn insert<K: Into<String>, V: Into<HeaderValue>>(&mut self, key: K, value: V)
pub fn insert<K: Into<String>, V: Into<HeaderValue>>(&mut self, key: K, value: V)
Insert a value into header.
FITS file is saved with the header in the order of insertion. Keys longer than 8 bytes are truncated on writing to disk.
Example
use fitrs::{Hdu};
let mut hdu = Hdu::empty();
hdu.insert("KEYSTR", "My string");
hdu.insert("KEYSTR2", "Strings longer than 68 characters are supported as well, following the continued string convention.");
hdu.insert("KEYFLOAT", 3.14);
hdu.insert("KEYINT", 42);
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Hdu
impl Send for Hdu
impl Sync for Hdu
impl Unpin for Hdu
impl UnwindSafe for Hdu
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more