Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Development image with more bells and whistles
FROM ghcr.io/cosmostat/shapepipe:develop
FROM ghcr.io/cosmostat/shapepipe:im_sims

RUN apt-get update -y --quiet --fix-missing && \
apt-get dist-upgrade -y --quiet --fix-missing && \
Expand Down
70 changes: 70 additions & 0 deletions config/calibration/mask_v1.X.4_im_sim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Config file for masking and calibration.
# Standard cuts without coverage mask, type v1.X.4.

# General parameters (can also given on command line)
params:
input_path: shape_catalog_comprehensive_ngmix.hdf5
cmatrices: False
sky_regions: False
verbose: True

# Masks
## Using columns in 'dat' group (ShapePipe flags)
dat:
# SExtractor flags
- col_name: FLAGS
label: SE FLAGS
kind: equal
value: 0

# Number of epochs
- col_name: N_EPOCH
label: r"$n_{\rm epoch}$"
kind: greater_equal
value: 2

# Magnitude range
- col_name: mag
label: mag range
kind: range
value: [15, 30]

# ngmix flags
- col_name: NGMIX_MOM_FAIL
label: "ngmix moments failure"
kind: equal
value: 0

# invalid PSF ellipticities
- col_name: NGMIX_ELL_PSFo_NOSHEAR_0
label: "bad PSF ellipticity comp 1"
kind: not_equal
value: -10
- col_name: NGMIX_ELL_PSFo_NOSHEAR_1
label: "bad PSF ellipticity comp 2"
kind: not_equal
value: -10

# Metacal parameters
metacal:
# Ellipticity dispersion
sigma_eps_prior: 0.34

# Signal-to-noise range
gal_snr_min: 10
gal_snr_max: 500

# Relative-size (hlr / hlr_psf) range
gal_rel_size_min: 0.5
gal_rel_size_max: 3

# Correct relative size for ellipticity?
gal_size_corr_ell: False

# Weight for global response matrix, None for unweighted mean.
# Unweighted for image sims: no weights anywhere in sim m-bias (#227).
global_R_weight: null

# Subtract additive bias (mean shear)? Use False for constant-shear
# image sims
additive_correction: False
77 changes: 77 additions & 0 deletions config/calibration/mask_v1.X.9_im_sim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Config file for masking and calibration.
# Less conservative cuts, type v1.X.9 (e.g. for matching with spectroscopic sample).

# General parameters (can also given on command line)
params:
input_path: shape_catalog_comprehensive_ngmix.fits
cmatrices: False
sky_regions: False
verbose: True

# Masks
## Using columns in 'dat' group (ShapePipe flags)
dat:
# SExtractor flags
- col_name: FLAGS
label: SE FLAGS
kind: smaller_equal
value: 2

# Duplicate objects
- col_name: overlap
label: tile overlap
kind: equal
value: True

# Number of epochs
- col_name: N_EPOCH
label: r"$n_{\rm epoch}$"
kind: greater_equal
value: 1

# Magnitude range
- col_name: mag
label: mag range
kind: range
value: [15, 30]

# ngmix flags
- col_name: NGMIX_MCAL_TYPES_FAIL
label: "ngmix moments failure"
kind: equal
value: 0

# invalid PSF ellipticities (ShapePipe-v2 grammar: scalar G1/G2 components)
- col_name: NGMIX_G1_PSF_ORIG_NOSHEAR
label: "bad PSF ellipticity comp 1"
kind: not_equal
value: -10
- col_name: NGMIX_G2_PSF_ORIG_NOSHEAR
label: "bad PSF ellipticity comp 2"
kind: not_equal
value: -10

# Metacal parameters
metacal:
# Ellipticity dispersion
sigma_eps_prior: 0.34

# Signal-to-noise range
gal_snr_min: 5
gal_snr_max: 500

# Relative-size (hlr / hlr_psf) range
gal_rel_size_min: 0.25
gal_rel_size_max: 10

# Correct relative size for ellipticity?
gal_size_corr_ell: False

# Weight for global response matrix, None for unweighted mean.
# Unweighted for image sims: no weights anywhere in sim m-bias (#227),
# and the w_des-weighted R had N_eff ~ 20-100 objects.
global_R_weight: null

# Subtract additive bias (mean shear)? Use False for constant-shear
# image sims
additive_correction: False
7 changes: 6 additions & 1 deletion scripts/calibration/calibrate_comprehensive_cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,13 @@
)

# %%
additive_correction = cm.get("additive_correction", True)
if not additive_correction:
print("Additive bias correction disabled (additive_correction: False)")

g_corr_mc, g_uncorr, w, mask_metacal, c, c_err = calibration.get_calibrated_m_c(
gal_metacal
gal_metacal,
additive_correction=additive_correction,
)

num_ok = len(g_corr_mc[0])
Expand Down
Loading
Loading