Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
3f00c25
ymap_ps.py test
borisbolliet Feb 2, 2021
12d4dda
bp + template fitting
borisbolliet Feb 14, 2021
0ed2ac3
Merge branch 'master' into ymap_power_spectrum
borisbolliet Feb 14, 2021
edec54d
classy_sz.py
borisbolliet Feb 23, 2021
d51ba53
Update classy_sz.py
borisbolliet Feb 23, 2021
93b3bce
Update sz_input.yaml
borisbolliet Feb 23, 2021
33cd435
classy_sz
borisbolliet Feb 23, 2021
6342102
dbug
borisbolliet Feb 23, 2021
1d9ece4
Update classy_sz.py
borisbolliet Feb 23, 2021
f34ce68
Update classy_sz.py
borisbolliet Feb 23, 2021
e0f351e
Update classy_sz.py
borisbolliet Feb 23, 2021
7dac7c6
test ymap ps
borisbolliet Feb 25, 2021
6096bfc
planck data files
borisbolliet Feb 26, 2021
42d40af
corrected struct clean up error
borisbolliet Feb 26, 2021
985d8c8
workflow test
borisbolliet Feb 26, 2021
bf0f5ef
Update testing.yml
borisbolliet Feb 26, 2021
dad0a59
simplified
borisbolliet Feb 26, 2021
a9bff48
Update install_class_sz_linux.sh
borisbolliet Feb 27, 2021
48b6a79
Update install_class_sz_linux.sh
borisbolliet Feb 27, 2021
1d86c7f
Update testing.yml
borisbolliet Feb 27, 2021
ebc1d1a
Update install_class_sz_linux.sh
borisbolliet Feb 27, 2021
7996979
Update install_class_sz_linux.sh
borisbolliet Feb 27, 2021
9584c34
Update install_class_sz_linux.sh
borisbolliet Feb 27, 2021
d0a4f9e
Update install_class_sz_linux.sh
borisbolliet Feb 27, 2021
47e0274
Update install_class_sz_linux.sh
borisbolliet Feb 27, 2021
50609e1
Update install_class_sz_linux.sh
borisbolliet Feb 27, 2021
f233dd3
Update install_class_sz_linux.sh
borisbolliet Feb 27, 2021
16f66ed
Update install_class_sz_linux.sh
borisbolliet Feb 27, 2021
ac092cb
Update install_class_sz_linux.sh
borisbolliet Feb 27, 2021
ddece86
porting to stampede2
borisbolliet May 3, 2021
ab3cdbd
Update setup.py
borisbolliet May 3, 2021
e7d46b1
Update setup.py
borisbolliet May 3, 2021
56e9b20
Update setup.py
borisbolliet May 3, 2021
41e128c
Update setup.py
borisbolliet May 3, 2021
11a770e
minimal ymap ps
borisbolliet May 3, 2021
fa2692e
class_sz cluster counts likelihood test
borisbolliet Jun 6, 2021
52f0dd9
Update binned_cc.py
borisbolliet Jun 6, 2021
96a642e
ymap ps
borisbolliet Jun 7, 2021
5de95ff
Update .gitignore
borisbolliet Jul 28, 2021
a6c1561
Merge branch 'master' into ymap_power_spectrum
borisbolliet Jul 28, 2021
d164c72
fixes to clusters lkl
borisbolliet Jul 28, 2021
218dca0
package_path error
borisbolliet Jul 28, 2021
5715b79
test work, should match nick's version
borisbolliet Jul 29, 2021
4ff825d
Update .gitignore
borisbolliet Nov 19, 2021
b83e78a
Update Nz_szcountsf90_vs_class_sz_vs_nemo_comparison.ipynb
borisbolliet Dec 1, 2021
813e464
cosmopower wrapper
borisbolliet May 17, 2022
1697ca5
class
borisbolliet May 17, 2022
aaa2b74
just renamed the cosmopower yaml file
borisbolliet May 24, 2022
29f11a0
planck lkl
borisbolliet May 25, 2022
6cd6b88
test files in binned_clusters
borisbolliet Jun 7, 2022
38835ad
fast dr4
borisbolliet Oct 16, 2022
c47b0ba
Update utils.py
borisbolliet Oct 19, 2022
7e6820e
cosmopower wrapper
borisbolliet Nov 3, 2022
24e188a
cosmopower wrapper + last snr bin debug
borisbolliet Dec 6, 2022
d5519c0
faster pk from cosmopower and unbinned sz counts lkl
borisbolliet Dec 20, 2022
47540af
Update cosmopower.py
borisbolliet Dec 20, 2022
52eb5fe
update get cl
borisbolliet Jan 10, 2023
956d497
Update cosmopower.py
borisbolliet Jan 10, 2023
ddd832e
Update cosmopower.py
borisbolliet Jan 10, 2023
f5f19d3
added covmats
borisbolliet Jan 11, 2023
22af55f
Update lensing.py
borisbolliet Apr 2, 2023
8110582
Update __init__.py
borisbolliet Apr 2, 2023
1f28de2
Update binned_cc.py
borisbolliet Apr 2, 2023
47f38b3
Update __init__.py
borisbolliet Apr 6, 2023
77f07ca
Update sz_input.yaml
borisbolliet May 22, 2023
74596fa
Create sz_input_fast.yaml
borisbolliet May 22, 2023
f3a0fdf
adding yg things for ola's work
borisbolliet Sep 7, 2023
7ca6eec
first working draft
Feb 16, 2024
7912883
Merge remote-tracking branch 'origin/dev-ymap_power_spectrum' into de…
Feb 16, 2024
4929f00
added parameter yaml file
Feb 16, 2024
f7a2fe2
fixed binning with namaster
Jun 24, 2024
74433b8
Merge branch 'dev-cibxkappa' of https://github.com/Yogesh3/SOLikeT in…
Jun 24, 2024
a326324
rearranged and cleaned up org. Added yml input
Jun 24, 2024
daeb577
added namaster mode decoupling
Jul 25, 2024
6210031
added yaml files for each number of params
Jul 31, 2024
e5d9e89
messing with using my old theory instead of boris's theory
Aug 3, 2024
7ccc3e0
using Boris's theory class and changed param names without hyphen
Aug 6, 2024
6f18d74
multifrequency fits with mcm is correctly implemented and working
Sep 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
Expand All @@ -27,10 +27,11 @@ jobs:

