[][src]Struct fitrs::Hdu

pub struct Hdu { /* fields omitted */ }

Represent an HDU as defined in FITS standard 4.1.

Methods

impl Hdu[src]

pub fn value(&self, key: &str) -> Option<&HeaderValue>[src]

Get HeaderValue by key. Return None if value is not found in Hdu.

pub fn read_data(&self) -> FitsData[src]

Get data array stored in the Hdu.

impl Hdu[src]

Important traits for HduIter<'a>
pub fn iter(&self) -> HduIter[src]

impl Hdu[src]

pub fn new<T: FitsDataType>(shape: &[usize], data: Vec<T>) -> Hdu[src]

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.

pub fn empty() -> Hdu[src]

Make an Hdu with an empty data array.

pub fn insert<K: Into<String>, V: Into<HeaderValue>>(
    &mut self,
    key: K,
    value: V
)
[src]

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

impl<'a> IntoIterator for &'a Hdu[src]

type Item = <HduIter<'a> as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = HduIter<'a>

Which kind of iterator are we turning this into?

impl Clone for Hdu[src]

impl Debug for Hdu[src]

Auto Trait Implementations

impl Send for Hdu

impl Sync for Hdu

impl Unpin for Hdu

impl UnwindSafe for Hdu

impl RefUnwindSafe for Hdu

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]