Skip to main content

generate_index_map

Function generate_index_map 

Source
pub fn generate_index_map(nside: i64) -> Vec<f64>
Expand description

Generate a simple index map for testing.

Creates a map with pixel values equal to their indices: 0, 1, 2, …, (12*nside²-1). Useful for diagnostic tests and understanding HEALPix pixel layout.

§Arguments

  • nside - HEALPix resolution parameter (must be power of 2: 1, 2, 4, 8, 16, …)

§Returns

Vector with 12*nside² elements where element i contains value i as f64.

§Example

use map2fig::generate_index_map;

let map = generate_index_map(2);
assert_eq!(map.len(), 48);  // 12 * 2² = 48
assert_eq!(map[0], 0.0);
assert_eq!(map[47], 47.0);