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_zoom_weighting_params(params: ZoomRequest) ZoomRequestPrepared[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(params: ContinuumRequest) ContinuumRequest[source]

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

ska_ost_senscalc.mid.validation.validate_and_set_defaults_for_pss(kwargs: PssRequestMid) CalculatorInputPSS[source]

Validate arguments for a MID PSS query and set appropriate defaults.

Note that PSS does not have to perform an extensive validation as continuum. This is because PSS internally calls the continuum mode and then transforms the continuum sensitivity to get PSS sensitivity. So, we will only do minimal validation here.

ska_ost_senscalc.mid.validation.validate_and_set_defaults_for_zoom(params: ZoomRequest) ZoomRequestPrepared[source]
Parameters:

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

Returns:

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

Raises:

ValueError if the input data is not valid