Skip to main content

Module data_array

Module data_array 

Source
Expand description

Adaptive data type wrapper that preserves FITS column precision.

This module wraps HEALPix map data with the appropriate type (f32 or f64) based on the source FITS column, avoiding unnecessary conversions.

§Memory & Performance Impact

By keeping f32 data as f32 instead of converting to f64:

  • Time saved: 6.8s (62.4% of FITS reading for large maps)
  • Memory saved: 3.2 GB (for 806M pixel maps)
  • Precision: Sufficient for visualization (32-bit color depth)

§Usage

use map2fig::data_array::DataArray;

// Generic operations
let min = data.min_value();
let max = data.max_value();
let len = data.len();

// Type-specific operations
let scaled = data.scale_value(val, min_v, max_v);

Enums§

DataArray
Adaptive array wrapper: holds HEALPix data in the native FITS precision.

Functions§

to_f64_vec
Temporary compatibility wrapper: convert DataArray to Vec<f64> Used for gradual migration of existing code