Skip to content

Commit

Permalink
add option for bandshift_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
thibautlouis committed May 5, 2023
1 parent 2ed3d9b commit be2e8d5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pspipe_utils/best_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,12 @@ def get_all_best_fit(spec_name_list, l_th, cmb_dict, fg_dict, spectra, nl_dict=N
return l_th, ps_all_th


def get_foreground_dict(ell, external_bandpass, fg_components, fg_params, fg_norm=None):
def get_foreground_dict(ell,
external_bandpass,
fg_components,
fg_params,
fg_norm=None,
band_shift_dict=None):
"""This function computes the foreground power spectra for a given set of multipoles,
foreground components and parameters. It uses mflike, note that mflike do not
support foreground in tb, and bb therefore we include it here.
Expand Down Expand Up @@ -246,6 +251,8 @@ def get_foreground_dict(ell, external_bandpass, fg_components, fg_params, fg_nor
fg_norm: dict
the foreground normalisation. By default, {"nu_0": 150.0, "ell_0": 3000, "T_CMB": 2.725}
band_shift: dict
a dictionnary with bandpass shift parameter
"""

ThFo = th_mflike.TheoryForge()
Expand All @@ -254,8 +261,8 @@ def get_foreground_dict(ell, external_bandpass, fg_components, fg_params, fg_nor
# MFLike conventions.
ThFo.bands = {f"{k}_s0": {"nu": v[0], "bandpass": v[1]} for k, v in external_bandpass.items()}
ThFo.experiments = external_bandpass.keys()
params = {f"bandint_shift_{exp}": 0.0 for exp in ThFo.experiments}
ThFo._bandpass_construction(**params)
band_shift_dict = band_shift_dict or {f"bandint_shift_{exp}": 0.0 for exp in ThFo.experiments}
ThFo._bandpass_construction(**band_shift_dict)

fg_norm = fg_norm or {"nu_0": 150.0, "ell_0": 3000, "T_CMB": 2.725}
fg_model = {"normalisation": fg_norm, "components": fg_components}
Expand Down

0 comments on commit be2e8d5

Please sign in to comment.