Expand description
FITS spectral cube reading and writing with per-channel beam support.
Supports 3D cubes (NAXIS=3: freq×dec×ra) and 4D cubes (NAXIS=4: stokes×freq×dec×ra). Per-channel beams are read from, in priority order:
- CASA BEAMS binary-table extension (CASAMBM=T in header)
- Co-located beamlog text file:
{dir}/beamlog.{stem}.txt - Single BMAJ/BMIN/BPA from the primary header (broadcast to all channels)
Structs§
- Cube
Meta - Metadata for a FITS spectral cube (3D or 4D).
- Cube
Writer - A streaming writer that holds an initialised output cube open for the lifetime
of a processing run, so channels can be written one at a time without the
per-call file open/close overhead of
write_channel.
Enums§
Functions§
- init_
output_ cube - Initialise an output cube by copying the input, then updating the beam headers.
- read_
beamlog - Read per-channel beams from a plain-text beamlog.
- read_
channel - Read a single frequency channel from a cube into a 2D array (ny × nx).
- read_
cube_ meta - Read metadata (shape, pixel scale, per-channel beams) from a FITS cube.
- write_
beamlog - Write per-channel beams to a plain-text beamlog.
- write_
channel - Write a single frequency channel plane back into an existing FITS cube.