Running the measurement scripts
measure_joint_sumstat.py — unified entry point
This script supersedes all per-statistic BGS joint scripts. Any combination of SMF, LF, WP, ESD_HSC, ESD_DES, ESD_KIDS, WTHETA, and KNN can be measured jointly with a shared jackknife or bootstrap covariance. Bin edges, number of JK regions, and weight variants are all configurable from the command line.
Dataset flags
Flag |
Default |
Description |
|---|---|---|
|
|
|
|
— |
Filter BGS/mock samples by stellar-mass lower edge |
|
— |
Filter by upper edge |
|
from filename |
Redshift range (auto-read for bgs/mock; required for custom + SMF/LF) |
|
— |
Sample identifier ( |
|
— |
Lens and random FITS paths ( |
|
auto |
Systematic-weight FITS (custom; auto-discovered for bgs/mock) |
|
|
|
|
— |
FITS column for absolute magnitude (needed for LF) |
Statistics flags
Flag |
Default |
Choices |
|---|---|---|
|
|
|
Binning flags (see Bin specification for format syntax)
Flag |
Default |
Applies to |
|---|---|---|
|
|
WP projected separation [Mpc] |
|
|
ESD projected separation [Mpc] |
|
|
SMF log10(M★/M☉) [dex] |
|
|
WTHETA angular separation [arcmin] |
|
|
LF absolute magnitude [mag] |
|
|
KNN separation [Mpc] |
|
|
Neighbor orders |
|
|
Number of kNN query points |
Covariance flags
Flag |
Default |
Description |
|---|---|---|
|
|
|
|
|
Number of jackknife regions |
|
|
Number of bootstrap draws |
Misc flags
Flag |
Default |
Description |
|---|---|---|
|
|
Root directory for HDF5 output |
|
auto |
Override auto-generated output path |
|
on |
Skip if |
|
|
CPU threads for Corrfunc / treecorr |
|
|
πmax for wp [Mpc] |
|
off |
Print plan without writing files or loading sources |
|
off |
Smoke-test: n_jk=10, max_ngal=5000, knn_n_query=5000,
|
|
— |
Randomly subsample to N galaxies after loading (randoms → 5N) |
|
|
|
Checkpoint / resume
Each JK or bootstrap iteration is written to _checkpoint/subsamples in the
output HDF5 immediately after completion. Re-running the same command resumes
from where it stopped — already-finished rows are skipped. To add more
iterations, increase --n-jk (or --n-bootstrap) and re-run; new rows
are appended to the checkpoint and the covariance is re-computed at the end.
Example commands — LS10 M★≥11.5, sys-comb weights
See scripts/run_ls10_m11.5_examples.sh for the full example set, or run
it directly:
bash scripts/run_ls10_m11.5_examples.sh [--fast-test] [--dry-run]
Selected examples:
# Default: SMF + WP + ESD_HSC + ESD_DES (sys-comb, 100 JK)
JAX_PLATFORMS=cpu python scripts/measure_joint_sumstat.py \
--mstar-min 11.5 --weight-variant sys-comb
# All lensing surveys
JAX_PLATFORMS=cpu python scripts/measure_joint_sumstat.py \
--mstar-min 11.5 --weight-variant sys-comb \
--stats ESD_HSC ESD_DES ESD_KIDS
# All summary statistics (no LF — requires abs_mag column)
JAX_PLATFORMS=cpu python scripts/measure_joint_sumstat.py \
--mstar-min 11.5 --weight-variant sys-comb \
--stats SMF WP ESD_HSC ESD_DES ESD_KIDS WTHETA KNN
# Bootstrap covariance, custom bins
JAX_PLATFORMS=cpu python scripts/measure_joint_sumstat.py \
--mstar-min 11.5 --weight-variant sys-comb \
--stats SMF WP ESD_HSC ESD_DES \
--covariance bootstrap --n-bootstrap 500 \
--bins-rp log:15:0.1:40 --bins-mstar arange:11.5:12.6:0.1
# Smoke-test (5000 galaxies, 10 JK regions, subsample BGS footprint)
JAX_PLATFORMS=cpu python scripts/measure_joint_sumstat.py \
--mstar-min 11.5 --weight-variant sys-comb \
--fast-test --stats SMF WP
Output directory layout
data/
├── lf_smf/ BGS and mock SMF (one .h5 per sample × weight variant)
├── twopcf/ BGS and mock wp, wtheta
├── lensing/ BGS ΔΣ (HSC/DES)
├── BGS_Mstar{X}/ joint covariance files per mass threshold
├── mocks/
│ ├── lf_smf/ mock SMF
│ ├── twopcf/ mock wp, wtheta
│ └── joint/ mock joint SMF + wp
├── COSMOS/ cosmos_smf_z*.fits, cosmos_lf_{band}_z*.fits
└── GAMA/ gama_smf_z*.fits, gama_lf_r_z*.fits