micmac.foregrounds.models module

Module to create customized fgs models starting from the PySM ones.

fgs_freq_maps_from_customized_model_nonparam(nside_map, nside_spv, instrument, fgs_models, idx_ref_freq, return_mixing_mat=False)[source]

Gives non-parametric model built from input (parametric) fgs_model, with a different level of spv of the scaling laws given by nside_spv. The scaling laws (A) come from the freq maps of the input fgs_model downgraded to nside_spv. Returns the final freq maps elements built as d=As.

Parameters:
nside_map : int

nside at which the final maps are built

nside_spv : list

nside at which the spv in the scaling laws is downgraded

instrument : dictionary

dictionary containing the instrument configuration, must have key “frequency” containing a list of the instr freqs

fgs_models : list[str]

list of strings refferring to the PySM fgs models to start from

idx_ref_freq : int

index of the reference frequency to use for normalization in A

return_mixing_mat : bool

if True, return also the mixing matrix

Returns:

  • freq_maps_final (array) – final frequency maps

  • mixing_mat (array) – mixing matrix, returned only if return_mixing_mat is True

get_observation_customized(instrument='', sky=None, noise=False, nside=None, unit='uK_CMB')[source]
NOTE: This is a customized version of the FGBuster function

it takes the PySm Sky directly instead of a string tag

Get a pre-defined instrumental configuration

Parameters:
instrument=''

It can be either a str (see get_instrument()) or an object that provides the following as a key or an attribute.

  • frequency (required)

  • depth_p (required if noise=True)

  • depth_i (required if noise=True)

They can be anything that is convertible to a float numpy array. If only one of depth_p or depth_i is provided, the other is inferred assuming that the former is sqrt(2) higher than the latter.

sky : str of pysm3.Sky

Sky to observe. It can be a pysm3.Sky or a tag to create one.

noise : bool

If true, add Gaussian, uncorrelated, isotropic noise.

nside : int

Desired output healpix nside. It is optional if sky is a pysm3.Sky, and required if it is a str or None.

unit : str

Unit of the output. Only K_CMB and K_RJ (and multiples) are supported.

Returns:

observation – Shape is (n_freq, 3, n_pix)

Return type:

array

get_spectral_params_true_values(nside, model=['s0', 'd0'])[source]

For a given PySM model returns the true values of the spectral parameters. The first fgs must have attribute pl_index and the second mbb_index and mbb_temperature.

Parameters:
nside : int

Healpix nside

model : list of str

PySM model to consider

Returns:

  • beta_pl (float) – Synchrotron spectral index

  • beta_mbb (float) – Dust spectral index

  • temp_mbb (float) – Dust temperature

parametric_sky_customized(fgs_models, nside_map, nside_spv)[source]

Gives d1s1-like model with less spv of the spectral parameters (still parametric) Returns a PySM-like Sky object

Parameters:
fgs_models : list of str

PySM model to consider

nside_map : int

Healpix nside of the final maps

nside_spv : list

Healpix nside of the spectral parameters

Returns:

  • sky (pysm3.Sky) – PySM-like Sky object with the modified spectral parameters

  • new_spectral_params (list of np.array) – List of the new spectral parameters