use super::ordering::HealpixOrdering;
pub type Result<T> = std::result::Result<T, HealpixError>;
#[derive(Debug, thiserror::Error, Clone, PartialEq)]
pub enum HealpixError {
#[error("HEALPix nside must be greater than zero")]
InvalidNside,
#[error("HEALPix nside {0} is too large")]
NsideTooLarge(u32),
#[error("HEALPix NESTED ordering requires power-of-two nside, got {0}")]
NestedNsideNotPowerOfTwo(u32),
#[error("HEALPix ordering {0:?} is not supported by this operation yet")]
UnsupportedOrdering(HealpixOrdering),
#[error("HEALPix pixel index {index} is outside the valid range 0..{npix}")]
PixelIndexOutOfRange {
index: u64,
npix: u64,
},
#[error("invalid HEALPix angular input: {reason}")]
InvalidAngles {
reason: &'static str,
},
#[error("HEALPix map length {len} does not match grid npix {npix}")]
MapLengthMismatch {
len: usize,
npix: u64,
},
#[error("HEALPix map contains an invalid non-finite or negative value")]
InvalidMapValue,
}