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

Implement interface with Candl #137

Merged
merged 7 commits into from
Sep 12, 2024
Merged

Implement interface with Candl #137

merged 7 commits into from
Sep 12, 2024

Conversation

yomori
Copy link
Contributor

@yomori yomori commented Sep 11, 2024

This PR implements a small code that interfaces with Candl , which allows you to interact with both published ACT/SPT likelihoods.

@joezuntz
Copy link
Owner

Thanks! This looks awesome. It looks like there's a data file I need to run this - could you point me to it so I can test locally?

@yomori
Copy link
Contributor Author

yomori commented Sep 11, 2024

Can you let me know which file it's looking for?
I think all the data products come packaged with Candl so if you just do pip install candl-like it should know where/what to look for. I just tried installing from scratch and was able to run the test sampler.

@yomori
Copy link
Contributor Author

yomori commented Sep 11, 2024

(cosmosis) [yomori@midway3-login4 cosmosis-standard-library]$ cosmosis examples/candl_test.ini
Setting up pipeline from parameter file examples/candl_test.ini
---------------------------------------------------------------

Setting up module consistency
------------------------------

Setting up module camb
-----------------------

Setting up module spt3g_2018_lensing
-------------------------------------
Successfully initialised candl likelihood 'SPT-3G 2018 PP, CMB corr. (Pan et al. 2023)' (type: <class 'candl.likelihood.LensLike'>).
Data loaded from '/project/chihway/yomori/envs/cosmosis/lib/python3.12/site-packages/candl/data/SPT3G_2018_Lens_v0/'.
Functional likelihood form: gaussian
--------------------------------------------------------------------------------
It will analyse the following spectra:

pp           (12 bins, bin centres spanning ell = 58.5 - 1735.5)
--------------------------------------------------------------------------------
A data model consisting of 2 transformations has been initialised.
The following transformations will be applied to the theory spectra in this order:

(1) Name: 
    Type: <class 'candl.transformations.common_lensing.BinnedTemplateForeground'>
(2) Name: 
    Type: <class 'candl.transformations.common_lensing.ResponseFunctionM'>
--------------------------------------------------------------------------------
Setup all pipeline modules


Parameter Priors
----------------
cosmological_parameters--omch2                  ~ U(0.08, 0.16)
cosmological_parameters--ombh2                  ~ N(0.02233, 0.00036 ** 2)   [0.01 < x < 0.03]
cosmological_parameters--log1e10as              ~ U(2.9, 3.2)
cosmological_parameters--n_s                    ~ N(0.96, 0.02 ** 2)   [0.86 < x < 1.06]
cosmological_parameters--cosmomc_theta          ~ U(0.9, 1.2)
cosmological_parameters--omega_k                ~ delta(0.0)
cosmological_parameters--mnu                    ~ delta(0.06)
cosmological_parameters--nnu                    ~ delta(3.046)
cosmological_parameters--yhe                    ~ delta(0.245341)
cosmological_parameters--tau                    ~ delta(0.0543)
cosmological_parameters--num_massive_neutrinos  ~ delta(3)
nuisance_parameters--a_fg                       ~ U(0.0, 2.0)

NOTE: You set resume=T in the [runtime] section but the sampler test does not support resuming yet.  I will ignore this option.
****************************************************
* Running sampler 1/1: test
* Running in serial mode.
****************************************************
Running module consistency
Done consistency status = 0 

Running module camb
Done camb status = 0 

Running module spt3g_2018_lensing
Done spt3g_2018_lensing status = 0 

Pipeline ran okay.
Using likelihooods from first run:
 - candl.spt3g_2018_lens
Likelihood candl.spt3g_2018_lens = -5.832610246814148
Prior      =  14.244080111236407
Likelihood =  -5.832610246814148
Posterior  =  8.411469864422259
(cosmosis) [yomori@midway3-login4 cosmosis-standard-library]$ 

@joezuntz
Copy link
Owner

Ah, it auto-installed along with pip, I should have realised. Will test this out, thanks!

@joezuntz joezuntz merged commit 6096352 into joezuntz:main Sep 12, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants