Skip to content

Weak lensing mass mapping and cosmological parameter estimation

Notifications You must be signed in to change notification settings

prob-ml/blissWL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blissWL

This repository is part of the Bayesian Light Source Separator (BLISS) software family. It implements two forms of neural probabilistic weak lensing inference. The first infers convergence maps from images, and the second infers LambdaCDM parameters from convergence maps.

Installation

Create a virtual environment and install dependencies:

uv venv
source .venv/bin/activate
uv sync

For development dependencies (Jupyter, linting, etc.):

uv sync --group dev

Images to maps

This module implements neural posterior estimation (NPE) for inferring weak lensing shear and convergence from LSST-like images. It supports two applications:

  1. DC2: Infer tomographic mass maps for the DC2 Simulated Sky Survey
  2. descwl-shear-sims: Infer constant shear from images generated with descwl-shear-sims

DC2

Generate catalog

python -u images_to_maps/dc2/generate_catalog.py

Train MassMapEncoder

python -m images_to_maps.dc2.train

Or with Hydra config override:

python -m images_to_maps.dc2.train --config-path=. --config-name=config_train_npe

Notebooks

  • Results: images_to_maps/dc2/results/credibleintervals.ipynb, posteriormeanmaps.ipynb
  • Exploratory: images_to_maps/dc2/exploratory/dc2imageandmaps.ipynb, ellipticity.ipynb, galaxyproperties.ipynb, twopoint.ipynb

descwl-shear-sims

Train ScalarShearEncoder

python -m images_to_maps.descwl.train

Or with Hydra config override:

python -m images_to_maps.descwl.train --config-path=. --config-name=config_train_npe

Run AnaCal

Configure settings in images_to_maps/descwl/config_run_anacal.yaml.

python -u images_to_maps/descwl/run_anacal.py

Notebooks

  • Results: images_to_maps/descwl/results/compute_npe_credibleintervals.py, credibleintervals.ipynb, scatterplots.ipynb
  • Exploratory: images_to_maps/descwl/exploratory/images.ipynb

View training logs

Training logs are saved to TensorBoard. View with:

tensorboard --logdir=images_to_maps/dc2/results

or for descwl:

tensorboard --logdir=images_to_maps/descwl/results

Maps to cosmology

This module implements NPE for inferring cosmological parameters from weak lensing convergence maps.

Generate convergence maps

Generate synthetic convergence maps using the log-normal forward model from sbi_lens:

python -m maps_to_cosmology.generate_maps

Override defaults with Hydra syntax:

python -m maps_to_cosmology.generate_maps num_maps=50000 output_dir=/path/to/output

Train the encoder

Train the NPE encoder network:

python -m maps_to_cosmology.train

Training logs are saved to TensorBoard. View with:

tensorboard --logdir=maps_to_cosmology/results

About

Weak lensing mass mapping and cosmological parameter estimation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published