[][src]Function cdshealpix::n_hash

pub fn n_hash(depth: u8) -> u64

Returns the number of distinct hash value (the number of cells or pixel the unit sphere is devided in) at the given depth.

Input

  • depth must be in [0, 29]

Output

  • n_hash = 12 * nside^2

Panics

If depth is not valid (see is_depth), this method panics.

Examples

use cdshealpix::{n_hash};
 
assert_eq!(12u64, n_hash(0u8));
assert_eq!(48u64, n_hash(1u8));
assert_eq!(192u64, n_hash(2u8));
assert_eq!(768u64, n_hash(3u8));
assert_eq!(3072u64, n_hash(4u8));
assert_eq!(12288u64, n_hash(5u8));
assert_eq!(49152u64, n_hash(6u8));
assert_eq!(196608u64, n_hash(7u8));
assert_eq!(786432u64, n_hash(8u8));
assert_eq!(3145728u64, n_hash(9u8));
assert_eq!(12582912u64, n_hash(10u8));
assert_eq!(50331648u64, n_hash(11u8));
assert_eq!(201326592u64, n_hash(12u8));
assert_eq!(805306368u64, n_hash(13u8));
assert_eq!(3221225472u64, n_hash(14u8));
assert_eq!(12884901888u64, n_hash(15u8));
assert_eq!(51539607552u64, n_hash(16u8));
assert_eq!(206158430208u64, n_hash(17u8));
assert_eq!(824633720832u64, n_hash(18u8));
assert_eq!(3298534883328u64, n_hash(19u8));
assert_eq!(13194139533312u64, n_hash(20u8));
assert_eq!(52776558133248u64, n_hash(21u8));
assert_eq!(211106232532992u64, n_hash(22u8));
assert_eq!(844424930131968u64, n_hash(23u8));
assert_eq!(3377699720527872u64, n_hash(24u8));
assert_eq!(13510798882111488u64, n_hash(25u8));
assert_eq!(54043195528445952u64, n_hash(26u8));
assert_eq!(216172782113783808u64, n_hash(27u8));
assert_eq!(864691128455135232u64, n_hash(28u8));
assert_eq!(3458764513820540928u64, n_hash(29u8));