uvex_transients.phase_space.sampling.core.check_detection#
- uvex_transients.phase_space.sampling.core.check_detection(detection: Sequence[Mapping] | None) tuple[dict, ...] | None[source]#
Check a definition of a detection and return it as plain types.
A definition is a list of cuts. Each entry is a mapping with the name of a cut registered on
SurveySimulatorascut, and the arguments of that cut asparams, as in thesteps:of a run-config:[ {"cut": "snr", "params": {"n_visits": 2}}, { "cut": "time_since_last_nondetection", "params": {"max_delay": 1.0}, }, ]
- Parameters:
detection (
sequenceofMappingorNone) – The entries, applied in order, or None for the sampler’s default.- Returns:
The entries as plain dicts (
paramsleft out when empty), or None.- Return type:
- Raises:
ValueError – If detection is empty or not a list of mappings, an entry has a key other than
cutandparams, a cut is not registered, or a cut does not take one of itsparams.