HealPix¶
- class gdt.core.healpix.HealPix[source]¶
Bases:
objectBase class for HEALPix files
Attributes Summary
Number of pixels in the HEALPix map
The HEALPix resolution
The area of each pixel in square degrees
The reference time
Methods Summary
convolve(model, *args, **kwargs)Convolve the map with a model kernel.
from_data(hpx_arr[, trigtime, filename])Create a HealPix object from healpix arrays
multiply(healpix1, healpix2[, primary, ...])Multiply two HealPix maps and return a new HealPix object
Attributes Documentation
- npix¶
Number of pixels in the HEALPix map
- Type:
(int)
- nside¶
The HEALPix resolution
- Type:
(int)
- pixel_area¶
The area of each pixel in square degrees
- Type:
(float)
- trigtime¶
The reference time
- Type:
(float)
Methods Documentation
- convolve(model, *args, **kwargs)[source]¶
Convolve the map with a model kernel. The model can be a Gaussian kernel or any mixture of Gaussian kernels. Uses healpy.smoothing.
An example of a model kernel with a 50%/50% mixture of two Gaussians, one with a 1-deg width, and the other with a 3-deg width:
def gauss_mix_example(): sigma1 = np.deg2rad(1.0) sigma2 = np.deg2rad(3.0) frac1 = 0.50 return ([sigma1, sigma2], [frac1])
- Parameters:
model (<function>) – The function representing the model kernel
*args – Arguments to be passed to the model kernel function
- Returns:
(
HealPix)
- classmethod from_data(hpx_arr, trigtime=None, filename=None, **kwargs)[source]¶
Create a HealPix object from healpix arrays
- Parameters:
hpx_arr (np.array) – The HEALPix array
trigtime (float, optional) – The reference time for the map
filename (str, optional) – The filename
- Returns:
(
HealPix)
- classmethod multiply(healpix1, healpix2, primary=0, output_nside=128, **kwargs)[source]¶
Multiply two HealPix maps and return a new HealPix object
- Parameters:
healpix1 (
HealPix) – One of the HEALPix maps to multiplyhealpix2 (
HealPix) – The other HEALPix map to multiplyprimary (int, optional) – If 0, use the first map metadata, or if 1, use the second map metadata. Default is 0.
output_nside (int, optional) – The nside of the multiplied map. Default is 128.
- Returns
(
HealPix)