PixMap

class erwans3.Astro_tools.PixMap(value: Any, coordinates: BaseRepresentation)

Bases: PixList

This object represents a list of pixels on the sky, including both values and coordinates.

Parameters:
  • value (Any) – The pixel list to be stored in the PixMap object. Can be of any type convertible to a NumPy array or an astropy Quantity.

  • coordinates (BaseRepresentation) – The coordinate representation associated with the pixel values.

Attributes Summary

dir

Direction vectors of the coordinates

Methods Summary

plot([nside, intensive])

Plot the PixMap data on a Healpix map.

rotate(rot[, copy])

Rotate the PixMap's coordinates by a given rotation.

to_hpxmap([nside, fill])

Convert the PixxMap to a HEALPix map (HpxMap).

to_hpxpart([nside])

Convert the PixMap to a Healpix partition (HpxPart).

Attributes Documentation

dir

Direction vectors of the coordinates

Returns:

unitary vectors with shape (npix, 3)

Return type:

ndarray

Methods Documentation

plot(nside: Optional[int] = None, intensive: bool = False, **kwargs)

Plot the PixMap data on a Healpix map.

First convert the PixMap to a HpxMap with fill = nan Then plot using hp.mollview

Parameters:
  • nside (int or None, optional) – The HEALPix nside parameter for the conversion, default is None.

  • intensive (bool, optional) – Whether to plot the PixMap intensively, default is False.

  • **kwargs – Additional keyword arguments to be passed to the plot function.

Return type:

None

rotate(rot: Union[Rotation, Rotator], copy=True) PixMap

Rotate the PixMap’s coordinates by a given rotation.

Parameters:
  • rot (Rotation or Rotator) – The rotation to apply to the coordinates.

  • copy (bool, optional) – If True, return a new PixMap object with the rotated coordinates (default is True).

Returns:

A new PixMap object with the rotated coordinates.

Return type:

PixMap

to_hpxmap(nside: int = 128, fill: float = 0) HpxMap

Convert the PixxMap to a HEALPix map (HpxMap).

Generate a HEALPix map with nside filled it with the velue fill Then, sum the value of each pixels of PixMap whose coordinate are inside the healpix pixel Recommended values for fill are 0 and numpy.nan

Parameters:
  • nside (int, optional) – The HEALPix NSIDE parameter (default is 2**7).

  • fill (float, optional) – The fill value to use for pixels not covered by the PixMap (default is 0).

Returns:

A new HpxMap object representing the PixMap data in HEALPix format.

Return type:

HpxMap

to_hpxpart(nside: int = 128) HpxPart

Convert the PixMap to a Healpix partition (HpxPart).

Generate Healpix pixels with nside for the corresponding coordinate in PixMap.coordinates PixMap’s pixel that correpond to the same HpxPart pixel are summed up.

Parameters:

nside (int, optional) – The HEALPix NSIDE parameter (default is 2**7).

Returns:

A new HpxPart object representing the PixMap data partitioned in HEALPix format.

Return type:

HpxPart