Station Calibrator Component Manager
This module implements component management for station calibrators.
- class StationCalibratorComponentManager(*args: Any, **kwargs: Any)[source]
A component manager for a station calibrator.
- __init__(logger: Logger, station_name: str, station_id: int, calibration_store_name: str, calibration_solver_trl: str, station_config_path: list[str], communication_state_callback: Callable[[ska_control_model.CommunicationStatus], None], component_state_callback: Callable[[...], None], channels_to_ignore: list[int] | None = None, event_serialiser: ska_low_mccs_common.EventSerialiser | None = None) None[source]
Initialise a new instance.
- Parameters:
logger – the logger to be used by this object.
station_name – the name of this calibrator’s station
station_id – the id of the station.
calibration_store_name – the name of this calibrator’s calibration store
calibration_solver_trl – the trl of the solver device.
station_config_path – TMData reference [source, yaml_path] for the station configuration, used as the default when not supplied in a command.
communication_state_callback – callback to be called when the status of the communications channel between the component manager and its component changes.
component_state_callback – callback to be called when the component state changes.
channels_to_ignore – channel indices with known RFI to skip when solving.
event_serialiser – the event serialiser to be used by this object.
- property calibration_schedule: list[dict[str, Any]]
Return the active schedule entries.
- Returns:
the list of active schedule entries.
- cleanup() None[source]
Cleanup resources held by the component manager.
This includes cleaning up resources held by all sub-component managers.
- do_generate_calibration_solution(task_callback: Callable | None = None, task_abort_event: Event | None = None, **kwargs: Any) None[source]
Generate the calibration solution.
- Parameters:
task_callback – optional callback
task_abort_event – optional abort event
kwargs – see schema for keyword argument definitions
- Raises:
ValueError – if unexpected result code received
- get_calibration(frequency_channel: int, calibration_id: str | None = None) list[float][source]
Get a calibration from the calibration store.
- Parameters:
frequency_channel – the frequency channel to calibrate for
calibration_id – Unique identifier for calibration.
- Returns:
A list of calibration values
- get_fitted_solutions(frequency_channels: list[int], calibration_id: str | None = None) list[float][source]
Get fitted calibration solutions for a set of frequency channels.
Calls
GetFittedSolutionson the calibration store once, returning gains reconstructed from the stored phase fit parameters for every requested channel in a single round-trip.- Parameters:
frequency_channels – channel indices to compute solutions for.
calibration_id – optional unique identifier for the calibration.
- Returns:
flat float array of shape
(n_freqs * n_ant * 8,).
- property latest_preferred_job_id: str
Return the user_friendly_name of the most recent preferred job for this station.
- Returns:
the user_friendly_name of the most recent preferred job, or an empty string if none exists.
- property schedule_state: CalibrationScheduleState
Return the current scheduler state.
- Returns:
the current scheduler state.
- start_calibration_loop(kwargs: dict[str, Any]) tuple[list[ska_control_model.ResultCode], list[str | None]][source]
Start the calibration loop.
- Parameters:
kwargs – kwargs to define calibration.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- fit_gains(channels: ndarray, phases: ndarray) tuple[ndarray, ndarray, ndarray, ndarray][source]
Fit a linear delay model to the observed phase data.
For each antenna and polarisation, fits phase = offset + 2π·f·delay over the supplied channels. The resulting parameters can be evaluated at any frequency, including channels the correlator skipped.
- Parameters:
channels – 1-D array of channel indices that were actually observed.
phases – 2-D array of phases, shape [n_channels, n_ant * 4], where the inner axis layout per antenna is [xx, xy, yx, yy].
- Returns:
A tuple of (offsets, delays, cov_matrices, costs), each shaped for 256 * 4 Jones elements with XX at stride-4 index 0 and YY at stride-4 index 3.