- name: install reqs
run: |
conda install pip compilers pytest pyccl cython
conda install pip compilers pytest pyccl cython gsl
pip install gsl
pip install cobaya

env:
env:
MATRIX_OS: ${{ matrix.os }}

- name: Install classy
Expand All @@ -44,6 +45,17 @@ jobs:
env:
MATRIX_OS: ${{ matrix.os }}

- name: Install classy_sz
run: |
if [[ ${MATRIX_OS} == "macos-latest" ]]; then
. ci_scripts/install_class_sz_osx.sh
else
. ci_scripts/install_class_sz_linux.sh
fi
python -c "import classy_sz; print(classy_sz)"
env:
MATRIX_OS: ${{ matrix.os }}

- name: install
run: |
pip install .
Expand Down
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,42 @@ venv.bak/

# mypy
.mypy_cache/

# ymap
.DS_Store
soliket/ymap/chains/*
soliket/ymap/run_scripts/*
soliket/ymap/notebooks/*
#soliket/ymap/input_files/
soliket/ymap/input_files/total-planck-collab-15_benchmark_montepython-3.3_evaluate_trispectrum.input.yaml
soliket/ymap/input_files/total-planck-collab-15_benchmark_montepython-3.3.input.yaml
soliket/ymap/input_files/sz_ps_template_evaluate_trispectrum_and_sz_template.yaml

#cluster counts
dndzdm_bins_m_center.txt
dndzdy.txt
dndzdy_bins_y_center.txt
dndzdy_bins_z_center.txt
soliket/sz_binned_cluster_counts/chains
soliket/sz_binned_cluster_counts/data

soliket/binned_clusters/data

soliket/clusters/data
soliket/binned_clusters/data/so/MFMF_WebSkyHalos_A10tSZ_3freq_tiles/MFMF_WebSkyHalos_A10tSZ_3freq_tiles_mass.fits
soliket/binned_clusters/data/so/MFMF_WebSkyHalos_A10tSZ_3freq_tiles/selFn/tileAreas.txt
soliket/cosmopower/chains
soliket/binned_clusters/chains/test.updated.yaml
soliket/binned_clusters/chains/test_camb.updated.yaml

soliket/binned_clusters/chains/*
soliket/clusters/chains/*
soliket/clusters/notebooks/*

soliket/cosmopower/data
*.yaml
soliket/cosmopower/covmats/desy1_joint_cosmopower_301122.covmat
soliket/cosmopower/covmats/lensing_H0wide_harlap_emunotauzpk_omcwide.covmat
soliket/cosmopower/covmats/desy1_joint_plancklensing2018_lenspriors_BAO_cosmopower.covmat

yg*
92 changes: 1 addition & 91 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,96 +12,6 @@ git clone https://github.com/simonsobs/soliket
cd soliket
pip install -e .
```
You will also need to either run
```
pip install camb
```
or, for a fuller cobaya install:
```
cobaya-install cosmo -p /your/path/to/cobaya/packages
```
To run tests, you will also need the original LAT_MFlike package:
```
pip install git+https://github.com/simonsobs/lat_mflike
```
Then, you can run tests with
```
pip install pytest
pytest -v .
```

Please raise an issue if you have trouble installing or any of the tests fail.

## Contains

This repo currently implements the following specific likelihoods:

* `MFLike`: the SO LAT multi-frequency TT-TE-EE power spectrum likelihood. (Adapted from, and tested against, the original implementation [here](https://github.com/simonsobs/lat_mflike)).
* `ClusterLikelihood`: An SZ-cluster count likelihood based on the original ACT SZ clusters likelihood.
* `LensingLikelihood`: Lensing power-spectrum likelihood, adapted from [here](https://github.com/simonsobs/so-lenspipe/blob/6abdc185764894cefa76fd4666243669d7e8a4b0/bin/SOlikelihood/cobayalike.py#L80).
* `LensingLiteLikelihood`: A no-frills, simple $\chi^2$ lensing power spectrum.

## Extending

Please see [these guidelines](guidelines.md) for instructions on bringing a new likelihood into **soliket**.

## Usage

These likelihoods are designed for direct use with **cobaya**. This means that
they may be specified directly when creating a **cobaya** `Model`. E.g., if
you wanted to compute the likelihood of the simulated lensing data, you could do the following:

```python

from cobaya.yaml import yaml_load
from cobaya.model import get_model

info_yaml = """
debug: True

likelihood:
soliket.LensingLiteLikelihood:
sim_number: 1
stop_at_error: True

params:
# Sampled
logA:
prior:
min: 2.6
max: 3.5
proposal: 0.0036
drop: True
latex: \log(10^{10} A_\mathrm{s})
As:
value: "lambda logA: 1e-10*np.exp(logA)"
latex: A_\mathrm{s}
ns:
prior:
min: 0.9
max: 1.1
proposal: 0.0033
latex: n_\mathrm{s}


theory:
camb:
stop_at_error: False
extra_args:
lens_potential_accuracy: 1

"""

info = yaml_load(info_yaml)
model = get_model(info)
```
The likelihood could then be either directly computed as
```python
model.loglike(dict(logA=3.0, ns=0.98))
```
and used outside of **cobaya** (e.g., directly passed to **emcee** or some other
sampler or optimizer), or this same YAML setup (with an additional 'sampler' block specified)
could be used as input to `cobaya-run` to have **cobaya** manage the sampling.

For more information on how to use **cobaya**, check out its [documentation](http://cobaya.readthedocs.io).

This is a minimal soliket version to run with cosmopower emulators.
20 changes: 20 additions & 0 deletions ci_scripts/install_class_sz_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

sudo apt-get install libgsl-dev
cd /home/runner/work/SOLikeT/SOLikeT/
wget ftp://ftp.gnu.org/gnu/gsl/gsl-2.6.tar.gz
tar -zxvf gsl-2.6.tar.gz
cd gsl-2.6
./configure --prefix=/home/runner/work/SOLikeT/SOLikeT/gsl-2.6
make
make install
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/runner/work/SOLikeT/SOLikeT/gsl-2.6/lib/
export LD_LIBRARY_PATH
cd ..
ls /home/runner/work/SOLikeT/SOLikeT/gsl-2.6/lib
git clone https://github.com/borisbolliet/class_sz.git
cd class_sz
make -j4

# at this point the make file leaves you in the python dir
cd ..
17 changes: 17 additions & 0 deletions ci_scripts/install_class_sz_osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

export CONDA_BUILD_SYSROOT=/

rm -rf class_sz
git clone --depth=1000 https://github.com/borisbolliet/class_sz.git
cd class_sz

sed -i.bak -e 's/^CC/#CC/g' Makefile
sed -i.bak -e 's/^OPTFLAG =/OPTFLAG = ${CFLAGS} ${LDFLAGS}/g' Makefile
sed -i.bak -e 's/^#CCFLAG +=/CCFLAG +=/g' Makefile
sed -i.bak -e 's/^#CCFLAG =/CCFLAG =/g' Makefile

make -j4

# at this point the make file leaves you in the python dir
cd ..
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,27 @@
version="0.0",
description="SO Likelihoods & Theories",
zip_safe=False,
packages=["soliket", "soliket.tests", "soliket.clusters"],
# packages=["soliket", "soliket.tests", "soliket.clusters", "soliket.ymap"],
packages=["soliket"],#, "soliket.tests","soliket.clusters","soliket.ymap"],
package_data={
"soliket": [
"*.yaml",
"*.bibtex",
# "data/simulated*/*.txt",
"clusters/data/*",
"clusters/data/selFn_equD56/*",
"lensing/data/*.txt",
# "clusters/data/*",
# "clusters/data/selFn_equD56/*",
# "ymap/data/*.txt"

]
},
install_requires=[
"astropy",
"scikit-learn",
"cobaya",
"sacc",
"pyccl",
"fgspectra @ git+https://github.com/simonsobs/fgspectra@master#egg=fgspectra",
"mflike @ git+https://github.com/simonsobs/lat_mflike"
# "pyccl",
# "fgspectra @ git+https://github.com/simonsobs/fgspectra@master#egg=fgspectra",
# "mflike @ git+https://github.com/simonsobs/LAT_MFLike"
],
test_suite="soliket.tests",
)
20 changes: 10 additions & 10 deletions soliket/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from .lensing import LensingLiteLikelihood, LensingLikelihood
from .gaussian import GaussianLikelihood, MultiGaussianLikelihood
from .ps import PSLikelihood, BinnedPSLikelihood
from .clusters import ClusterLikelihood
from .mflike import MFLike
try:
import pyccl as ccl
from .ccl import CCL
from .cross_correlation import CrossCorrelationLikelihood
except ImportError:
print('Skipping CCL module as pyCCL is not installed')
pass
# from .ps import PSLikelihood, BinnedPSLikelihood
# from .clusters import ClusterLikelihood
# from .mflike import MFLike
# from .ccl import CCL
# from .ymap.ymap_ps import SZLikelihood, SZForegroundTheory
## from .sz_binned_cluster_counts.binned_cc import binned_cc_likelihood
# from .classy_cibxkappa import classy_cibxkappa
from .cibxlensing import CIBxKAPPA_Likelihood
# from .yg.galaxy_x_galaxy import GXG_Likelihood
# from .yg.y_x_galaxy import YXG_Likelihood
Loading