Station Calibrator Device
This module implements the MCCS transient buffer device.
- class MccsStationCalibrator(*args: Any, **kwargs: Any)[source]
An implementation of a station calibrator Tango device for MCCS.
- GenerateCalibrationSolution(**kwargs: Any) ska_tango_base.type_hints.TaskFunctionType[source]
Perform a frequency sweep and generate solutions for recorded channels.
- Parameters:
kwargs – keyword arguments unpacked from the JSON argument.
- Returns:
a task function to be submitted to the task executor.
- GetCalibration(frequency_channel: int, calibration_id: str | None = None) list[float][source]
Get a calibration from the calibration store.
This command takes as input a JSON string that conforms to the following schema:
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://skao.int/MccsStationCalibrator_GetCalibration.json", "title": "MccsStationCalibrator GetCalibration schema", "description": "Schema for MccsStationCalibrator's GetCalibration command", "type": "object", "properties": { "frequency_channel": { "description": "Freqency channel to calibrate for", "type": "integer", "minimum": 0, "maximum": 511 } }, "required": ["frequency_channel"] }
- Parameters:
frequency_channel – the frequency channel to calibrate for.
calibration_id – optional unique identifier for calibration.
- Returns:
a calibration from the calibration store.
- GetFittedSolutions(frequency_channels: list[int], calibration_id: str | None = None) list[float][source]
Get fitted calibration solutions for a set of frequency channels.
Fetches phase fit parameters from the calibration store once and reconstructs gains for all requested channels in a single call, avoiding per-channel round-trips from MccsStation.ApplyConfiguration.
This command takes as input a JSON string that conforms to the following schema:
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://skao.int/MccsStationCalibrator_GetFittedSolutions.json", "title": "MccsStationCalibrator GetFittedSolutions schema", "description": "Schema for MccsStationCalibrator's GetFittedSolutions command", "type": "object", "properties": { "frequency_channels": { "description": "List of frequency channel indices to compute fitted solutions for.", "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 511 }, "minItems": 1 }, "calibration_id": { "description": "Optional unique identifier for the calibration.", "type": "string" } }, "required": ["frequency_channels"] }
- 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,).
- StartCalibrationLoop(**kwargs: Any) tuple[list[ska_control_model.ResultCode], list[str | None]][source]
Start the calibration loop.
This command takes as input a JSON string that conforms to the following schema:
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://skao.int/MccsStationCalibrator_StartCalibrationLoop.json", "title": "MccsStationCalibrator StartCalibrationLoop schema", "description": "Schema for MccsStationCalibrator's StartCalibrationLoop command", "type": "object", "properties": { "calibration_id": { "description": "Unique identifier for the calibration. If not provided, a random identifier of the form `job_<8 hex chars>` is generated.", "type": [ "string", "null" ] }, "eep_filebase": { "description": "Start of EEP filenames before the frequency specification. For X/phi this gives eep_path/eep_filebase<freq>MHz_Xpol_phi.npy. Default is 'FEKO_AAVS3_vogel_256_elem_50ohm_'.", "type": [ "string", "null" ] }, "jones_solve": { "description": "Whether to call the polarised solver after initial calibration. Default is False.", "type": [ "boolean", "null" ] }, "adjust_solar_model": { "description": "Whether to adjust the sky model after initial calibration to limit differences between galactic and solar flux scales. Default is True.", "type": [ "boolean", "null" ] }, "masked_antennas": { "description": "List of antennas which should not be used for calibration. Default is an empty list (no antennas masked).", "type": [ "array", "null" ], "items": { "type": "number" } }, "skymodel": { "description": "Either a model visibility xarray to calibrate against or the name of a sky model type to generate. Supported sky models are `gsm` and `sun`. The `gsm` model combines components of the PyGDSM GlobalSkyModel16 Galactic sky model that are above the horizon with a point-source solar model, while sun uses only the point-source solar model. Default is 'gsm'.", "type": [ "string", "null" ] }, "min_uv": { "description": "Minimum baseline length used in calibration (in metres). The default value is zero.", "type": [ "number", "null" ] }, "refant": { "description": "Antenna to use for phase referencing. Should be one of the zero-based indices used in the visibility dataset. Default is 1. Both polarisations are phase referenced against the X polarisation of refant, as a non-zero XY-phase is expected and solved for.", "type": [ "integer", "null" ], "minimum": 0 }, "ignore_eeps": { "description": "If True, EEP files will not be imported and station beam patterns and rotations will be ignored when modelling visibilities. Sky model components will be added with equal amplitude in XX and YY and zeros amplitude in XY and YX. Default is False.", "type": [ "boolean", "null" ] }, "gain_threshold": { "description": "Fractional threshold used to reject antennas with low gains. Any antenna with either an X or Y gain amplitude less than the median is flagged as bad. The default value is 0.25.", "type": [ "number", "null" ] }, "station_config_path": { "type": [ "array" ], "items": { "type": "string", "pattern": "^[^\\s]+$" }, "minItems": 2, "maxItems": 2, "uniqueItems": true }, "nside": { "description": "Healpix nside at which to generate sky model. Defaults to 32 for channels below 320 and 64 for channels 320 and above. nside=32 corresponds to approximately 110 arcminutes and is adequate at low frequencies; nside=64 (approximately 55 arcminutes) is used at higher frequencies where the beam is narrower.", "type": [ "integer", "null" ], "default": 32, "minimum": 1 }, "niter": { "description": "Number of iterations for solver. Default is 200.", "type": [ "integer", "null" ], "default": 200, "minimum": 1 }, "first_channel": { "description": "The lowest channel in the loop. Default is 64 (50 MHz with an 800 MHz ADC clock and 512 channels).", "type": [ "integer", "null" ], "minimum": 0, "maximum": 511 }, "last_channel": { "description": "The final channel to use in loop. Default is 448.", "type": [ "integer", "null" ], "minimum": 0, "maximum": 511 }, "daq_mode": { "description": "The DAQ mode to use for acquiring data. This is expected to be one of 'TCC' or 'xGPU'. Default is 'TCC'.", "type": [ "string", "null" ], "enum": [ "TCC", "xGPU", null ] }, "daq_config": { "description": "Any overrides to pass to DAQ for configuration purposes. Default is an empty dict.", "type": [ "object", "null" ], "additionalProperties": true } }, "required": [], "additionalProperties": false }
- Parameters:
kwargs – keyword arguments unpacked from the JSON argument.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- StopCalibrationLoop() tuple[list[ska_control_model.ResultCode], list[str | None]][source]
Stop the calibration loop.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- __init__(*args: Any, **kwargs: Any) None[source]
Initialise this device object.
- Parameters:
args – positional args to the init
kwargs – keyword args to the init
- calibrationLoopParams() str[source]
Return the parameters of the calibration loop in a json format.
- Returns:
the parameters of the calibration loop in a json format.
- calibrationSchedule(value: str) None[source]
Set the calibration schedule.
- Parameters:
value – a JSON array of schedule entries, each with a
"cron"key and optional calibration parameter overrides, or an empty string to clear the schedule.- Raises:
ValueError – if any entry is missing
"cron", or contains an invalid cron expression.
- create_component_manager() StationCalibratorComponentManager[source]
Create and return a component manager for this device.
- Returns:
a component manager for this device.
- isLoopRunning() bool[source]
Return whether or not the calibration loop is currently running.
- Returns:
whether or not the calibration loop is currently running.
- is_GenerateCalibrationSolution_allowed(request_type: LRCReqType | None = ska_tango_base.long_running_commands.LRCReqType.ENQUEUE_REQ) bool[source]
Return whether the GenerateCalibrationSolution command is allowed.
- Parameters:
request_type – The request type
- Returns:
True if command is allowed.
- Raises:
CmdNotAllowedError – if the calibration loop or schedule is running.
- jobsInQueue() int[source]
Return number of correlator files left to process.
- Returns:
number of correlator files left to process.
- latestPreferredJobId() str[source]
Return the user_friendly_name of the most recent preferred calibration job.
- Returns:
the user_friendly_name of the most recent preferred calibration job, or an empty string if no preferred job exists.
- scheduleState(value: CalibrationScheduleState) None[source]
Pause or resume the calibration scheduler.
- Parameters:
value –
PAUSEDto suspend firing,RUNNINGto resume.EMPTYis ignored — that state is managed automatically by writing an emptycalibrationSchedule.
- scheduledSweeps() str[source]
Return all calibration runs scheduled within the next 24 hours.
Each item in the returned array has a
"scheduled_time"(ISO 8601 UTC) and any per-run parameter overrides from the schedule entry.- Returns:
a JSON array of upcoming runs, sorted by time, or
"[]"if no schedule is set.