pub struct FitsFile {
pub hdus: Vec<Hdu>,
}Expand description
Top-level FITS file containing one or more HDUs.
Fields§
§hdus: Vec<Hdu>Implementations§
Source§impl FitsFile
impl FitsFile
pub fn new() -> Self
Sourcepub fn from_reader<R: Read + Seek>(reader: &mut R) -> Result<Self>
pub fn from_reader<R: Read + Seek>(reader: &mut R) -> Result<Self>
Read a FITS file from a seekable reader.
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Read a FITS file from a byte slice.
Sourcepub fn to_writer_with_checksum<W: Write>(&self, writer: &mut W) -> Result<()>
pub fn to_writer_with_checksum<W: Write>(&self, writer: &mut W) -> Result<()>
Write to a writer with CHECKSUM/DATASUM keywords in every HDU.
Sourcepub fn to_bytes_with_checksum(&self) -> Result<Vec<u8>>
pub fn to_bytes_with_checksum(&self) -> Result<Vec<u8>>
Write to a byte vector with CHECKSUM/DATASUM keywords.
Sourcepub fn primary_mut(&mut self) -> &mut Hdu
pub fn primary_mut(&mut self) -> &mut Hdu
Get the primary HDU mutably.
Sourcepub fn extensions(&self) -> &[Hdu]
pub fn extensions(&self) -> &[Hdu]
Get extension HDUs (everything after the primary).
Sourcepub fn with_primary_image(image: ImageData) -> Self
pub fn with_primary_image(image: ImageData) -> Self
Create a FitsFile with a single primary image HDU.
Sourcepub fn with_empty_primary() -> Self
pub fn with_empty_primary() -> Self
Create a FitsFile with an empty primary HDU.
Sourcepub fn push_extension(&mut self, hdu: Hdu)
pub fn push_extension(&mut self, hdu: Hdu)
Add an extension HDU.
Sourcepub fn find_extension(&self, extname: &str) -> Option<&Hdu>
pub fn find_extension(&self, extname: &str) -> Option<&Hdu>
Find the first extension HDU with a given EXTNAME.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FitsFile
impl RefUnwindSafe for FitsFile
impl Send for FitsFile
impl Sync for FitsFile
impl Unpin for FitsFile
impl UnsafeUnpin for FitsFile
impl UnwindSafe for FitsFile
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