Skip to content

Commit

Permalink
fixed bug in KiDS tomographic bin assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesulf committed Jun 2, 2023
1 parent 5cb05e9 commit bd2ba45
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.7.2] - 2023-06-02

### Changed

- `dsigma.stacking.lens_magnification_bias` can now be used to compute the bias in the tangential shear
Expand All @@ -15,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- incompatibility with numpy 1.24
- bug in `dsigma.stacking.tangential_shear` when `random_subtraction=True`
- error in tomographic redshift bin assignment for KiDS, sources with photo-z's at the bin edges were assigned to the wrong tomographic bin, this biased KiDS lensing measurements by order 2%

## [0.7.1] - 2023-01-18

Expand Down
3 changes: 2 additions & 1 deletion dsigma/surveys/kids.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def tomographic_redshift_bin(z_s, version=default_version):
redshift. Returns -1 in case a redshift does not fall into any bin.
"""
z_bin = np.digitize(z_s, [0.1, 0.3, 0.5, 0.7, 0.9, 1.2]) - 1
z_bin = np.digitize(z_s, np.array(
[0.1, 0.3, 0.5, 0.7, 0.9, 1.2]) + 1e-6, right=True) - 1
z_bin = np.where((z_s < 0.1) | (z_s >= 1.2), -1, z_bin)

return z_bin
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "dsigma"
version = "0.7.1"
version = "0.7.2"
requires-python = ">=3.8"
authors = [{name = "Johannes U. Lange", email = "julange.astro@pm.me"},
{name = "Song Huang"}]
Expand Down

0 comments on commit bd2ba45

Please sign in to comment.