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.

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.

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(solution_path, gain_solution)
StationCalibrator->MccsCalibrationStore: StoreSolution(\n\tsolution_path,\n\tmetadata)
MccsCalibrationStore->postgresql: Store(solution_path, metadata)

end

@enduml