Skip to content

Commit

Permalink
consistent handling of delta_beta
Browse files Browse the repository at this point in the history
  • Loading branch information
arahlin committed Apr 14, 2023
1 parent 1a3f831 commit 5e1e7a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions xfaster/xfaster_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -4354,7 +4354,7 @@ def get_model_spectra(self, qb, cbl, cls_noise=None, cond_noise=None):
if any([k.startswith(comp + "_") for k in qb]):
comps += [comp]

delta_beta = 0.0
delta_beta = None
if "delta_beta" in qb:
# Evaluate fg at spectral index pivot for derivative
# in Fisher matrix, unless delta is True
Expand Down Expand Up @@ -4402,12 +4402,12 @@ def get_model_spectra(self, qb, cbl, cls_noise=None, cond_noise=None):
tag1, tag2 = self.map_pairs[xname]

# extract qb's for the component spectrum
if comp == "cmb" or (comp == "fg" and delta_beta == 0.0):
if comp == "cmb" or (comp == "fg" and delta_beta is None):
qbs = qb[stag]
if spec in ["ee", "bb"]:
qbm = qb[mstag]

elif comp == "fg" and delta_beta != 0.0:
elif comp == "fg" and delta_beta is not None:
# beta scaling for foreground model
# beta_scale = self.fg_scales[xname][1] ** delta_beta
beta_scale = 1 + self.fg_scales[xname][2] * delta_beta
Expand Down Expand Up @@ -4923,7 +4923,7 @@ def fisher_calc(
delta_beta_prior : float
The width of the prior on the additive change from beta_ref. If you
don't want the code to fit for a spectral index different
from beta_ref, set this to be a very small value (O(1e-10)).
from beta_ref, set this to be None.
null_first_cmb : bool
Keep first CMB bandpowers fixed to input shape (qb=1).
use_precalc : bool
Expand Down Expand Up @@ -4985,7 +4985,7 @@ def fisher_calc(
if windows:
self.clear_precalc()

delta_beta = 0.0
delta_beta = None
if "delta_beta" in qb:
delta_beta = qb["delta_beta"][0]

Expand Down Expand Up @@ -6091,7 +6091,7 @@ def get_bandpowers(
delta_beta_prior : float
The width of the prior on the additive change from beta_ref. If you
don't want the code to fit for a spectral index different
from beta_ref, set this to be a very small value (O(1e-10)).
from beta_ref, set this to be None.
cond_noise : float
The level of regularizing noise to add to EE and BB diagonals.
cond_criteria : float
Expand Down
4 changes: 2 additions & 2 deletions xfaster/xfaster_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def xfaster_run(
return_cls=False,
fix_bb_transfer=False,
null_first_cmb=False,
delta_beta_prior=0.5,
delta_beta_prior=None,
like_profiles=False,
like_profile_sigma=3.0,
like_profile_points=100,
Expand Down Expand Up @@ -401,7 +401,7 @@ def xfaster_run(
delta_beta_prior : float
The width of the prior on the additive change from beta_ref. If you
don't want the code to fit for a spectral index different
from beta_ref, set this to be a very small value (O(1e-10)).
from beta_ref, set this to be None.
like_profiles : bool
If True, compute profile likelihoods for each qb, leaving all
others fixed at their maximum likelihood values. Profiles are
Expand Down

0 comments on commit 5e1e7a9

Please sign in to comment.