Skip to content

halocat.config

config

Configuration for halocat: paths, simulation grid, binning defaults.

CATALOGUE_TEMPLATE module-attribute

CATALOGUE_TEMPLATE = '/cosma8/data/dp203/dc-ruan1/mg_glam/DurMun_hmfemu_{gravity}_wide_sample_first_64_model{imodel}_L1024Np2048Ng4096/Run{ibox}/CATALOGS/CatshortV.{snapnum:04d}.{ibox:04d}.DAT'

PK_TEMPLATE module-attribute

PK_TEMPLATE = '/cosma8/data/dp203/dc-ruan1/mg_glam/DurMun_hmfemu_{gravity}_wide_sample_first_64_model{imodel}_L1024Np2048Ng4096/Run{ibox}/PowerDM.log.{snapnum:04d}.{ibox:04d}.dat'

FIDUCIAL_CATALOGUE_TEMPLATES module-attribute

FIDUCIAL_CATALOGUE_TEMPLATES = {('LCDM', 0): '/cosma8/data/dp203/dc-ruan1/DESI_MGx100/data/GR/Run{ibox}/CATALOGS/CatshortV.{snapnum:04d}.{ibox:04d}.DAT', ('fRn1', 0): '/cosma8/data/dp203/dc-ruan1/mg_glam/F5n1_L1024Np2048Ng4096/Run{ibox}/CATALOGS/CatshortV.{snapnum:04d}.{ibox:04d}.DAT', ('fRn1', -1): '/cosma8/data/dp203/dc-ruan1/mg_glam/F6n1_L1024Np2048Ng4096/Run{ibox}/CATALOGS/CatshortV.{snapnum:04d}.{ibox:04d}.DAT'}

OUTPUT_ROOT module-attribute

OUTPUT_ROOT = '/cosma8/data/dp203/dc-ruan1/degrace_pilot'

GRAVITIES module-attribute

GRAVITIES = ['LCDM', 'fRn1']

IMODELS module-attribute

IMODELS = list(range(1, 65))

IBOXES module-attribute

IBOXES = list(range(1, 6))

BOX_SIZE module-attribute

BOX_SIZE = 1024.0

IBOXES_FIDUCIAL module-attribute

IBOXES_FIDUCIAL = list(range(1, 101))

Z_SNAP_MAP module-attribute

Z_SNAP_MAP = {0.0: 157, 0.25: 137, 0.5: 124, 0.75: 115, 1.0: 108, 1.25: 103, 1.5: 98}

REDSHIFTS module-attribute

REDSHIFTS = sorted(keys())

Z_SNAP_MAP_FIDUCIAL module-attribute

Z_SNAP_MAP_FIDUCIAL = {0.0: 157, 0.05: 152, 0.1: 148, 0.21: 140, 0.25: 137, 0.27: 136, 0.3: 134, 0.38: 130, 0.4: 129, 0.46: 126, 0.48: 125, 0.53: 123, 0.58: 121, 0.6: 120, 0.66: 118, 0.69: 117, 0.75: 115, 0.78: 114, 0.85: 112, 0.88: 111, 1.0: 108, 1.08: 106, 1.23: 103, 1.33: 101, 1.51: 98, 1.58: 97, 1.97: 92}

REDSHIFTS_FIDUCIAL module-attribute

REDSHIFTS_FIDUCIAL = sorted(keys())

CATALOGUE_HEADER_LINES module-attribute

CATALOGUE_HEADER_LINES = 8

CATALOGUE_COLUMNS module-attribute

CATALOGUE_COLUMNS = ['x', 'y', 'z', 'vx', 'vy', 'vz', 'Mbound', 'Mtot', 'Rvir', 'Vrms', 'Vcirc', 'Nhalo', 'Cvir', 'Nparticles', 'DistinctSub', 'Xoff', '2KEp_m1', 'Lambda', 'RadRMS_k', 'b_a', 'c_a', 'Major_x', 'Major_y', 'Major_z']

MASS_COLUMN module-attribute

MASS_COLUMN = 'Mtot'

LOG10M_MIN module-attribute

LOG10M_MIN = 12.5

LOG10M_MAX module-attribute

LOG10M_MAX = 15.5

DLOG10M module-attribute

DLOG10M = 0.1

NBIN_HMF module-attribute

NBIN_HMF = int(round((LOG10M_MAX - LOG10M_MIN) / DLOG10M))

R_MIN module-attribute

R_MIN = 0.1

R_MAX module-attribute

R_MAX = 120.1

NBIN_R module-attribute

NBIN_R = 60

R_EDGES module-attribute

R_EDGES = logspace(log10(R_MIN), log10(R_MAX), NBIN_R + 1)

MASS_BIN_EDGES module-attribute

MASS_BIN_EDGES = [12.5, 13.0, 13.5, 14.0, 14.5]

MASS_BINS module-attribute

MASS_BINS = [(MASS_BIN_EDGES[i], MASS_BIN_EDGES[i + 1]) for i in (range(len(MASS_BIN_EDGES) - 1))]

VEL_R_MIN module-attribute

VEL_R_MIN = 0.0

