HpxPart
- class erwans3.Astro_tools.HpxPart(value: Quantity, nside: int, indices: Union[int, ndarray])
Bases:
PixListObject representing a subpart of a Healpix map.
It has the attribute nside and indices (ring order is supposed). So that the values can be associated to their pixel.
- Parameters:
Attributes Summary
Return the directional vectors (lmn) of the pixels coordinates.
Return the NSIDE (resolution parameter) of the Healpix map.
Return the pixel area of the Healpix map in steradians (sr).
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 HpxPart object by a given rotation.
t2b(freq[, copy])Convert Temperature to Brightness per steradian for a given frequency
to_extensive([copy])Convert the HpxPart to an extensive quantity.
to_hpxmap([nside, fill])Convert the HpxPart object to an HpxMap object.
to_intensive([copy])Convert the HpxPart to an intensive quantity.
Convert the HpxPart object to a PixMap object.
ud_grade(nside_out[, copy])Perform an upsampling or downsampling of the HpxPart object to a target 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:
- nside
Return the NSIDE (resolution parameter) of the Healpix map.
- Returns:
Resolution parameter (NSIDE).
- Return type:
- 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 = False) HpxPart
Convert Brightness to Temperature for a given frequency.
If the brightness is in Jy, it is converted to Jy/sr before converting to temperature
- plot(mode: Optional[str] = None, **kwargs)
Plot the Healpix map using mollview.
the map is converted to HpxMap first
- 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) HpxPart
Rotate the HpxPart object by a given rotation.
- Parameters:
- Returns:
A rotated HpxPart object.
- Return type:
Notes
This method first converts the HpxPart object to a PixMap, performs the rotation operation on the PixMap, and then converts it back to an HpxPart object. If copy is set to False, it modifies the current HpxPart object in-place with the rotated values.
- t2b(freq: Quantity, copy: bool = False) HpxPart
Convert Temperature to Brightness per steradian for a given frequency
- to_extensive(copy: bool = True) HpxPart
Convert the HpxPart to an extensive quantity.
ie output unit = input unit * sr if the input unit is intensive
- to_hpxmap(nside: Optional[int] = None, fill: float = 0) HpxMap
Convert the HpxPart object to an HpxMap object.
- Parameters:
- Returns:
An HpxMap object representing the Healpix map.
- Return type:
Notes
This method constructs an HpxMap object using the pixel values and indices from the current HpxPart object. If a target nside is provided, it performs a grade operation to achieve the desired resolution.
- to_intensive(copy: bool = True) HpxPart
Convert the HpxPart to an intensive quantity.
ie output unit = input unit /sr
- to_pixmap() PixMap
Convert the HpxPart object to a PixMap object.
- Returns:
A PixMap object representing the pixel map.
- Return type:
Notes
This method constructs a PixMap object using the pixel values and coordinates from the current HpxPart object.
- ud_grade(nside_out: int, copy: bool = True) HpxPart
Perform an upsampling or downsampling of the HpxPart object to a target nside.
- Parameters:
- Returns:
An HpxPart object with the specified nside.
- Return type:
Notes
This method performs either an upsampling or downsampling operation on the HpxPart object to match the target nside. It adjusts the pixel values and indices accordingly. If copy is set to False, it modifies the current HpxPart object in-place with the new resolution.