hpmoc.healpy_utils module

HEALPix helper utilities needed for both utils and healpy.

hpmoc.healpy_utils.alt_compress(x, in_place=False)

Start in 0x55… state.

https://help.dyalog.com/18.0/Content/Language/Primitive%20Functions/Replicate.htm

Examples

>>> alt_compress(0b011101)
7
>>> alt_compress(0b110010)
4
>>> alt_compress(100)
10
>>> f'{alt_compress(0b10011100):04b}'
'0110'

See also

alt_expand

hpmoc.healpy_utils.alt_expand(x, in_place=False)

Start in 0x00000000ffffffff state.

https://help.dyalog.com/18.0/Content/Language/Primitive%20Functions/Expand.htm

Examples

>>> f'{alt_expand(0b100101):012b}'
'010000010001'

See also

alt_compress

hpmoc.healpy_utils.compress_masks()

Must use numpy.uint64 due to signedness issues when bit-flipping large python floats as bitmasks.