cdshealpix

Function depth

Source
pub fn depth(nside: u32) -> u8
Expand description

Returns, for the given nside, the number of subdivision of a base-resolution cell (i.e. the depth). For the NESTED scheme only.

§Input

  • nside must be a power of 2 in [0, 2^29]

§Output

  • depth = log2(nside)

§Panics

If nside is not valid (see is_nside), this method panics.

§Examples

use cdshealpix::{nside, depth};

for d in 0..=29 {
    assert_eq!(d, depth(nside(d as u8)));
}