HpxMap

class erwans3.Astro_tools.HpxMap(value: Quantity, **kwargs)

Bases: PixList

Represents a map of pixels in Healpix format.

Pixlist uses the ring ordering.

Parameters:
  • value (Quantity) – List of pixel values represented as an astropy Quantity.

  • **kwargs (dict, optional) – Additional keyword arguments used for conversion if the input is a PixMap.

Attributes Summary

dir

Return the directional vectors (lmn) of the pixels coordinates.

nside

Return the NSIDE (resolution parameter) of the Healpix map.

pixarea

Return the pixel area of the Healpix map in steradians (sr).

res

Return the pixel resolution of the Healpix map in radians (rad).

Methods Summary

b2t(freq[, copy])

Convert Brightness to Temperature for a given frequency.

plot([mode])

Plot the Healpix map using mollview.

rotate(rot[, copy])

Rotate the HpxMap value by a given rotation.

t2b(freq[, copy])

Convert Temperature to Brightness per steradian for a given frequency

to_extensive([copy])

Convert the HpxMap to an extensive quantity.

to_hpxmap([nside])

Convert the Healpix map to another Healpix map with a specified NSIDE.

to_hpxpart([threshold])

Convert the Healpix map to an HpxPart based on a threshold value.

to_intensive([copy])

Convert the HpxMap to an intensive quantity.

to_pixmap()

Convert the Healpix map to a PixMap.

to_shcoeff([lmax, mmax])

Convert the Healpix map to spherical harmonics coefficients (SHCoeff).

ud_grade(nside_out[, copy])

Upgrade or downgrade the resolution of the Healpix map to a new NSIDE.

Attributes Documentation

dir

Return the directional vectors (lmn) of the pixels coordinates.

Returns:

Array of directional vectors (lmn) with the shape (npix, 3).

Return type:

ndarray

nside

Return the NSIDE (resolution parameter) of the Healpix map.

Returns:

Resolution parameter (NSIDE).

Return type:

int

pixarea

Return the pixel area of the Healpix map in steradians (sr).

Returns:

Pixel area in steradians.

Return type:

Quantity [sr]

res

Return the pixel resolution of the Healpix map in radians (rad).

Returns:

Pixel resolution in radians.

Return type:

Quantity [rad]

Methods Documentation

b2t(freq: Quantity, copy: bool = True) HpxMap

Convert Brightness to Temperature for a given frequency.

If the brightness is in Jy, it is converted to Jy/sr before converting to temperature

Parameters:
  • freq (Quantity) – Frequency of observation.

  • copy (bool, optional) – If True, return a new HpxMap object; otherwise, modify the current object in-place (default is True).

Returns:

A new HpxMap object representing Temperature.

Return type:

HpxMap

plot(mode: Optional[str] = None, **kwargs)

Plot the Healpix map using mollview.

Parameters:
  • mode (str, optional) – Plotting mode. If ‘log’, plot the logarithm of the map values (default is None).

  • **kwargs – Additional keyword arguments passed to the underlying plotting function.

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

Rotate the HpxMap value by a given rotation.

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

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

Returns:

A new HpxMap object with the rotated value.

Return type:

HpxMap

t2b(freq: Quantity, copy: bool = True) HpxMap

Convert Temperature to Brightness per steradian for a given frequency

Parameters:
  • freq (Quantity) – Frequency of observation.

  • copy (bool, optional) – If True, return a new HpxMap object; otherwise, modify the current object in-place (default is True).

Returns:

A new HpxMap object representing Brightness per steradian.

Return type:

HpxMap

to_extensive(copy: bool = True) HpxMap

Convert the HpxMap to an extensive quantity.

ie output unit = input unit * sr if the input unit is intensive

Parameters:

copy (bool, optional) – If True, return a new HpxMap object; otherwise, modify the current object in-place (default is True).

Returns:

A new HpxMap object representing an extensive quantity.

Return type:

HpxMap

to_hpxmap(nside: Optional[int] = None) HpxMap

Convert the Healpix map to another Healpix map with a specified NSIDE.

Parameters:

nside (int or None, optional) – Target NSIDE (resolution) for the output map. If None, the original NSIDE is used (default is None).

Returns:

A new HpxMap object with the upgraded/downgraded map.

Return type:

HpxMap

to_hpxpart(threshold: Union[Quantity, float] = -inf) HpxPart

Convert the Healpix map to an HpxPart based on a threshold value.

If you prefere to specifie the index of the pixel to store into an HpxPart please use the method __getitem__

Parameters:

threshold (Quantity or float, optional) – Threshold value for selecting pixels in the map (default is -infinity).

Returns:

An HpxPart object representing a subset of the Healpix map based on the threshold.

Return type:

HpxPart

to_intensive(copy: bool = True) HpxMap

Convert the HpxMap to an intensive quantity.

ie output unit = input unit /sr

Parameters:

copy (bool, optional) – If True, return a new HpxMap object; otherwise, modify the current object in-place (default is True).

Returns:

A new HpxMap object representing an intensive quantity.

Return type:

HpxMap

to_pixmap()

Convert the Healpix map to a PixMap.

Returns:

A PixMap object representing the pixel values of the Healpix map.

Return type:

PixMap

to_shcoeff(lmax: Optional[int] = None, mmax: Optional[int] = None) SHCoeff

Convert the Healpix map to spherical harmonics coefficients (SHCoeff).

Parameters:
  • lmax (int or None, optional) – Maximum l value for the spherical harmonics coefficients (default is None).

  • mmax (int or None, optional) – Maximum m value for the spherical harmonics coefficients (default is None).

Returns:

Spherical harmonics coefficients representing the Healpix map.

Return type:

SHCoeff

ud_grade(nside_out: int, copy: bool = True) HpxMap

Upgrade or downgrade the resolution of the Healpix map to a new NSIDE.

Parameters:
  • nside_out (int) – Target NSIDE (resolution) for the output map.

  • copy (bool, optional) – If True, return a new HpxMap object with the upgraded/downgraded map (default is True).

Returns:

A new HpxMap object with the upgraded/downgraded map.

Return type:

HpxMap