Skip to main content

Module fits

Module fits 

Source
Expand description

FITS file reading and data extraction.

This module provides functions for reading HEALPix astronomical data from FITS files. It supports both:

  • Dense maps: Complete sky coverage (standard NSIDE² pixels)
  • Sparse maps: Partial sky coverage with explicit PIXEL column indexing

§FITS Format Support

  • Binary table format (.fits files)
  • HEALPix RING or NEST pixel ordering
  • Sparse maps with IMPLICIT or EXPLICIT indexing schemes via the INDXSCHM keyword

§Sparse Map Handling

For sparse maps with EXPLICIT indexing, this module automatically expands the data to a full dense array with UNSEEN values for omitted pixels.

Tier 4.2b Optimization: Sparse map column extraction is parallelized via rayon for efficient multi-core processing of large sparse catalogs.

§Examples

use map2fig::read_healpix_column;

let data = read_healpix_column("map.fits", 0);
println!("Loaded {} pixels", data.len());

Functions§

read_healpix_column
Read a HEALPix column from a FITS binary table.
read_healpix_column_cached
Read a HEALPix column with caching support (Tier 5.2.1 optimization)
read_healpix_column_mmap
Read a HEALPix column from a FITS file using memory-mapped I/O
read_healpix_meta_cached
Read FITS metadata with caching support This function attempts to use cached metadata to avoid expensive header parsing When MAP2FIG_PROFILE environment variable is set, outputs diagnostic timing info
read_healpix_meta_cached_mmap
Read FITS metadata using memory-mapped I/O (mmap variant of read_healpix_meta_cached)