Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SO Foreground marginalization #158

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft

SO Foreground marginalization #158

wants to merge 18 commits into from

Conversation

HTJense
Copy link
Member

@HTJense HTJense commented Nov 13, 2023

This is a work-in-progress for the foreground marginalization & fg-marginalized likelihood codes for Simons Observatory. The methodology is comparable to the original pliklite code for Planck (gibbs sampling of the CMB bandpowers).

Current steps that are to be done by the end of this PR:

  • Create a working script & internal code mechanics for the CMB extraction from SO data
  • Setup the initial preset parameters (e.g. parameter ranges, restrictions, extraction ranges, etc.) for SO.
  • Utilities for plotting the results & compressing the result into a new cmb-only sacc file.
  • A CMB-only likelihood for the cmb-only data.

Steps that might be needed but can be done at a later stage:

  • The full systematics modeling (the current implementation only allows for calibration & bandpass integration uncertainties, but we might have alm rotation uncertainties or beam leakage, which aren't included yet).

PR is mainly for tracking progress updates.
Will request a review once the branch is in a state where it can be merged.

@codecov-commenter
Copy link

codecov-commenter commented Nov 13, 2023

Codecov Report

Merging #158 (0fb9a5a) into master (1b7c793) will decrease coverage by 4.74%.
The diff coverage is 19.79%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #158      +/-   ##
==========================================
- Coverage   74.61%   69.87%   -4.74%     
==========================================
  Files          33       36       +3     
  Lines        2029     2221     +192     
==========================================
+ Hits         1514     1552      +38     
- Misses        515      669     +154     
Files Coverage Δ
soliket/__init__.py 100.00% <100.00%> (ø)
soliket/cmbonly/__init__.py 100.00% <100.00%> (ø)
soliket/mflike/__init__.py 100.00% <100.00%> (ø)
soliket/cmbonly/cmbonly.py 20.48% <20.48%> (ø)
soliket/mflike/ForegroundMarginalizer.py 16.98% <16.98%> (ø)

@HTJense HTJense marked this pull request as ready for review November 15, 2023 11:49
@HTJense HTJense added this to the November Hack milestone Nov 15, 2023
@HTJense HTJense self-assigned this Nov 15, 2023
@HTJense HTJense added enhancement New feature or request mflike Related to mflike likelihood labels Nov 15, 2023
@HTJense HTJense marked this pull request as draft November 15, 2023 17:15
Copy link
Collaborator

@itrharrison itrharrison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks generally good! I think that I would be happy to merge after you add a test.

Ideally the test would check against both a fixed likelihood value, and also verify that the CMBOnly likelihood is consistent with what one would expect from the MFLike likelihood (i.e. the validation you have done elsewhere). But just against a fixed value would do if that isn't easy.

In the long run I am also not convinced that the foregroundmarginalizer stuff belongs in SOLikeT. It seems like it would be better as its own package, with SOLikeT as a requirement. Happy to do that some time in the future though.

from ..ps import BinnedPSLikelihood


class CMBonly(BinnedPSLikelihood):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would CMBOnly be the correct camel case? :-p

@cmbant
Copy link
Collaborator

cmbant commented Aug 7, 2024

I would have thought the code for doing the marginalization would be better a separate package, and just include the public-facing pre-marginalized likelihood in SOLikeT? (or it could go in mflike)

Not sure why you have np.exp(rat) in the acceptance criterion (can't use default Cobaya sampling for some reason?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mflike Related to mflike likelihood
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants