PrecomputedAlms

class so_pysm_models.PrecomputedAlms(filename, input_units='uK_CMB', input_reference_frequency=None, nside=None, target_shape=None, target_wcs=None, from_cl=False, from_cl_seed=None, precompute_output_map=True, has_polarization=True, map_dist=None)[source] [edit on github]

Bases: object

Generic component based on Precomputed Alms

Load a set of Alms from a FITS file and generate maps at the requested resolution and frequency assuming the CMB black body spectrum. A single set of Alms is used for all frequencies requested by PySM, consider that PySM expects the output of components to be in uK_RJ. See more details at https://so-pysm-models.readthedocs.io/en/latest/so_pysm_models/models.html

Also note that the Alms are clipped to 3*nside-1 to avoid artifacts from high-ell components which cannot be properly represented by a low-nside map.

Parameters
filenamestring

Path to the input Alms in FITS format

input_unitsstring

Input unit strings as defined by pysm.convert_units, e.g. K_CMB, uK_RJ, MJysr

input_reference_frequency: float

If input units are K_RJ or Jysr, the reference frequency

nsideint

HEALPix NSIDE of the output maps

from_clbool

If True, the input file contains C_ell instead of a_lm, they should provided with the healpy old ordering TT, TE, TB, EE, EB, BB, sorry.

from_cl_seedint

Seed set just before synalm to simulate the alms from the C_ell, necessary to set it in order to get the same input map for different runs only used if from_cl is True

precompute_output_mapbool

If True (default), Alms are transformed into a map in the constructor, if False, the object only stores the Alms and generate the map at each call of the signal method, this is useful to generate maps convolved with different beams

has_polarizationbool

whether or not to simulate also polarization maps Default: True

Methods Summary

compute_output_map(alm)

get_emission(freqs[, fwhm, weights, ...])

Return map in uK_RJ at given frequency or array of frequencies

Methods Documentation

compute_output_map(alm)[source] [edit on github]
get_emission(freqs: Unit('GHz'), fwhm: [Unit('arcmin'), None] = None, weights=None, output_units=Unit('uK_RJ'))[source] [edit on github]

Return map in uK_RJ at given frequency or array of frequencies

Parameters
freqslist or ndarray

Frequency or frequencies in GHz at which compute the signal

fwhmfloat (optional)

Smooth the input alms before computing the signal, this can only be used if the class was initialized with precompute_output_map to False.

output_unitsstr

Output units, as defined in pysm.convert_units, by default this is “uK_RJ” as expected by PySM.

Returns
——-
output_mapsndarray

Output maps array with the shape (num_freqs, 1 or 3 (I or IQU), npix)