MCCS Calibration (Internals)

This document provides internal details for MCCS subsystem operators and complements the API documentation.

For high-level information, refer to the Architecture.

SelectionPolicy

The MccsCalibrationStore uses a SelectionPolicy to define the SQL queries for retrieving data from the database. this is configurable (see https://developer.skao.int/projects/ska-low-mccs/en/0.22.0/api/calibration_store/selection_policy/index.html)

Manual Storage

The MccsCalibrationStore device interfaces with the stored calibration products. Use the StoreSolution method to store a calibration solution.

Manual Acquisition

Calibration data can be acquired manually by interfacing with the Tile and DAQ. Alternatively, the AcquireDataForCalibration method in SpsStation automates DAQ and Tile configuration for data collection.

Applying a solution

A solution is applied through the configure command. However, please note that the CalibrationStore SelectionPolicy still governs which solution is loaded and applied. Discussions related to THORN-29 are ongoing regarding how the concept of calibration_id can be communicated with TMC.

As of version 1.1.0, MCCS does not have an internal mechanism to effectively assess the quality of calibration solutions. Consequently, it is the responsibility of operations to determine whether the applied solutions are suitable.

Calibration Loop

The MccsStationCalibrator manages the retrieval and storage of calibration solutions.

For an overview of the internals, see the sequence diagram below:

@startuml

participant TangoUser as TangoUser
participant MccsStationCalibrator as StationCalibrator
participant MccsStation as Station
participant MccsCalibrationStore as MccsCalibrationStore
participant StationCalibrationSolverDevice as solver
participant postgresql as postgresql
participant SpsStation as SpsStation
participant MccsTile as MccsTile
participant MccsDaq as MccsDaq
participant ArtefactRepository as ArtefactRepository

TangoUser -> StationCalibrator: StartCalibrationLoop

loop channels

StationCalibrator -> Station: AcquireDataForCalibration(channel)
Station -> SpsStation: AcquireDataForCalibration(channel)
SpsStation -> MccsDaq: Configure()
SpsStation -> MccsDaq: Start()
SpsStation -> MccsTile: SetLmcDownload()
SpsStation -> MccsTile: SendDataSamples()
MccsDaq -> ArtefactRepository: dump_hdf5()
MccsDaq -> SpsStation: hdf5_data_path
SpsStation -> Station: hdf5_data_path
Station -> StationCalibrator: hdf5_data_path
StationCalibrator -> solver: Solve(\n\thdf5_data_path,\n\tsolution_path)
solver -> ArtefactRepository: write(gain_solution, metadata)
StationCalibrator->MccsCalibrationStore: StoreSolution(\n\tsolution_path,\n\tmetadata)
MccsCalibrationStore->postgresql: Store(gain_solution, metadata)

end

@enduml