VEL_R_MAX module-attribute

VEL_R_MAX = 150.0

NBIN_VEL_R module-attribute

NBIN_VEL_R = 60

VEL_R_EDGES module-attribute

VEL_R_EDGES = linspace(VEL_R_MIN, VEL_R_MAX, NBIN_VEL_R + 1)

VEL_MASS_BINS module-attribute

VEL_MASS_BINS = list(MASS_BINS)

is_fiducial

is_fiducial(gravity: str, imodel: int) -> bool

Return True iff (gravity, imodel) selects a fiducial-cosmology run.

Fiducial entries are keyed in :data:FIDUCIAL_CATALOGUE_TEMPLATES and use the 27-snapshot :data:Z_SNAP_MAP_FIDUCIAL instead of the 7-snapshot :data:Z_SNAP_MAP used by the degrace-pilot grid.

Source code in halocat/config.py
def is_fiducial(gravity: str, imodel: int) -> bool:
    """Return True iff ``(gravity, imodel)`` selects a fiducial-cosmology run.

    Fiducial entries are keyed in :data:`FIDUCIAL_CATALOGUE_TEMPLATES` and
    use the 27-snapshot :data:`Z_SNAP_MAP_FIDUCIAL` instead of the
    7-snapshot :data:`Z_SNAP_MAP` used by the degrace-pilot grid.
    """
    return (gravity, imodel) in FIDUCIAL_CATALOGUE_TEMPLATES

get_catalogue_path

get_catalogue_path(gravity: str, imodel: int, ibox: int, snapnum: int) -> str

Resolve the upstream CatshortV.*.DAT path for one realisation.

Dispatches to :data:FIDUCIAL_CATALOGUE_TEMPLATES if (gravity, imodel) selects a fiducial-cosmology run, otherwise falls back to the degrace-pilot :data:CATALOGUE_TEMPLATE.

Source code in halocat/config.py
def get_catalogue_path(gravity: str, imodel: int, ibox: int, snapnum: int) -> str:
    """Resolve the upstream ``CatshortV.*.DAT`` path for one realisation.

    Dispatches to :data:`FIDUCIAL_CATALOGUE_TEMPLATES` if
    ``(gravity, imodel)`` selects a fiducial-cosmology run, otherwise
    falls back to the degrace-pilot :data:`CATALOGUE_TEMPLATE`.
    """
    template = FIDUCIAL_CATALOGUE_TEMPLATES.get(
        (gravity, imodel), CATALOGUE_TEMPLATE
    )
    return template.format(
        gravity=gravity, imodel=imodel, ibox=ibox, snapnum=snapnum
    )

get_pk_path

get_pk_path(gravity: str, imodel: int, ibox: int, snapnum: int) -> str
Source code in halocat/config.py
def get_pk_path(gravity: str, imodel: int, ibox: int, snapnum: int) -> str:
    return PK_TEMPLATE.format(
        gravity=gravity, imodel=imodel, ibox=ibox, snapnum=snapnum
    )

get_output_dir

get_output_dir(gravity: str, redshift: float, imodel: int, ibox: int) -> str
Source code in halocat/config.py
def get_output_dir(gravity: str, redshift: float, imodel: int, ibox: int) -> str:
    return os.path.join(
        OUTPUT_ROOT,
        f"gravity_{gravity}",
        f"z_{redshift:.2f}",
        f"imodel_{imodel}",
        f"box_{ibox}",
    )

snapnum_for_redshift

snapnum_for_redshift(redshift: float, imodel: int | None = None) -> int

Map a redshift to the corresponding GLAM snapnum.

Parameters:

Name Type Description Default
redshift float

Target redshift; must be a key of the active redshift table.

required
imodel int

If given and imodel <= 0, dispatch to :data:Z_SNAP_MAP_FIDUCIAL (27 fiducial snapshots) instead of :data:Z_SNAP_MAP (7 degrace-pilot snapshots).

None

Returns:

Name Type Description
snapnum int

Integer snapshot number used in CatshortV.{snapnum:04d}.*.DAT.

Source code in halocat/config.py
def snapnum_for_redshift(redshift: float, imodel: int | None = None) -> int:
    """Map a redshift to the corresponding GLAM snapnum.

    Parameters
    ----------
    redshift : float
        Target redshift; must be a key of the active redshift table.
    imodel : int, optional
        If given and ``imodel <= 0``, dispatch to
        :data:`Z_SNAP_MAP_FIDUCIAL` (27 fiducial snapshots) instead of
        :data:`Z_SNAP_MAP` (7 degrace-pilot snapshots).

    Returns
    -------
    snapnum : int
        Integer snapshot number used in ``CatshortV.{snapnum:04d}.*.DAT``.
    """
    table = Z_SNAP_MAP_FIDUCIAL if (imodel is not None and imodel <= 0) \
            else Z_SNAP_MAP
    if redshift not in table:
        kind = "fiducial" if table is Z_SNAP_MAP_FIDUCIAL else "standard"
        raise KeyError(
            f"redshift {redshift} not in {kind} snap map; "
            f"available: {sorted(table)}"
        )
    return table[redshift]