Skip to main content

atfits_rs/
lib.rs

1//! `atfits-rs` — shared low-level cfitsio helpers for the at*-rs FITS tools
2//! (`fitscube-rs`, `convolve-rs`, …).
3//!
4//! These are the project-agnostic mechanics that every tool needs and that are
5//! easy to get subtly wrong against cfitsio:
6//!
7//! * [`PixelType`] / [`CubeElem`] — precision + monomorphic section I/O.
8//! * [`keys`] — update-in-place keyword editing (`ffuky*`, not the duplicating
9//!   `ffpky*`) and convenience readers.
10//! * [`header`] — [`HeaderGeom`] and WCS [`find_target_axis`] lookup.
11//! * [`image`] — image-HDU creation/resize and header-only copying, including
12//!   [`create_cube_open`] (the single-open-handle pattern that avoids a doubled
13//!   zero-fill pass on close).
14//! * [`mem_header`] — build a cube header in memory ([`create_mem_cube`]) and
15//!   serialise it ([`extract_header_layout`]) so a tool can write the data unit
16//!   with raw I/O and skip cfitsio's zero-fill entirely.
17//! * [`output_path`] — output-path construction.
18//!
19//! Domain logic (beams, combine/extract, convolution, spectral specs) stays in
20//! the individual crates.
21pub mod error;
22pub mod header;
23pub mod image;
24pub mod keys;
25pub mod mem_header;
26pub mod path;
27pub mod pixel;
28
29pub use error::{AtfitsError, Result};
30pub use header::{HeaderGeom, TargetAxis, find_target_axis};
31pub use image::{
32    bitpix_to_image_type, copy_header_only, copy_header_only_open, create_cube_open,
33    is_structural_keyword, resize_image,
34};
35pub use keys::{
36    delete_key, has_key, read_key_f64, read_key_string, update_key_f64, update_key_i64,
37    update_key_logical, update_key_str, write_comment,
38};
39pub use mem_header::{CubeLayout, create_mem_cube, extract_header_layout};
40pub use path::output_path;
41pub use pixel::{CubeElem, PixelType};