Pixelization functions

These functions can be call without referencing any class. e.g.:

>>> import mhealpy as mhp
>>> mhp.nest2uniq(nside = 128, ipix = 3)
65539

Single-resolution maps

mhealpy.pixelfunc.single.order2npix(order)[source]

Get the number of pixel for a map of a given order

Parameters:

order (int or array) –

Returns:

int or array

mhealpy.pixelfunc.single.nside2order(nside)[source]
mhealpy.pixelfunc.single.order2nside(order)[source]
mhealpy.pixelfunc.single.nside2npix(nside)[source]
mhealpy.pixelfunc.single.npix2nside(npix)[source]
mhealpy.pixelfunc.single.nside2pixarea(nside)[source]
mhealpy.pixelfunc.single.pix2ang(nside, ipix, nest=False, lonlat=False)[source]
mhealpy.pixelfunc.single.pix2vec(nside, ipix, nest=False)[source]
mhealpy.pixelfunc.single.ang2pix(nside, theta, phi, nest=False, lonlat=False)[source]
mhealpy.pixelfunc.single.vec2pix(nside, x, y, z, nest=False)[source]
mhealpy.pixelfunc.single.vec2ang(vectors)[source]
mhealpy.pixelfunc.single.ang2vec(theta, phi, lonlat=False)[source]
mhealpy.pixelfunc.single.nest2ring(nside, ipix)[source]
mhealpy.pixelfunc.single.ring2nest(nside, ipix)[source]
mhealpy.pixelfunc.single.isnpixok(npix)[source]
mhealpy.pixelfunc.single.get_all_neighbours(nside, theta, phi=None, nest=False, lonlat=False)[source]
mhealpy.pixelfunc.single.query_disc(nside, vec, radius, inclusive=False, fact=4, nest=False)[source]
mhealpy.pixelfunc.single.query_polygon(nside, vertices, inclusive=False, fact=4, nest=False)[source]
mhealpy.pixelfunc.single.query_strip(nside, theta1, theta2, inclusive=False, nest=False)[source]
mhealpy.pixelfunc.single.boundaries(nside, pix, step=1, nest=False)[source]
mhealpy.pixelfunc.single.get_interp_weights(nside, theta, phi=None, nest=False, lonlat=False)[source]

Multi-resolution maps

mhealpy.pixelfunc.moc.uniq2nside(uniq)[source]

Extract the corresponding nside from a UNIQ numbered pixel

Parameters:

uniq (int or array) – Pixel number

Returns:

int or array

mhealpy.pixelfunc.moc.uniq2nest(uniq)[source]

Convert from UNIQ ordering scheme to NESTED

Parameters:

uniq (int or array) – Pixel number

Return

(int or array, int or array): nside, npix

mhealpy.pixelfunc.moc.nest2uniq(nside, ipix)[source]

Convert from from NESTED to UNIQ scheme

Parameters:
  • nside (int) – HEALPix NSIDE parameter

  • ipix (int or array) – Pixel number in NESTED scheme

Returns:

int or array

mhealpy.pixelfunc.moc.nest2range(nside_input, pix, nside_output)[source]

Get the equivalent range of pixel that correspond to all child pixels of a map of a greater order.

Parameters:
  • nside_input (int or array) – Nside of input pixel

  • pix (int or array) – Input pixel.

  • nside_output (int) – Nside of map with child pixels

Returns:

Start pixel (inclusive) and

stop pixel (exclusive)

Return type:

(int or array, int or array)

mhealpy.pixelfunc.moc.uniq2range(nside, uniq)[source]

Convert from a pixel number in NUNIQ scheme to the range of children pixels that it would correspond to in a NESTED map of a given order

Parameters:
  • order (int) – Nside of equivalent single resolution map

  • uniq (int or array) – Pixel number in NUNIQ scheme

Returns:

Start pixel (inclusive) and

stop pixel (exclusive)

Return type:

(int or array, int or array)

mhealpy.pixelfunc.moc.range2uniq(nside, pix_range)[source]

Convert from range of children pixels in a NESTED map of a given order to the corresponding uniq pixel number.

Parameters:
  • nside (int) – Nside of equivalent single resolution map

  • pix_range (int or array, int or array) – Star pixel (inclusive) and stop pixel (exclusive)

Returns:

int