ska_ost_senscalc.mid.service

The service layer is responsible for turning validated inputs into the relevant calculation inputs, calling any calculation functions and collating the results.

class ska_ost_senscalc.mid.service.BeamSizeResponse[source]

BeamSizeResponse is a typed dictionary constrained to match the schema of the JSON object outlining the synthesized beam size, as contained in the parent JSON result of a weighting endpoint query.

class ska_ost_senscalc.mid.service.ConfusionNoiseResponse[source]

ConfusionNoiseResponse is a typed dictionary constrained to match the schema of a confusion noise JSON object, as contained in the parent JSON result of a weighting endpoint query.

class ska_ost_senscalc.mid.service.SingleWeightingResponse[source]

SingleWeightingResponse is a typed dictionary constrained to match the schema of a single weighting calculation, as performed for the main continuum or zoom weighting calculation and for each subband frequency. Child SingleWeightingResponse JSON object for each of these calculations are contained in the parent JSON result

class ska_ost_senscalc.mid.service.WeightingResponse[source]

WeightingResponse is a typed dictionary constrained to match the schema of the main result of a weighting endpoint query.

ska_ost_senscalc.mid.service.get_calculate_response(params)[source]

Using the parameters of the query return the appropriate values for the calculation.

ska_ost_senscalc.mid.service.get_subarray_response()[source]

return the appropriate subarray objects

ska_ost_senscalc.mid.service.get_subbands(n_subbands, obs_freq, bandwidth)[source]

Function to get the centres (and common width) of the N subbands of bandwidth

Parameters:
  • n_subbands (int) – Number of subbands

  • obs_freq (float) – Frequency

  • bandwidth (float) – Bandwidth

Returns:

A list of frequency centres for the subbands and the subband width

Return type:

Tuple(List, float)

ska_ost_senscalc.mid.service.get_weighting_response(user_input: dict) WeightingResponse[source]

Using the parameters of the query return the appropriate values for weighting correction factor, synthesized-beam-sensitivity factor and beam shape.

Raises:

- None