HealPixEffectiveArea¶
- class gdt.core.healpix.HealPixEffectiveArea[source]¶
Bases:
HealPixClass for effective area HEALPix files
Attributes Summary
The effective area HEALPix array
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.
effective_area(az, zen)Calculate the effective area at a given point.
from_cosine(az, zen, eff_area_normal[, ...])Create an object with effective area that has a cosine angular depndence.
from_data(hpx_arr[, trigtime, filename])Create a HealPix object from healpix arrays
from_uniform(eff_area[, nside, filename])Create an object with uniform effective area.
make_grid([numpts_az, numpts_zen])Return the effective area mapped to a grid.
multiply(healpix1, healpix2[, primary, ...])Multiply two HealPix maps and return a new HealPix object
sum(healpix1, healpix2[, primary, output_nside])Add two HealPixEffectiveArea maps and return a new object
Attributes Documentation
- eff_area¶
The effective area HEALPix array
- Type:
(np.array)
- 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)¶
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)
- effective_area(az, zen)[source]¶
Calculate the effective area at a given point. This function interpolates the map at the requested point rather than providing the vale at the nearest pixel center.
- Parameters:
az (float) – The Azimuth
zen (float) – The Zenith
- Returns:
(float)
- classmethod from_cosine(az, zen, eff_area_normal, coeff=1.0, nside=64, filename=None, **kwargs)[source]¶
Create an object with effective area that has a cosine angular depndence.
- Parameters:
az (float) – The azimuth of the detector normal
zen (float) – The zenith of the detector normal
eff_area_normal (float) – The effective area at the detector normal
coeff (float, optional) – The cosine coefficient to use. Default is 1
nside (int, optional) – The nside of the HEALPix to make. Default is 64
filename (str, optional) – The filename
- Returns:
- classmethod from_data(hpx_arr, trigtime=None, filename=None, **kwargs)¶
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 from_uniform(eff_area, nside=64, filename=None, **kwargs)[source]¶
Create an object with uniform effective area.
- Parameters:
eff_area (float) – The effective area.
nside (int, optional) – The nside of the HEALPix to make.
filename (str, optional) – The filename
- Returns:
- make_grid(numpts_az=360, numpts_zen=180)[source]¶
Return the effective area mapped to a grid.
- Parameters:
numpts_az (int, optional) – The number of grid points along the Az axis. Default is 360.
numpts_zen (int, optional) – The number of grid points along the Zen axis. Default is 180.
- Returns:
3-tuple containing –
- np.array: The effective area array with shape
(
numpts_zen,numpts_az)
np.array: The Az grid points
np.array: The Zen grid points
- classmethod multiply(healpix1, healpix2, primary=0, output_nside=128, **kwargs)¶
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)
- classmethod sum(healpix1, healpix2, primary=0, output_nside=128, **kwargs)[source]¶
Add two HealPixEffectiveArea maps and return a new object
- Parameters:
healpix1 (
HealPixEffectiveArea) – One of the HEALPix maps to sumhealpix2 (
HealPixEffectiveArea) – The other HEALPix map to sumprimary (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