gw.inference.gw_samplers.check_frequency_updates

gw.inference.gw_samplers.check_frequency_updates(
    model_metadata,
    f_min=None,
    f_max=None,
)

Validate and apply optional minimum and maximum frequency constraints for a model’s frequency domain.

This function checks that any provided per-detector minimum (f_min) or maximum (f_max) frequencies—either as a single float applied to all detectors or as a dict mapping each detector to its own value—: - Match exactly the set of detectors in the model metadata. - Respect the hard bounds defined by the domain (domain.f_min / domain.f_max). - Comply with optional random-strain-cropping settings (probability, independent vs. joint detectors, and per-detector caps/floors).

Parameters

Name Type Description Default
model_metadata dict Dictionary containing the model’s training settings and data. Must include: - ["train_settings"]["data"]["detectors"]: list of detector names. - ["train_settings"]["data"]["random_strain_cropping"]: optional dict of cropping parameters. required
f_min dict[str, float], float, or None Single float or per-detector dict of minimum frequencies to enforce. If a float is provided, it is applied to all detectors. Each value must be ≥ domain.f_min. If None, no minimum-frequency validation is performed. None
f_max dict[str, float], float, or None Single float or per-detector dict of maximum frequencies to enforce. If a float is provided, it is applied to all detectors. Each value must be ≤ domain.f_max. If None, no maximum-frequency validation is performed. None

Raises

Name Type Description
ValueError - If model_metadata does not describe a UniformFrequencyDomain or MultibandedFrequencyDomain. - If f_min/f_max keys don’t exactly match the detector list. - If any requested frequency lies outside the hard domain bounds. - If cropping is disabled but a change in frequency is requested. - If per-detector constraints (independent vs. joint) or cropping caps/floors are violated.

Returns

Name Type Description
None