Configuration¶
halocat keeps two layers of configuration:
- Hard defaults in
halocat.config— paths, the simulation grid, default binning for the HMF /xi_hh/ velocity moments. - Per-run YAML overrides loaded via
halocat.config_io.apply_xi_hh_configfor thexi_hhmeasurement.
Defaults in halocat.config¶
| Constant | Value |
|---|---|
OUTPUT_ROOT |
/cosma8/data/dp203/dc-ruan1/degrace_pilot |
GRAVITIES |
["LCDM", "fRn1"] |
IMODELS |
1..64 (degrace-pilot grid) |
IBOXES |
1..5 (degrace-pilot grid) |
IBOXES_FIDUCIAL |
1..100 (fiducial cosmologies, see below) |
BOX_SIZE |
1024.0 Mpc/h |
Z_SNAP_MAP |
{0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5} → snapnum |
Z_SNAP_MAP_FIDUCIAL |
27 redshifts → snapnum, fiducial-only (see below) |
MASS_COLUMN |
"Mtot" |
LOG10M_MIN/MAX |
12.5 / 15.5 (HMF binning, 30 bins) |
R_EDGES |
np.logspace(log10(R_MIN), log10(R_MAX), NBIN_R + 1) |
MASS_BINS |
contiguous bins from MASS_BIN_EDGES |
VEL_R_EDGES |
linear r edges for velocity moments |
VEL_MASS_BINS |
mirror of MASS_BINS by default |
Helpers:
get_output_dir— resolves the per-realisation output directory.snapnum_for_redshift— maps a redshift to the GLAM snapnum (dispatches to the fiducial table whenimodel <= 0).get_catalogue_path— locates the upstreamCatshortV.*.DAT(dispatches toFIDUCIAL_CATALOGUE_TEMPLATESfor fiducial entries).is_fiducial— predicate for(gravity, imodel)pairs that select a fiducial run.
Fiducial cosmology runs¶
Three fiducial-cosmology realisations are addressable through the same
loaders and pipeline as the degrace-pilot grid, just with sentinel
imodel values and 100 boxes (ibox=1..100) instead of 5:
(gravity, imodel) |
Source root | Notes |
|---|---|---|
("LCDM", 0) |
/cosma8/data/dp203/dc-ruan1/DESI_MGx100/data/GR/ |
GR / ΛCDM fiducial |
("fRn1", 0) |
/cosma8/data/dp203/dc-ruan1/mg_glam/F5n1_L1024Np2048Ng4096/ |
f(R), |f_R0| = 1e-5 |
("fRn1", -1) |
/cosma8/data/dp203/dc-ruan1/mg_glam/F6n1_L1024Np2048Ng4096/ |
f(R), |f_R0| = 1e-6 |
Each fiducial root contains a per-snapshot CatshortV.*.DAT tree
with the same 24-column schema as the degrace-pilot catalogues, so the
existing reformatter / pipeline / loaders work unchanged — only
get_catalogue_path dispatches to
a different template.
The fiducial sims dump 27 snapshots instead of 7, so a separate
Z_SNAP_MAP_FIDUCIAL is used.
Pass imodel into
snapnum_for_redshift to
dispatch to the right table:
from halocat import config as C
C.snapnum_for_redshift(0.25) # 137 (degrace-pilot)
C.snapnum_for_redshift(0.25, imodel=0) # 137 (fiducial too)
C.snapnum_for_redshift(0.10, imodel=0) # 148 (fiducial-only redshift)
The pipeline / drivers do this automatically when they get an
imodel argument — there's nothing extra to remember at the call
site:
from halocat.pipeline import run_single
status = run_single("LCDM", 0.25, imodel=0, ibox=1) # reformats DESI_MGx100/GR
Outputs land in the standard tree under
OUTPUT_ROOT/gravity_<g>/z_<z>/imodel_<m>/box_<b>/; the only twist
is that imodel may be 0 or -1 (so the directory name will
include a literal minus sign for F6n1).
YAML override for xi_hh¶
scripts/config_xi_hh.yaml holds optional overrides for the xi_hh
binning. It supports both the r axis and the mass-bin axis, in
either parametric or explicit form.
r_binning¶
Parametric:
Explicit:
mass_bins¶
Parametric (contiguous bins of equal width):
mass_bins:
kind: linear # bins evenly spaced in log10(M)
min: 12.4 # log10(M / [Msun/h])
max: 15.4
nbins: 10
Contiguous from explicit edges:
Fully explicit pairs (allows gaps):
Loading the YAML¶
Both scripts/measure_xi_hh.py and scripts/load_xi_hh.py apply this
config by default (use --no-config to skip). At the Python level:
from halocat.config_io import apply_xi_hh_config
apply_xi_hh_config("scripts/config_xi_hh.yaml")
# -> monkey-patches halocat.config.R_EDGES and halocat.config.MASS_BINS
After this, both XiHHLoader.get
and XiHHLoader.measure_pair
use the overridden binning.
measure_pair also accepts an explicit r_edges=... argument that
takes precedence over both the YAML config and the
R_EDGES default.