micmac.foregrounds.initmixingmatrix module

Module to initialize the Mixing Matrix with parameter values coming from the SEDs.

class InitMixingMatrix(freqs, ncomp, pos_special_freqs, spv_nodes_b, nside=None, non_param_fgs_mixing_matrix=None, beta_pl=-3.0, beta_mbb=1.54, temp_mbb=20.0)[source]

Bases: object

The main goal of this class is create the initial parameter values, with init_params, which returns the params as a flattened array of values ordered by components, freqs, patches.

Note: * units are K_CMB. * you must be always coherent with the order of fgs:

e.g. if you put first synchrotron and then dust in the mixing matrix (A)

that you pass to this class, then also in the pos_special_freqs, etc.

Parameters:
freqs : array

all input freq bands

ncomp : int

all comps (also cmb)

pos_special_freqs : array

indices of the freqs that are known

spv_nodes_b : array

tree containing info to build spv_templates

nside : int

nside of the map

non_param_fgs_mixing_matrix : array

only the fgs part of mixing matrix (A)

beta_pl : float or array[float]

spectral idx of the synchrotron power law (pl), if given as array it is expected to correspond to different patches

beta_mbb : float or array[float]

spectral idx of the dust modified black body (mbb), if given as array it is expected to correspond to different patches

temp_mbb : float or array[float]

temperature of the dust modified black body (mbb), if given as array it is expected to correspond to different patches

K_rj2K_cmb(nu)[source]

Conversion factor from K_rj to K_CMB at frequency nu

Parameters:
nu : float or array[float]

frequency in GHz

Returns:

K_rj2K_cmb – conversion factor from K_rj to K_CMB at frequency nu

Return type:

float or array[float]

K_rj2K_cmb_nu0(nu, nu0)[source]

Conversion factor at frequency nu divided by the one at frequency nu0

Parameters:
nu : float or array[float]

frequency in GHz

nu0 : float or array[float]

reference frequency in GHz

Returns:

K_rj2K_cmb_nu0 – conversion factor at frequency nu divided by the one at frequency nu0

Return type:

float or array[float]

__init__(freqs, ncomp, pos_special_freqs, spv_nodes_b, nside=None, non_param_fgs_mixing_matrix=None, beta_pl=-3.0, beta_mbb=1.54, temp_mbb=20.0)[source]

The main goal of this class is create the initial parameter values, with init_params, which returns the params as a flattened array of values ordered by components, freqs, patches.

Note: * units are K_CMB. * you must be always coherent with the order of fgs:

e.g. if you put first synchrotron and then dust in the mixing matrix (A)

that you pass to this class, then also in the pos_special_freqs, etc.

Parameters:
freqs : array

all input freq bands

ncomp : int

all comps (also cmb)

pos_special_freqs : array

indices of the freqs that are known

spv_nodes_b : array

tree containing info to build spv_templates

nside : int

nside of the map

non_param_fgs_mixing_matrix : array

only the fgs part of mixing matrix (A)

beta_pl : float or array[float]

spectral idx of the synchrotron power law (pl), if given as array it is expected to correspond to different patches

beta_mbb : float or array[float]

spectral idx of the dust modified black body (mbb), if given as array it is expected to correspond to different patches

temp_mbb : float or array[float]

temperature of the dust modified black body (mbb), if given as array it is expected to correspond to different patches

fgs_SEDs_from_spectral_params()[source]

Get the SEDs of the foregrounds (fgs) from the spectral parameters. Note: In Mixing Matrix we consider first synch then dust

Returns:

fgs_SEDs – SEDs of the fgs

Return type:

array

init_params()[source]

Main function to initialize the mixing matrix B. * if non_param_mixing_matrix (A) is passed that is used to build the init values * otherwise the init values are build from beta_mbb, temp_mbb, beta_pl

Returns:

init_param_values – initial parameter values as a flattened array of values ordered as [Bf1_comp1_patch1, Bf1_comp1_patch2, …, Bf2_comp1_patch1, …, Bf1_comp2_patch1, …, Bfn_comp2_patchn, …]

Return type:

array

init_params_from_fgs_SEDs(fgs_SEDs)[source]

Get params w SEDs for redefined fgs (true B entries) B = A invM in A only fgs entries are needed (no CMB column) in M only the fgs entries are needed (only A_f1) build M

Parameters:
fgs_SEDs : array

SEDs of the fgs

modifiedblackbody(nu0, nu, temp_mbb, beta_mbb)[source]

Scaling law for modified balck body (mbb) in K_CMB

Parameters:
nu0 : float or array[float]

reference frequency in GHz

nu : float or array[float]

frequency in GHz

temp_mbb : array

temperature of the mbb

beta_mbb : array

spectral idx of the mbb

Returns:

analytic_expr – scaling law for dust mbb (in K_CMB)

Return type:

array[float]

powerlaw(nu0, nu, beta_pl)[source]

Scaling lawing law for synchrotron power law (pl) in K_CMB

Parameters:
nu0 : float or array[float]

reference frequency in GHz

nu : float or array[float]

frequency in GHz

beta_pl : array

spectral idx of the pl

Returns:

analytic_expr – scaling law for pl (in K_CMB)

Return type:

array[float]

ud_grade_init_params_to_npatches(params_)[source]

Take one mixing matrix value on the full sky or one per pixel and returns one mixing matrix value per patch.

Parameters:
params : array

mixing matrix values