Skip to content

Commit

Permalink
Merge branch 'LSST-strong-lensing:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
padma18-vb authored Jun 11, 2024
2 parents 5dd0ec2 + 68adf90 commit e748a15
Show file tree
Hide file tree
Showing 160 changed files with 40,458 additions and 951 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
python-version: [3.8]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ ci:
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.1
rev: v0.4.7
hooks:
- id: ruff
exclude: docs/.*
args: ["--line-length=88"]
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
rev: 1.8.5
hooks:
- id: nbqa-ruff
args: ["--line-length=120"]
- repo: https://github.com/psf/black
rev: 23.10.0
rev: 24.4.2
hooks:
- id: black
# It is recommended to specify the latest version of Python
Expand All @@ -33,7 +33,7 @@ repos:
# https://pre-commit.com/#top_level-default_language_version
language_version: python3
- repo: https://github.com/psf/black
rev: 23.10.0
rev: 24.4.2
hooks:
- id: black-jupyter
language_version: python3
Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ Finally add the ``slsim-project`` repository as a *remote*. This will allow you


Install slsim in development mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To run your own version of slsim and making sure that your own development changes are reflected (as well as switcing branches),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To run your own version of slsim and making sure that your own development changes are reflected (as well as switching branches),
install the slsim package in development mode with

::

cd slsim
pip install -r requirements.txt --user
python setup.py develop --user


Expand Down Expand Up @@ -163,4 +164,4 @@ All public classes, methods and functions require docstrings. You can build docu
- Notes
- References

For more information see the Astropy guide to `Writing Documentation <https://docs.astropy.org/en/stable/development/docguide.html>`_.
For more information see the Astropy guide to `Writing Documentation <https://docs.astropy.org/en/stable/development/docguide.html>`_.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
============
==========================================
SLSim (Strong Lensing Simulation) pipeline
============
==========================================

|Read the Docs| |GitHub| |Codecov| |Black| |docformatter| |docstyle|

Expand Down
8 changes: 7 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
codecov:
token: b297bdac-173f-4244-8986-433e435fee61
comment: # this is a top-level key
layout: " diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: false # [true :: must have a base report to post]
require_head: true # [true :: must have a head report to post]
require_head: true # [true :: must have a head report to post]
ignore:
- "slsim/lsst_science_pipeline.py"
- "setup.py"
- "tests/*"
70 changes: 70 additions & 0 deletions data/SL-Hammocks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# README.md

## Overview

This README file provides an overview of the CSV file located in the `data/SL-Hammocks` folder. This document aims to help users and contributors understand the structure and the specifics of the data contained within.

## File Description

### `pop_salp_a0001_zl001_to_5_wo_sub.csv`

- **Purpose**: This file provides the deflector population of compound lens model. We set "sky_area= 0.001 [deg^2]", "z_min=0.01", and "z_max=5.0" to generate this population.
- **Source**: [SL-Hammocks](https://github.com/kta-cosmo/SL-Hammocks) Currently, this is private project

## Column Descriptions

This section details what each column in the CSV file represents. Below is a list of the columns along with a brief description for each.

1. **id**: Original deflector ID before cutting out to create this file (Basically ignore it.)

2. **zl**: redshift of each deflector

3. **m_h**: mass of dark matter halo component in units of Msun/h

4. **m_acc**: mass of subhalo component at the accretion time in units of Msun/h. For host halos, this value becomes 0. Currently, this file does not include subhalos.

5. **e_h**: ellipticily of dark matter halo, which is defined by e=1-b/a, where a,b are major and minor axis of dark matter halo.

6. **p_h**: position angle of dark matter halo in units of degree

7. **con**: concentration parameter of dark matter halo

8. **m_g**: mass of galaxy(stellar) component in units of Msun/h

9. **e_g**: ellipticily of galaxy, which is defined by e=1-b/a, where a,b are major and minor axis of galaxy.

10. **p_g**: position angle of galaxy in units of degree

11. **tb**: the scale radius appreared in Hernquist profile in units of arcsec. This parameter relates to the commonly used galaxy effective (half-mass) radius by t_b = 0.551\*theta_eff.

12. **vel_disp**: the luminosity-weighted averaged value of the line-of-sight
velocity dispersion within the galaxy effective radius

## Usage

- **Loading Data**: An example of how to load this CSV file is slsim:

```python
from astropy.cosmology import FlatLambdaCDM
from astropy.units import Quantity
from slsim.lens_pop import LensPop

cosmo = FlatLambdaCDM(H0=70, Om0=0.3)
sky_area = Quantity(value=0.001, unit="deg2")
kwargs_deflector_cut ={"z_min": 0.01, "z_max": 2.0}
kwargs_source_cut = {"band": "g", "band_max": 28, "z_min": 0.1, "z_max": 5.0}

skypy_config='/your-path-to-slsim/data/SkyPy/lsst-like.yml'
slhammocks_config='/your-path-to-slsim/data/SL-Hammocks/pop_salp_a0001_zl001_to_5_wo_sub.csv'
gg_lens_pop = LensPop(
deflector_type="halo-models",
source_type="galaxies",
kwargs_deflector_cut=kwargs_deflector_cut,
kwargs_source_cut=kwargs_source_cut,
kwargs_mass2light=None,
skypy_config=skypy_config,
slhammocks_config=slhammocks_config,
sky_area=sky_area,
cosmo=cosmo,
)
```
Loading

0 comments on commit e748a15

Please sign in to comment.