halocat.cosmology¶
cosmology
¶
Cosmology-parameter table for the DEGRACE-pilot suite.
Maps (gravity, imodel) pairs to the cosmological parameter vector
θ consumed by the ξ_AB emulator. Two schemas, gravity-conditional:
θ_LCDM = (Omega_m, h, n_s, S_8)θ_fRn1 = (Omega_m, h, n_s, S_8, logf_R0)
Sources:
- DEGRACE-pilot 64-row design at the path given by
:data:DESIGN_FILE_DEFAULT (cols: Omega_m h n_s S_8 logf_R0).
- Fiducial sentinels (imodel ∈ {-1, 0}) hard-coded in
:data:FIDUCIAL_THETA.
The design file is referenced, not copied into the halocat repo —
its physical location is a config in this module overridable via
load_design_table(path=...).
DESIGN_FILE_DEFAULT
module-attribute
¶
THETA_KEYS
module-attribute
¶
THETA_KEYS: Mapping[str, tuple[str, ...]] = {'LCDM': ('Omega_m', 'h', 'n_s', 'S_8'), 'fRn1': ('Omega_m', 'h', 'n_s', 'S_8', 'logf_R0')}
FIDUCIAL_THETA
module-attribute
¶
FIDUCIAL_THETA: dict[tuple[str, int], dict[str, float]] = {('LCDM', 0): {'Omega_m': 0.3089, 'h': 0.6774, 'n_s': 0.9667, 'S_8': 0.8159}, ('fRn1', 0): {'Omega_m': 0.3089, 'h': 0.6774, 'n_s': 0.9667, 'S_8': 0.8159, 'logf_R0': -5.0}, ('fRn1', -1): {'Omega_m': 0.3089, 'h': 0.6774, 'n_s': 0.9667, 'S_8': 0.8159, 'logf_R0': -6.0}}
theta_keys
¶
Return the ordered θ-parameter names for a gravity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gravity
|
('LCDM', 'fRn1')
|
|
"LCDM"
|
Returns:
| Name | Type | Description |
|---|---|---|
keys |
tuple of str
|
Ordered parameter names. LCDM has 4; fRn1 has 5 (adds
|
Raises:
| Type | Description |
|---|---|
KeyError
|
If |
Source code in halocat/cosmology.py
load_design_table
¶
Read the DEGRACE-pilot design table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to the whitespace-separated design file with header line
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
table |
dict[int, dict[str, float]]
|
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the path does not exist. |
Source code in halocat/cosmology.py
get_cosmology
¶
Return θ for one (gravity, imodel) realisation.
For imodel >= 1 the parameters come from the DEGRACE-pilot
design table; for imodel ∈ {-1, 0} they come from
:data:FIDUCIAL_THETA.
The returned dict has exactly the keys listed in
:data:THETA_KEYS[gravity] — for LCDM the design's logf_R0
column is dropped, for fRn1 it is preserved.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gravity
|
('LCDM', 'fRn1')
|
|
"LCDM"
|
imodel
|
int
|
|
required |
design_path
|
str
|
Override the design-file path; passed to
:func: |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
theta |
dict[str, float]
|
|
Raises:
| Type | Description |
|---|---|
KeyError
|
If |
Source code in halocat/cosmology.py
cosmology_hash
¶
blake2b-128 hex digest of a canonicalised θ dict.
Keys are sorted; values are formatted to 12 significant digits to avoid spurious cache misses from float-print noise.