atfits-rs
cfitsio helpers shared by
fitscube-rs and
convolve-rs:
PixelType,CubeElem,read_plane,write_plane:f32/f64pixel I/O, with BLANK read as NaN and NaN written as BLANK.raw: pixel I/O in any FITS type, rectangular subsets, stored values with scaling off, and big-endian helpers for raw data-unit writes.keys: keyword updates that replace the existing card (fitsio'swrite_keyappends a duplicate), and readers that tell a missing keyword from a malformed one.header: image geometry, WCS axis lookup, unit factors and pixel scale.image: image creation, resizing and header-only copies, including from an image extension.mem_header: build a cube header in memory and write the data unit with plain file I/O.output_path: output file names.
Install
[]
= "1"
The fitsio-src feature compiles cfitsio from source, which needs only a C
compiler. Without it the system cfitsio is linked.
= { = "1", = ["fitsio-src"] }
Example
Create a cube from a 2D template, write each plane, then read the cube back:
use ;
use FitsFile;
let dims = ; // NAXIS1, NAXIS2, NAXIS3
let mut out = create_cube_open?;
update_key_f64?;
for c in 0..nchan
drop;
let mut f = open?;
let all = f32read_full?;
Threads
A FitsFile must stay on the thread that opened it. Threads may each open
their own handle when cfitsio is reentrant, which the fitsio-src build is;
is_reentrant() checks a system library. Write a given file from one handle
only.
Development
CI runs the same hooks (cargo fmt, cargo clippy, generic checks) with
prek.
License
BSD-3-Clause.