LSST-strong-lensing / slsim

Strong lensing simulation pipeline
MIT License
17 stars 30 forks source link

Integrated group/cluster lenses based on catalogs in the LensPop interface #244

Closed furcelay closed 1 month ago

furcelay commented 1 month ago

Implements a new class ClusterCatalogLens that stores a catalog of lenses based on a group or cluster catalog. This requires two astropy tables: one for the cluster properties, and one for the members, along with a list of galaxies from the SkyPy pipeline.

This class assigns a NFW halo to each cluster based on the richness, and a EPL subhalo to each cluster member by choosing a SkyPy galaxy with similar magnitudes and redshift.

I've also updated the cluster_lens.ipynb notebook to include an example of usage.

review-notebook-app[bot] commented 1 month ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.71%. Comparing base (ec51662) to head (1d9f5a7). Report is 52 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #244 +/- ## ========================================== + Coverage 97.61% 97.71% +0.09% ========================================== Files 67 69 +2 Lines 4361 4546 +185 ========================================== + Hits 4257 4442 +185 Misses 104 104 ``` | [Files](https://app.codecov.io/gh/LSST-strong-lensing/slsim/pull/244?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LSST-strong-lensing) | Coverage Δ | | |---|---|---| | [slsim/Deflectors/DeflectorTypes/nfw\_cluster.py](https://app.codecov.io/gh/LSST-strong-lensing/slsim/pull/244?src=pr&el=tree&filepath=slsim%2FDeflectors%2FDeflectorTypes%2Fnfw_cluster.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LSST-strong-lensing#diff-c2xzaW0vRGVmbGVjdG9ycy9EZWZsZWN0b3JUeXBlcy9uZndfY2x1c3Rlci5weQ==) | `100.00% <100.00%> (ø)` | | | [slsim/Deflectors/\_\_init\_\_.py](https://app.codecov.io/gh/LSST-strong-lensing/slsim/pull/244?src=pr&el=tree&filepath=slsim%2FDeflectors%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LSST-strong-lensing#diff-c2xzaW0vRGVmbGVjdG9ycy9fX2luaXRfXy5weQ==) | `100.00% <100.00%> (ø)` | | | [slsim/Deflectors/cluster\_deflectors.py](https://app.codecov.io/gh/LSST-strong-lensing/slsim/pull/244?src=pr&el=tree&filepath=slsim%2FDeflectors%2Fcluster_deflectors.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LSST-strong-lensing#diff-c2xzaW0vRGVmbGVjdG9ycy9jbHVzdGVyX2RlZmxlY3RvcnMucHk=) | `100.00% <100.00%> (ø)` | | | [slsim/Deflectors/deflector.py](https://app.codecov.io/gh/LSST-strong-lensing/slsim/pull/244?src=pr&el=tree&filepath=slsim%2FDeflectors%2Fdeflector.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LSST-strong-lensing#diff-c2xzaW0vRGVmbGVjdG9ycy9kZWZsZWN0b3IucHk=) | `95.34% <100.00%> (ø)` | | | [slsim/Deflectors/deflectors\_base.py](https://app.codecov.io/gh/LSST-strong-lensing/slsim/pull/244?src=pr&el=tree&filepath=slsim%2FDeflectors%2Fdeflectors_base.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LSST-strong-lensing#diff-c2xzaW0vRGVmbGVjdG9ycy9kZWZsZWN0b3JzX2Jhc2UucHk=) | `85.71% <100.00%> (+1.09%)` | :arrow_up: | | [slsim/Deflectors/richness2mass.py](https://app.codecov.io/gh/LSST-strong-lensing/slsim/pull/244?src=pr&el=tree&filepath=slsim%2FDeflectors%2Frichness2mass.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LSST-strong-lensing#diff-c2xzaW0vRGVmbGVjdG9ycy9yaWNobmVzczJtYXNzLnB5) | `100.00% <100.00%> (ø)` | | | [slsim/Deflectors/velocity\_dispersion.py](https://app.codecov.io/gh/LSST-strong-lensing/slsim/pull/244?src=pr&el=tree&filepath=slsim%2FDeflectors%2Fvelocity_dispersion.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LSST-strong-lensing#diff-c2xzaW0vRGVmbGVjdG9ycy92ZWxvY2l0eV9kaXNwZXJzaW9uLnB5) | `100.00% <100.00%> (ø)` | | | [slsim/lens.py](https://app.codecov.io/gh/LSST-strong-lensing/slsim/pull/244?src=pr&el=tree&filepath=slsim%2Flens.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LSST-strong-lensing#diff-c2xzaW0vbGVucy5weQ==) | `96.98% <ø> (ø)` | | | [slsim/lens\_pop.py](https://app.codecov.io/gh/LSST-strong-lensing/slsim/pull/244?src=pr&el=tree&filepath=slsim%2Flens_pop.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LSST-strong-lensing#diff-c2xzaW0vbGVuc19wb3AucHk=) | `87.30% <ø> (ø)` | | | [slsim/lensed\_system\_base.py](https://app.codecov.io/gh/LSST-strong-lensing/slsim/pull/244?src=pr&el=tree&filepath=slsim%2Flensed_system_base.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LSST-strong-lensing#diff-c2xzaW0vbGVuc2VkX3N5c3RlbV9iYXNlLnB5) | `71.87% <ø> (-0.86%)` | :arrow_down: |
furcelay commented 1 month ago

Thank you @nkhadka21 and @sibirrer for your review! It should be ready to merge now.

nkhadka21 commented 1 month ago

Thank you @nkhadka21 and @sibirrer for your review! It should be ready to merge now.

Thank you very much @furcelay ! I merged it.