ska_ost_senscalc.mid.validation

This module provides semantic validation for inputs to the Sensitivity Calculator, including checking for required values, setting default values, and domain related checks.

Syntactic validation and basic validation, for example of min/max values of numbers, is done by Connexion and the OpenAPI spec.

ska_ost_senscalc.mid.validation.validate_and_convert_continuum_weighting_params(*, freq_centre_hz: float | int, pointing_centre: str, subarray_configuration: str, weighting_mode: str, robustness: int | None = None, taper: float = 0.0, subband_freq_centres_hz: list[float] | None = None) ContinuumWeightingRequestParams[source]

Validate arguments for a MID weighting query, returning a typed encapsulation of those arguments.

ska_ost_senscalc.mid.validation.validate_and_convert_line_weighting_params(*, freq_centres_hz: list[float], pointing_centre: str, subarray_configuration: str, weighting_mode: str, robustness: int | None = None, taper: float = 0) LineWeightingRequestParams[source]
TODO the validation for weighting is different to the other calculations, in that it converts

the input to an object with astropy qualities, etc. We should unify the approaches, along with handling defaults properly and consistently

Validate arguments for a MID weighting query, returning a typed encapsulation of those arguments.

ska_ost_senscalc.mid.validation.validate_and_set_defaults_for_continuum(user_input: dict) dict[source]
Parameters:

user_input – the parameters from the HTTP request to /continuum/calculate

Returns:

A new copy of the input dict, with defaults set for missing values

Raises:

ValueError if the input data is not valid

ska_ost_senscalc.mid.validation.validate_and_set_defaults_for_line(user_input: dict) dict[source]
Parameters:

user_input – the parameters from the HTTP request to /line/calculate

Returns:

A new copy of the input dict, with defaults set for missing values

Raises:

ValueError if the input data is not valid