pub struct Hdu {
pub header: FitsHeader,
/* private fields */
}Available on crate feature
fits only.Expand description
A Header Data Unit within a FITS file.
Fields§
§header: FitsHeaderThe header section of the HDU.
Implementations§
Source§impl Hdu
impl Hdu
Sourcepub fn get_name(&mut self) -> String
pub fn get_name(&mut self) -> String
Gets the name of the HDU, or an empty string if the name cannot be determined.
§Examples
use astro_rs::fits::*;
let mut img_hdu = image_hdu::default();
let name_card = FitsHeaderCard::from(*b"EXTNAME = 'hdu_name' ");
img_hdu.header.cards.insert(img_hdu.header.cards.len() - 1, name_card);
assert_eq!(img_hdu.get_name(), String::from("hdu_name"));Sourcepub fn set_data_raw(&mut self, data_raw: Vec<u8>)
pub fn set_data_raw(&mut self, data_raw: Vec<u8>)
Sets the data section of the HDU.
Sourcepub fn get_data<T: FitsDataCollection>(&self) -> Result<T, FitsHeaderError>
pub fn get_data<T: FitsDataCollection>(&self) -> Result<T, FitsHeaderError>
Attempts to create a new FitsDataCollection from the data section of the HDU.
Sourcepub fn set_data<T: FitsDataCollection>(&mut self, data: &T)
pub fn set_data<T: FitsDataCollection>(&mut self, data: &T)
Sets the data section of the HDU.
Sourcepub fn get_dimensions(&mut self) -> Vec<usize>
pub fn get_dimensions(&mut self) -> Vec<usize>
Creates a Vec containing the dimensions of the data section of the HDU as defined by the NAXIS keywords.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hdu
impl !RefUnwindSafe for Hdu
impl !Send for Hdu
impl !Sync for Hdu
impl Unpin for Hdu
impl !UnwindSafe for Hdu
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> RealAny for Twhere
T: Any,
impl<T> RealAny for Twhere
T: Any,
Source§fn real_type_id(&self) -> TypeId
fn real_type_id(&self) -> TypeId
Available on crate feature
fits only.Gets the base type ID for
self.