uvex_transients.utils.split_root_seed#
- uvex_transients.utils.split_root_seed(seed: SeedSequence | int | None = None) tuple[Generator, SeedSequence][source]#
Split a root seed into an “immediate draws” generator and a “per-event seeds” spawner.
Used by Monte Carlo samplers that need two decorrelated streams from a single root seed: one to drive draws consumed immediately within the sampling call itself (how many events, their positions/redshifts/times), and a second to spawn independent, individually storable per-event seeds (see
spawn_seeds()) for lazily regenerating each event’s physical parameters later. Keeping these separate means replaying a single event’s parameter draw can never depend on how many other events were sampled alongside it in the same call.- Parameters:
seed (
numpy.random.SeedSequence,int, orNone, optional) – Root seed; seeget_seed_sequence().- Returns:
rng (
numpy.random.Generator) – Generator for this call’s immediate draws.spawn_sequence (
numpy.random.SeedSequence) – Pass tospawn_seeds()to derive per-event seeds.
See also
spawn_seedsDerives the actual per-event seed array from spawn_sequence.