Skip to content

Scripts

The repository ships with a set of CLI drivers and bash wrappers under scripts/. They cover the whole pipeline from reformatting the raw .DAT files through measurements to plots.

The authoritative index is scripts/bookkeeping.md. The summary below mirrors it; consult that file for the full per-script flag list.

Python drivers

Script Purpose
reformat_catalogues.py CatshortV.*.DAT → halo.hdf5 (read-only on the source).
measure_hmf.py Batch HMF measurement loop (load-or-measure).
load_hmf.py Single-record or --grid summary inspector for hmf.hdf5.
plot_hmf.py One-panel HMF plot, one line per imodel, mean over iboxes.
measure_xi_hh.py Batch xi_hh measurement loop. Reads config_xi_hh.yaml by default.
load_xi_hh.py Single-record or --grid inspector for xi_hh.hdf5.
plot_xi_hh.py r²ξ plot in one panel, one line per mass-bin pair.
example_load_halo.py Worked example: load a halo.hdf5, summarise columns, demo a mass cut.

Bash drivers

Run from the repository root. They use set -euo pipefail and forward extra flags via EXTRA_ARGS / MEASURE_EXTRA_ARGS.

Script Wraps Sub-grid
reformat_catalogues_LCDM_z0.25.sh reformat_catalogues.py LCDM, z=0.25, m=1..64, b=1..5
reformat_catalogues_fRn1_z0.25.sh reformat_catalogues.py fRn1 variant of the above
load_hmf_LCDM_z0.25.sh load_hmf.py per-realisation loop
load_hmf_fRn1_z0.25.sh load_hmf.py fRn1 variant
measure_xi_hh_LCDM_z0.25.sh measure_xi_hh.py LCDM, m=1..9, b=1..5
measure_xi_hh_fRn1_z0.25.sh measure_xi_hh.py fRn1 variant
load_xi_hh_LCDM_z0.25.sh load_xi_hh.py per-realisation loop

Conventions

  • All Python drivers run under micromamba run -n cosemu python3 ….
  • Measurement drivers default to load-or-measure via the HMFLoader / XiHHLoader classes — missing files are produced on demand, existing files are left alone unless --overwrite is passed.
  • 2PCF measurements read binning from scripts/config_xi_hh.yaml unless --no-config is given.
  • The raw CatshortV.*.DAT files are read-only: if halo.hdf5 is missing, the source is reformatted into a fresh HDF5 mirror; the .DAT is never modified.

Notebooks

A worked walkthrough lives at notebooks/example_load.ipynb — loads halo + HMF + xi_hh + velocity moments + sub-grid stacking on a single realisation. Open it locally with Jupyter against the cosemu kernel.