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.BeamArguments(frequency: float | int | None, zoom_frequencies: list[float | int] | None, dec: Angle, weighting: Weighting, robustness: int | None, calculator_mode: CalculatorMode, array_configuration: MIDArrayConfiguration, taper: float | Quantity | None, telescope: Telescope)[source]
BeamArguments is a dataclass holding arguments for a synthesised beam calculation.
This class is essentially a proxy for a typed Beam constructor signature. It was introduced as a temporary measure to make the code easier to read and reason about. It should be removed when Beam is refactored to:
have a properly typed constructor signature
make mandatory arguments mandatory in the constructor signature, not optional
remove the runtime checking for mandatory arguments
use the proper Exception types (ValueError, etc.), not RuntimeError.
Refactoring would make this class redundant. However, this is too large a refactoring to attempt ahead of the imminent first release so we use this intermediate adapter.
- static from_params(params) BeamArguments [source]
Construct a WeightingParameters from a dictionary of parameters.
- 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_single_weighting_response(beam_args: BeamArguments) SingleWeightingResponse [source]
Calculate the beam weighting from the given beam parameters.
Input arguments and external state are not modified by this function.
- Raises:
- None –
- 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
- ska_ost_senscalc.mid.service.get_subbands_weighting_response(params: dict) list[ska_ost_senscalc.mid.service.SingleWeightingResponse] [source]
Calculate the beam weighting response for every subband frequency in the given parameters dict.
Input arguments and external state are not modified by this function.
- Raises:
- None –
- ska_ost_senscalc.mid.service.get_weighting_response(params: dict) WeightingResponse [source]
Using the parameters of the query return the appropriate values for weighting correction factor, synthesized-beam-sensitivity factor and beam shape.
Input arguments and external state are not modified by this function.
- Raises:
- None –