xlens.utils.random
Attributes
Functions
|
Generate a stable pseudo-random seed for noise realisations. |
Module Contents
- get_noise_seed(*, galaxy_seed, noiseId=0, rotId=0, band: None | str = 'i', is_sim=False)[source]
Generate a stable pseudo-random seed for noise realisations.
The function mixes deterministic galaxy identifiers with optional meta-data, hashes the values into a uniform byte representation, and derives a 32-bit integer seed. The resulting seed is reproducible for a given combination of inputs and has a vanishingly small collision probability within typical survey data sets.
- Parameters:
galaxy_seed (int) – Base integer identifier that uniquely labels the galaxy.
noiseId (int, optional) – Identifier describing the desired noise realisation. Defaults to
0.rotId (int, optional) – Identifier describing the rotation realisation. Defaults to
0.band (str, optional) – Photometric band label (
"g","r","i","z","y"). Defaults to"i".is_sim (bool, optional) – Flag that indicates whether the galaxy originates from a simulation (
True) or observations (False). Defaults toFalse.
- Returns:
Unsigned 32-bit integer seed suitable for initialising NumPy random generators.
- Return type:
int