Tile subpackage
This subpackage implement tile functionality for the MCCS.
It includes an operational Tango device, a demonstrator Tango device, modules for driving and simulating TPM hardware, and a CLI.
- class DemoTile(*args, **kwargs)
Version of the MccsTile tango device with extra methods for testing/demos.
- class DynamicTileSimulator(logger)
A simulator for a TPM, with dynamic value updates to certain attributes.
- __init__(logger)
Initialise a new Dynamic Tile simulator instance.
- Parameters:
logger (
Logger
) – a logger for this simulator to use
- property board_temperature: float | None
Return the temperature of the TPM.
- Returns:
the temperature of the TPM
- property fpga1_temperature: float
Return the temperature of FPGA 1.
- Returns:
the temperature of FPGA 1
- class DynamicValuesGenerator(soft_min, soft_max, window_size=20, in_range_rate=0.95)
A generator of dynamic values with the following properties.
We want the values to gradually walk around their range rather than randomly jumping around. i.e. we want values to be temporally correlated. We achieve this by calculating values as a sliding window sum of a sequence of independent (uncorrelated) random values.
The provided range is a “soft” range – we allow values to walk outside this range occasionally. The proportion of time that the values should stay within the required range is exposed as an argument. This is useful for testing the alarm conditions of TANGO attributes: we set the soft range of this generator to the attribute’s alarm range, and we specify how often the attribute should exceed that range and thus start alarming.
- __init__(soft_min, soft_max, window_size=20, in_range_rate=0.95)
Create a new instance.
- Parameters:
soft_min (
float
) – a “soft” minimum value. For TANGO device attributes, this should be the alarm minimum.soft_max (
float
) – a “soft” maximum value. For TANGO device attributes, this should be the alarm maximum.window_size (
int
) – the size of the sliding window to sum over. A value of 1 will give uncorrelated values. Increasing the value increases correlation – a graph of how the value changes over time will be smoother. The default is 20.in_range_rate (
float
) – the proportion of time during which the value should remain within the [soft_min, soft_max] range. The default is 0.95. Don’t change this to 1.0 unless you want the variance to collapse: you’ll get the mean of the range every time.
- class DynamicValuesUpdater(update_rate=1.0)
An dynamic updater of values, for use in a dynamic simulator.
- __init__(update_rate=1.0)
Create a new instance.
- Parameters:
update_rate (
float
) – how often, in seconds, the target values should be updated. Defaults to 1 second.
- add_target(generator, callback)
Add a new target to be updated.
- class MccsTile(*args, **kwargs)
An implementation of a Tile Tango device for MCCS.
- ApplyCalibration(argin)
Load the calibration coefficients at the specified time delay.
- Parameters:
argin (
str
) – switch time, in ISO formatted time- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dp.command_inout("ApplyCalibration", "")
- class ApplyCalibrationCommand(component_manager, logger=None)
Class for handling the ApplyCalibration(argin) command.
- __init__(component_manager, logger=None)
Initialise a new ApplyCalibrationCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.ApplyCalibration()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- ApplyPointingDelays(argin)
Apply the pointing delays at the specified time delay.
- Parameters:
argin (
str
) – time delay (default = 0)- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dp.command_inout("ApplyPointingDelays", "")
- class ApplyPointingDelaysCommand(component_manager, logger=None)
Class for handling the ApplyPointingDelays(argin) command.
- __init__(component_manager, logger=None)
Initialise a new ApplyPointingDelayommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.ApplyPointingDelays()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Configure(argin)
Configure the tile device attributes.
- Configure40GCore(argin)
Configure 40g core_id with specified parameters.
- Parameters:
argin (
str
) –json dictionary with only optional keywords:
core_id - (int) core id
arp_table_entry - (int) ARP table entry ID
source_mac - (int) mac address
source_ip - (string) IP dot notation.
source_port - (int) source port
destination_ip - (string) IP dot notation
destination_port - (int) destination port
netmask - (int) 40g (science data) subnet mask
gateway_ip - (int) IP address of 40g (science) subnet gateway
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dict = {"core_id":2, "arp_table_entry":0, "source_mac":0x62000a0a01c9, "source_ip":"10.0.99.3", "source_port":4000, "destination_ip":"10.0.99.3", "destination_port":5000} >>> jstr = json.dumps(dict) >>> dp.command_inout("Configure40GCore", jstr)
- class Configure40GCoreCommand(component_manager, logger=None)
Class for handling the Configure40GCore() command.
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/MccsTile_Configure40gCore.json", "title": "MccsTile Configure40gCore schema", "description": "Schema for MccsTile's Configure40gCore command", "type": "object", "properties": { "core_id": { "description": "Core ID", "type": "integer" }, "arp_table_entry": { "description": "ARP table entry", "type": "integer" }, "source_mac": { "description": "Source MAC address", "type": "integer" }, "source_ip": { "description": "Source IP address", "type": "string", "format": "ipv4" }, "source_port": { "description": "Source port", "type": "integer", "minimum": 1 }, "destination_ip": { "description": "Destinate IP address", "type": "string", "format": "ipv4" }, "destination_port": { "description": "Destination port", "type": "integer", "minimum": 1 }, "rx_port_filter": { "description": "Receive ports filter", "type": "integer", "minimum": 1 }, "netmask": { "description": "Integer netmask for the 40g (science data) subnet", "type": "integer", "minimum": 0, "maximum": 4294967296 }, "gateway_ip": { "description": "Integer IP address of the 40g (science data) subnet gateway", "minimum": 0, "maximum": 4294967296 } }, "additionalProperties": false }
- __init__(component_manager, logger=None)
Initialise a new Configure40GCoreCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.Configure40GCore()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- ConfigureIntegratedBeamData(argin)
Configure the transmission of integrated beam data.
Using the provided integration time, the first channel and the last channel. The data are sent continuously until the StopIntegratedData command is run.
- Parameters:
argin (
str
) – json dictionary with optional keywords:
integration_time - (float) in seconds (default = 0.5)
first_channel - (int) default 0
last_channel - (int) default 191
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dict = {"integration_time": 0.2, "first_channel":0, "last_channel": 191} >>> jstr = json.dumps(dict) >>> dp.command_inout("ConfigureIntegratedBeamData", jstr)
- class ConfigureIntegratedBeamDataCommand(component_manager, logger=None)
Class for handling the ConfigureIntegratedBeamData() command.
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/MccsTile_ConfigureIntegratedBeamData.json", "title": "MccsTile ConfigureIntegratedBeamData schema", "description": "Schema for MccsTile's ConfigureIntegratedBeamData command", "type": "object", "properties": { "integration_time": { "description": "Integration time in seconds", "type": "number", "minimum": 0.0 }, "first_channel": { "description": "First channel", "type": "integer", "minimum": 0, "maximum": 511 }, "last_channel": { "description": "Last channel", "type": "integer", "minimum": 0, "maximum": 511 } } }
- __init__(component_manager, logger=None)
Initialise a new ConfigureIntegratedBeamDataCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.ConfigureIntegratedBeamData()
commands.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- ConfigureIntegratedChannelData(argin)
Configure and start the transmission of integrated channel data.
Using the provided integration time, first channel and last channel. Data are sent continuously until the StopIntegratedData command is run.
- Parameters:
argin (
str
) – json dictionary with optional keywords:
integration_time - (float) in seconds (default = 0.5)
first_channel - (int) default 0
last_channel - (int) default 511
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dict = {"integration_time": 0.2, "first_channel":0, "last_channel": 191} >>> jstr = json.dumps(dict) >>> dp.command_inout("ConfigureIntegratedChannelData", jstr)
- class ConfigureIntegratedChannelDataCommand(component_manager, logger=None)
Class for handling the ConfigureIntegratedChannelData(argin) command.
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/MccsTile_ConfigureIntegratedChannelData.json", "title": "MccsTile ConfigureIntegratedChannelData schema", "description": "Schema for MccsTile's ConfigureIntegratedChannelData command", "type": "object", "properties": { "integration_time": { "description": "Integration time in seconds", "type": "number", "minimum": 0.0 }, "first_channel": { "description": "First channel", "type": "integer", "minimum": 0, "maximum": 511 }, "last_channel": { "description": "Last channel", "type": "integer", "minimum": 0, "maximum": 511 } } }
- __init__(component_manager, logger=None)
Initialise a new ConfigureIntegratedChannelDataCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.ConfigureIntegratedChannelData()
commands.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- ConfigureStationBeamformer(argin)
Initialise and start the station beamformer.
Initial configuration of the tile-station beamformer. Optionally set the observed region, Default is 6.25 MHz starting at 150 MHz, and set whether the tile is the first or last in the beamformer chain.
- Parameters:
argin (
str
) –json dictionary with mandatory keywords:
start_channel - (int) start channel of the observed region default = 192 (150 MHz)
n_channels - (int) is the number of channels in the observed region default = 8 (6.25 MHz)
is_first - (bool) whether the tile is the first one in the station default False
is_last - (bool) whether the tile is the last one in the station default False
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>> dp = tango.DeviceProxy(“mccs/tile/01”) >> dict = {“start_channel”:64, “n_channels”:10, “is_first”:True, >> “is_last:True} >> jstr = json.dumps(dict) >> dp.command_inout(“ConfigureStationBeamformer”, jstr)
- class ConfigureStationBeamformerCommand(component_manager, logger=None)
Class for handling the ConfigureStationBeamformer() command.
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/MccsTile_ConfigureStationBeamformer.json", "title": "MccsTile ConfigureStationBeamformer schema", "description": "Schema for MccsTile's ConfigureStationBeamformer command", "type": "object", "properties": { "start_channel": { "description": "Start channel", "type": "integer", "minimum": 2, "maximum": 504 }, "n_channels": { "description": "Number of channels", "type": "integer", "minimum": 0, "maximum": 511 }, "is_first": { "description": "Is first", "type": "boolean" }, "is_last": { "description": "Is last", "type": "boolean" } } }
- __init__(component_manager, logger=None)
Initialise a new ConfigureStationBeamformerCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.ConfigureStationBeamformer()
commands.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Raises:
ValueError – if the argin argument does not have the right length / structure
- ConfigureTestGenerator(argin)
Set the test signal generator.
- Parameters:
argin (
str
) – json dictionary with keywords:
- tone_frequency: first tone frequency, in Hz. The frequency
is rounded to the resolution of the generator. If this is not specified, the tone generator is disabled.
- tone_amplitude: peak tone amplitude, normalized to 31.875 ADC
units. The amplitude is rounded to 1/8 ADC unit. Default is 1.0. A value of -1.0 keeps the previously set value.
- tone_2_frequency: frequency for the second tone. Same
as ToneFrequency.
- tone_2_amplitude: peak tone amplitude for the second tone.
Same as ToneAmplitude.
- noise_amplitude: RMS amplitude of the pseudorandom Gaussian
white noise, normalized to 26.03 ADC units.
- pulse_frequency: frequency of the periodic pulse. A code
in the range 0 to 7, corresponding to (16, 12, 8, 6, 4, 3, 2) times the ADC frame frequency.
- pulse_amplitude: peak amplitude of the periodic pulse, normalized
to 127 ADC units. Default is 1.0. A value of -1.0 keeps the previously set value.
- set_time: time at which the generator is set, for synchronization
among different TPMs. In UTC ISO format (string)
- adc_channels: list of adc channels which will be substituted with
the generated signal. It is a 32 integer, with each bit representing an input channel. Default: all if at least q source is specified, none otherwises.
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dict = {"tone_frequency": 150e6, "tone_amplitude": 0.1, "noise_amplitude": 0.9, "pulse_frequency": 7, "set_time": "2022-08-09T12:34:56.7Z"} >>> jstr = json.dumps(dict) >>> values = dp.command_inout("ConfigureTestGenerator", jstr)
- class ConfigureTestGeneratorCommand(component_manager, logger=None)
Class for handling the ConfigureTestGenerator() command.
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/MccsTile_ConfigureTestGenerator.json", "title": "MccsTile ConfigureTestGenerator schema", "description": "Schema for MccsTile's ConfigureTestGenerator command", "type": "object", "properties": { "set_time": { "description": "Time to start the generator, in UTC ISO format", "type": "string" }, "tone_frequency": { "description": "Tone 1 frequency in Hz of DDC 0", "type": "number" }, "tone_amplitude": { "description": "Tone 1 peak amplitude, normalized to 31.875 ADC units, resolution 0.125 ADU", "type": "number" }, "tone_2_frequency": { "description": "Tone 2 frequency in Hz of DDC 1", "type": "number" }, "tone_2_amplitude": { "description": "Tone 2 peak amplitude, normalized to 31.875 ADC units, resolution 0.125 ADU", "type": "number" }, "noise_amplitude": { "description": "Amplitude of pseudorandom noise normalized to 26.03 ADC units, resolution 0.102 ADU", "type": "number" }, "pulse_frequency": { "description": "Code for pulse frequency. Range 0 to 7: 16,12,8,6,4,3,2 times frame frequency", "type": "integer", "minimum": 0, "maximum": 7 }, "pulse_amplitude": { "description": "pulse peak amplitude, normalized to 127.5 ADC units, resolution 0.5 ADU", "type": "number" }, "adc_channels": { "description": "ADC channels", "type": "array", "items": { "type": "integer" } } } }
- __init__(component_manager, logger=None)
Initialise a new ConfigureTestGeneratorCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.ConfigureTestGenerator()
commands.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- DownloadFirmware(argin)
Download the firmware contained in bitfile to all FPGAs on the board.
This should also update the internal register mapping, such that registers become available for use.
- Parameters:
argin (
str
) – can either be the design name returned fromGetFirmwareAvailable()
command, or a path to a file- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dp.command_inout("DownloadFirmware", "/tmp/firmware/bitfile")
- Get40GCoreConfiguration(argin)
Get 40g core configuration for core_id.
This is required to chain up TPMs to form a station.
- Parameters:
argin (
str
) – json dictionary with optional keywords:
core_id - (int) core id
arp_table_entry - (int) ARP table entry ID to use
- Return type:
- Returns:
the configuration is a json string describilg a list (possibly empty) Each list entry comprising: core_id, arp_table_entry, source_mac, source_ip, source_port, destination_ip, destination_port, netmask, gateway_ip
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> core_id = 2 >>> arp_table_entry = 0 >>> argout = dp.command_inout(Get40GCoreConfiguration, core_id, arp_table_entry) >>> params = json.loads(argout)
- class Get40GCoreConfigurationCommand(component_manager, logger=None)
Class for handling the Get40GCoreConfiguration() command.
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/MccsTile_Get40gCoreConfiguration.json", "title": "MccsTile Get40gCoreConfiguration schema", "description": "Schema for MccsTile's Get40gCoreConfiguration command", "type": "object", "properties": { "core_id": { "description": "Core ID", "type": "integer" }, "arp_table_entry": { "description": "ARP table entry", "type": "integer" } } }
- __init__(component_manager, logger=None)
Initialise a new Get40GCoreConfigurationCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.Get40GCoreConfiguration()
commands.- Parameters:
- Return type:
- Returns:
json string with configuration
- Raises:
ValueError – if the argin is an invalid code id
- GetArpTable()
Return a dictionary with populated ARP table for all used cores.
40G interfaces use cores 0 (fpga0) and 1(fpga1) and ARP ID 0 for beamformer, 1 for LMC. 10G interfaces use cores 0,1 (fpga0) and 4,5 (fpga1) for beamforming, and 2, 6 for LMC with only one ARP.
- Return type:
- Returns:
a JSON-encoded dictionary of coreId and populated arpID table
- Example:
>>> argout = dp.command_inout("GetArpTable") >>> dict = json.loads(argout) >>> { >>> "core_id0": [0, 1], >>> "core_id1": [0], >>> "core_id3": [], >>> }
- class GetArpTableCommand(component_manager, logger=None)
Class for handling the GetArpTable() command.
- __init__(component_manager, logger=None)
Initialise a new GetArpTableCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.GetArpTable()
commands.- Parameters:
- Return type:
- Returns:
a JSON-encoded dictionary of coreId and populated arpID table
- GetFirmwareAvailable()
Get available firmware.
Return a dictionary containing the following information for each firmware stored on the board (such as in Flash memory).
For each firmware, a dictionary containing the following keys with their respective values should be provided: ‘design’, which is a textual name for the firmware, ‘major’, which is the major version number, and ‘minor’.
- Return type:
- Returns:
a JSON-encoded dictionary of firmware details
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> jstr = dp.command_inout("GetFirmwareAvailable") >>> dict = json.load(jstr) { "firmware1": {"design": "model1", "major": 2, "minor": 3}, "firmware2": {"design": "model2", "major": 3, "minor": 7}, "firmware3": {"design": "model3", "major": 2, "minor": 6}, }
- class GetFirmwareAvailableCommand(component_manager, logger=None)
Class for handling the GetFirmwareAvailable() command.
- __init__(component_manager, logger=None)
Initialise a new GetFirmwareAvailableCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.GetFirmwareAvailable()
command functionality.- Parameters:
- Return type:
- Returns:
json encoded string containing list of dictionaries
- GetRegisterList()
Return a list of descriptions of the exposed firmware (and CPLD) registers.
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> reglist = dp.command_inout("GetRegisterList")
- class GetRegisterListCommand(component_manager, logger=None)
Class for handling the GetRegisterList() command.
- __init__(component_manager, logger=None)
Initialise a new GetRegisterListCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.GetRegisterList()
command functionality.
- class InitCommand(*args, **kwargs)
Class that implements device initialisation for the MCCS Tile device.
- do(*args, **kwargs)
Initialise the attributes and properties of the MCCS Tile device.
- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Initialise()
Perform all required initialisation.
(switches on on-board devices, locks PLL, performs synchronisation and other operations required to start configuring the signal processing functions of the firmware, such as channelisation and beamforming)
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dp.command_inout("Initialise")
- LoadCalibrationCoefficients(argin)
Load the calibration coefficients, but does not apply them.
This is performed by apply_calibration. The calibration coefficients may include any rotation matrix (e.g. the parallactic angle), but do not include the geometric delay.
antenna - (int) is the antenna to which the coefficients will be applied.
- calibration_coefficients - [array] a bidimensional complex array comprising
calibration_coefficients[channel, polarization], with each element representing a normalized coefficient, with (1.0, 0.0) being the normal, expected response for an ideal antenna.
- channel - (int) channel is the index specifying the channels at the
beamformer output, i.e. considering only those channels actually processed and beam assignments.
polarization index ranges from 0 to 3.
0: X polarization direct element
1: X->Y polarization cross element
2: Y->X polarization cross element
3: Y polarization direct element
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> antenna = 2 >>> complex_coefficients = [[complex(3.4, 1.2), complex(2.3, 4.1), >>> complex(4.6, 8.2), complex(6.8, 2.4)]]*5 >>> inp = list(itertools.chain.from_iterable(complex_coefficients)) >>> out = ([v.real, v.imag] for v in inp] >>> coefficients = list(itertools.chain.from_iterable(out)) >>> coefficients.insert(0, float(antenna)) >>> input = list(itertools.chain.from_iterable(coefficients)) >>> dp = tango.DeviceProxy("mccs/tile/01") >>> dp.command_inout("LoadCalibrationCoefficients", input)
- class LoadCalibrationCoefficientsCommand(component_manager, logger=None)
Class for handling the LoadCalibrationCoefficients(argin) command.
- __init__(component_manager, logger=None)
Initialise a new LoadCalibrationCoefficientsCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(argin, *args, **kwargs)
Implement
MccsTile.LoadCalibrationCoefficients()
commands.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Raises:
ValueError – if the argin argument does not have the right length / structure
- LoadPointingDelays(argin)
Specify the delay in seconds and the delay rate in seconds/second.
The delay_array specifies the delay and delay rate for each antenna. beam_index specifies which beam is desired (range 0-7)
- Parameters:
argin (
list
[float
]) – An array containing: beam index, the delay in seconds and the delay rate in seconds/second, for each antenna.- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> # example delays: 16 values from -2 to +2 ns, rates = 0 >>> delays = [step * 0.25e-9 for step in list(range(-8, 8))] >>> rates = [0.0]*16 >>> beam = 0.0 >>> dp = tango.DeviceProxy("mccs/tile/01") >>> arg = [beam] >>> for i in range(16): >>> arg.append(delays[i]) >>> arg.append(rates[i]) >>> dp.command_inout("LoadPointingDelays", arg)
- class LoadPointingDelaysCommand(component_manager, logger)
Class for handling the LoadPointingDelays(argin) command.
- __init__(component_manager, logger)
Initialise a new LoadPointingDelaysCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Logger
) – the logger to be used by this Command. If not provided, then a default module logger will be used.
- do(argin, *args, **kwargs)
Implement
MccsTile.LoadPointingDelays()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Raises:
ValueError – if the argin argument does not have the right length / structure
- ReadAddress(argin)
Read n 32-bit values from address.
- Parameters:
argin (
list
[int
]) – [0] = address to read from [1] = number of values to read, default 1- Return type:
- Returns:
list of values
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> reglist = dp.command_inout("ReadAddress", [address, nvalues])
- class ReadAddressCommand(component_manager, logger=None)
Class for handling the ReadAddress(argin) command.
- __init__(component_manager, logger=None)
Initialise a new ReadAddressCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(argin, *args, **kwargs)
Implement
MccsTile.ReadAddress()
command functionality.- Parameters:
- Return type:
- Returns:
[values, ]
- Raises:
ValueError – if the argin argument has the wrong length or structure
- ReadRegister(register_name)
Return the value(s) of the specified register.
- Parameters:
register_name (
str
) – full hyerarchic register name- Return type:
- Returns:
a list of register values
- Example:
>>> dp = tango.DeviceProxy("fpga1./tile/01") >>> values = dp.command_inout("ReadRegister", "test-reg1")
- class ReadRegisterCommand(component_manager, logger=None)
Class for handling the ReadRegister(argin) command.
- __init__(component_manager, logger=None)
Initialise a new ReadRegisterCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.ReadRegister()
command functionality.- Parameters:
- Return type:
- Returns:
list of register values
- Raises:
ValueError – if the name is invalid
- SendDataSamples(argin)
Transmit a snapshot containing raw antenna data.
- Parameters:
argin (
str
) – json dictionary with optional keywords:
- data_type - type of snapshot data (mandatory): “raw”, “channel”,
“channel_continuous”, “narrowband”, “beam”
start_time - Time (UTC string) to start sending data. Default immediately
seconds - (float) Delay if timestamp is not specified. Default 0.2 seconds
Depending on the data type: raw:
- sync: bool: send synchronised samples for all antennas, vs. round robin
larger snapshot from each antenna
channel:
n_samples: Number of samples per channel, default 1024
first_channel - (int) first channel to send, default 0
last_channel - (int) last channel to send, default 511
channel_continuous
channel_id - (int) channel_id (Mandatory)
n_samples - (int) number of samples to send per packet, default 128
narrowband:
frequency - (int) Sky frequency for band centre, in Hz (Mandatory)
round_bits - (int) Specify whow many bits to round
n_samples - (int) number of spectra to send
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dict = {"data_type": "raw", "Sync":True, "Seconds": 0.2} >>> jstr = json.dumps(dict) >>> dp.command_inout("SendDataSamples", jstr)
- class SendDataSamplesCommand(component_manager, logger=None)
Class for handling the SendDataSamples() command.
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/MccsTile_SendDataSamples.json", "title": "MccsTile SendDataSamples schema", "description": "Schema for MccsTile's SendDataSamples command", "type": "object", "properties": { "data_type": { "description": "type of snapshot data (mandatory): raw, channel, channel_continuous, narrowband, beam", "type": "string", "enum": ["raw", "channel", "channel_continuous", "narrowband", "beam"] } }, "required": [ "data_type" ], "allOf": [ { "if": { "properties": { "data_type": { "const": "channel" } } }, "then": { "properties": { "first_channel": { "description": "First channel to send", "type": "integer", "minimum": 0, "maximum": 511 }, "last_channel": { "description": "Last channel to send", "type": "integer", "minimum": 0, "maximum": 511 } } } }, { "if": { "properties": { "data_type": { "const": "channel_continuous" } } }, "then": { "properties": { "channel_id": { "description": "Channel ID", "type": "integer", "minimum": 1, "maximum": 511 } }, "required": [ "channel_id" ] } }, { "if": { "properties": { "data_type": { "const": "narrowband" } } }, "then": { "properties": { "frequency": { "description": "Sky frequency of band centre, in Hz", "type": "number", "minimum": 1e6, "maximum": 399e6 } }, "required": [ "frequency" ] } } ] }
- __init__(component_manager, logger=None)
Initialise a new SendDataSamplesCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.SendDataSamples()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Raises:
ValueError – if mandatory parameters are missing
- SetBeamFormerRegions(argin)
Set the frequency regions which are going to be beamformed into each beam.
region_array is defined as a flattened 2D array, for a maximum of 48 regions. Total number of channels must be <= 384.
start_channel - (int) region starting channel, must be even in range 0 to 510
num_channels - (int) size of the region, must be a multiple of 8
beam_index - (int) beam used for this region with range 0 to 47
subarray_id - (int) Subarray
subarray_logical_channel - (int) logical channel # in the subarray
subarray_beam_id - (int) ID of the subarray beam
substation_id - (int) Substation
aperture_id: ID of the aperture (station*100+substation?)
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> regions = [[4, 24, 0, 0, 0, 3, 1, 101], [26, 40, 1, 0, 24, 4, 2, 102]] >>> input = list(itertools.chain.from_iterable(regions)) >>> dp = tango.DeviceProxy("mccs/tile/01") >>> dp.command_inout("SetBeamFormerRegions", input)
- class SetBeamFormerRegionsCommand(component_manager, logger=None)
Class for handling the SetBeamFormerRegions(argin) command.
- __init__(component_manager, logger=None)
Initialise a new SetBeamFormerRegionsCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(argin, *args, **kwargs)
Implement
MccsTile.SetBeamFormerRegions()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Raises:
ValueError – if the argin argument does not have the right length / structure
- SetLmcDownload(argin)
Specify whether control data will be transmitted over 1G or 40G networks.
- Parameters:
argin (
str
) –json dictionary with optional keywords:
mode - (string) ‘1G’ or ‘10G’ (Mandatory) (use ‘10G’ for 40G also)
payload_length - (int) SPEAD payload length for channel data
destination_ip - (string) Destination IP.
source_port - (int) Source port for integrated data streams
destination_port - (int) Destination port for integrated data streams
netmask_40g - (int) 40g (science data) subnet mask
gateway_40g - (int) IP address of 40g (science) subnet gateway
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>> dp = tango.DeviceProxy(“mccs/tile/01”) >> dict = {“mode”: “1G”, “payload_length”: 4, “destination_ip”: “10.0.1.23”} >> jstr = json.dumps(dict) >> dp.command_inout(“SetLmcDownload”, jstr)
- class SetLmcDownloadCommand(component_manager, logger=None)
Class for handling the SetLmcDownload() command.
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/MccsTile_SetLmcDownload.json", "title": "MccsTile SetLmcDownload schema", "description": "Schema for MccsTile's SetLmcDownload command", "type": "object", "properties": { "mode": { "description": "Mode: 1G or 10G", "type": "string", "enum": [ "1g", "1G", "10g", "10G" ] }, "payload_length": { "description": "SPEAD payload length for channel data", "type": "integer", "minimum": 0 }, "destination_ip": { "description": "Destination IP address", "type": "string", "format": "ipv4" }, "source_port": { "description": "Source port for integrated data streams", "type": "integer", "minimum": 0 }, "destination_port": { "description": "Destination port for integrated data streams", "type": "integer", "minimum": 0 }, "netmask_40g": { "description": "Integer netmask for the 40g (science data) subnet", "type": "integer", "minimum": 0, "maximum": 4294967296 }, "gateway_40g": { "description": "Integer IP address of the 40g (science data) subnet gateway", "minimum": 0, "maximum": 4294967296 } }, "required": [ "mode" ], "additionalProperties": false }
- __init__(component_manager, logger=None)
Initialise a new SetLmcDownloadCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.SetLmcDownload()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- SetLmcIntegratedDownload(argin)
Configure link and size of control data.
- Parameters:
argin (
str
) –json dictionary with optional keywords:
mode - (string) ‘1G’ or ‘10G’ (Mandatory)
- channel_payload_length - (int) SPEAD payload length for integrated
channel data
beam_payload_length - (int) SPEAD payload length for integrated beam data
destination_ip - (string) Destination IP
source_port - (int) Source port for integrated data streams
destination_port - (int) Destination port for integrated data streams
netmask_40g - (int) 40g (science data) subnet mask
gateway_40g - (int) IP address of 40g (science) subnet gateway
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dict = {"mode": "1G", "channel_payload_length":4, "beam_payload_length": 1024, "destination_ip": "10.0.1.23"} >>> jstr = json.dumps(dict) >>> dp.command_inout("SetLmcIntegratedDownload", jstr)
- class SetLmcIntegratedDownloadCommand(component_manager, logger=None)
Class for handling the SetLmcIntegratedDownload() command.
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/MccsTile_SetLmcIntegratedDownload.json", "title": "MccsTile SetLmcIntegratedDownload schema", "description": "Schema for MccsTile's SetLmcIntegratedDownload command", "type": "object", "properties": { "mode": { "description": "Mode: 1G or 10G", "type": "string", "enum": [ "1g", "1G", "10g", "10G" ] }, "channel_payload_length": { "description": "SPEAD payload length for integrated channel data", "type": "integer", "minimum": 0 }, "beam_payload_length": { "description": "SPEAD payload length for integrated beam data", "type": "integer", "minimum": 0 }, "destination_ip": { "description": "Destination IP address", "type": "string", "format": "ipv4" }, "source_port": { "description": "Source port for integrated data streams", "type": "integer", "minimum": 0 }, "destination_port": { "description": "Destination port for integrated data streams", "type": "integer", "minimum": 0 }, "netmask_40g": { "description": "Integer netmask for the 40g (science data) subnet", "type": "integer", "minimum": 0, "maximum": 4294967296 }, "gateway_40g": { "description": "Integer IP address of the 40g (science data) subnet gateway", "minimum": 0, "maximum": 4294967296 } }, "required": [ "mode" ], "additionalProperties": false }
- __init__(component_manager, logger=None)
Initialise a new SetLmcIntegratedDownloadCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.SetLmcIntegratedDownload()
commands.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- StartAcquisition(argin)
Start data acquisition.
- Parameters:
argin (
str
) – json dictionary with optional keywords:
start_time - (ISO UTC time) start time
delay - (int) delay start if StartTime is not specified, default 0.2s
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dict = {"start_time":"2021-11-22, "delay":20} >>> jstr = json.dumps(dict) >>> dp.command_inout("StartAcquisition", jstr)
- class StartAcquisitionCommand(command_tracker, component_manager, callback=None, logger=None)
Class for handling the StartAcquisition() command.
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/MccsTile_StartAcquisition.json", "title": "MccsTile StartAcquisition schema", "description": "Schema for MccsTile's StartAcquisition command", "type": "object", "properties": { "start_time": { "description": "", "type": "string", "format": "time" }, "delay": { "description": "An acquisition start delay", "type": "integer" } } }
- __init__(command_tracker, component_manager, callback=None, logger=None)
Initialise a new instance.
- Parameters:
command_tracker (
CommandTracker
) – the device’s command trackercomponent_manager (
TileComponentManager
) – the device’s component managercallback (
Optional
[Callable
]) – an optional callback to be called when this command starts and finishes.logger (
Optional
[Logger
]) – a logger for this command to log with.
- StartBeamformer(argin)
Start the beamformer at the specified time delay.
- Parameters:
argin (
str
) – json dictionary with optional keywords:
start_time - (str, ISO UTC time) start time
- duration - (int) if > 0 is a duration in CSP frames (2211.84 us)
if == -1 run forever
- subarray_beam_id - (int)Subarray beam ID of the channels to be started
Command affects only beamformed channels for given subarray ID Default -1: all channels
scan_id - (int) The unique ID for the started scan. Default 0
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dict = {"StartTime":10, "Duration":20} >>> jstr = json.dumps(dict) >>> dp.command_inout("StartBeamformer", jstr)
- class StartBeamformerCommand(component_manager, logger=None)
Class for handling the StartBeamformer(argin) command.
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/MccsTile_StartBeamformer.json", "title": "MccsTile StartBeamformer schema", "description": "Schema for MccsTile's StartBeamformer command", "type": "object", "properties": { "start_time": { "description": "", "oneOf": [ {"type": "string", "format": "time"}, {"type": "null"} ] }, "duration": { "description": "Duration in CSP frames (or -1 to run forever)", "oneOf": [ {"type": "integer", "minimum": -1}, {"type": "null"} ] }, "subarray_beam_id": { "description": "Subarray beam ID of the changes to be started.", "type": "integer", "minimum": -1 }, "scan_id": { "description": "The unique ID for the started scan", "type": "integer", "minimum": 0 } } }
- __init__(component_manager, logger=None)
Initialise a new StartBeamformerCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.StartBeamformer()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- StopBeamformer()
Stop the beamformer.
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dp.command_inout("StopBeamformer")
- class StopBeamformerCommand(component_manager, logger=None)
Class for handling the StopBeamformer() command.
- __init__(component_manager, logger=None)
Initialise a new StopBeamformerCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.StopBeamformer()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- StopDataTransmission()
Stop data transmission from board.
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dp.command_inout("StopDataTransmission")
- class StopDataTransmissionCommand(component_manager, logger=None)
Class for handling the StopDataTransmission() command.
- __init__(component_manager, logger=None)
Initialise a new StopDataTransmissionCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.StopDataTransmission()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- StopIntegratedData()
Stop the integrated data.
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- class StopIntegratedDataCommand(component_manager, logger=None)
Class for handling the StopIntegratedData command.
- __init__(component_manager, logger=None)
Initialise a new StopIntegratedDataCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.StopIntegratedData()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- WriteAddress(argin)
Write list of values at address.
- Parameters:
argin (
list
[int
]) – [0] = address to write to [1..n] = list of values to write- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> values = [.....] >>> address = 0xfff >>> dp = tango.DeviceProxy("mccs/tile/01") >>> dp.command_inout("WriteAddress", [address, values])
- class WriteAddressCommand(component_manager, logger=None)
Class for handling the WriteAddress(argin) command.
- __init__(component_manager, logger=None)
Initialise a new WriteAddressCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(argin, *args, **kwargs)
Implement
MccsTile.WriteAddress()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Raises:
ValueError – if the argin has the wrong length/structure
- WriteRegister(argin)
Write values to the specified register.
- Parameters:
argin (
str
) –json dictionary with mandatory keywords:
register_name - (string) register fully qualified string representation
values - (list) is a list containing the 32-bit values to write
- Return type:
tuple
[list
[ResultCode
],list
[str
]]- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Example:
>>> dp = tango.DeviceProxy("mccs/tile/01") >>> dict = {"register_name": "test-reg1", "values": values, "offset": 0} >>> jstr = json.dumps(dict) >>> dp.command_inout("WriteRegister", jstr)
- class WriteRegisterCommand(component_manager, logger=None)
Class for handling the WriteRegister() command.
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/MccsTile_WriteRegister.json", "title": "MccsTile WriteRegister schema", "description": "Schema for MccsTile's WriteRegister command", "type": "object", "properties": { "register_name": { "description": "Register fully qualified string representation", "type": "string" }, "values": { "description": "List of 32-bit values to write", "type": "array" } }, "required": ["register_name", "values"] }
- __init__(component_manager, logger=None)
Initialise a new WriteRegisterCommand instance.
- Parameters:
component_manager (
TileComponentManager
) – the device to which this command belongs.logger (
Optional
[Logger
]) – a logger for this command to use.
- do(*args, **kwargs)
Implement
MccsTile.WriteRegister()
command functionality.- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- __init__(*args, **kwargs)
Initialise this device object.
- adcHealth()
Read the ADC Health State of the device.
This is an aggregated quantity representing if any of the ADC monitoring points are outside of their thresholds. This is used to compute the overall healthState of the tile.
- Return type:
- Returns:
ADC Health State of the device
- adcPower()
Return the RMS power of every ADC signal.
(so a TPM processes 16 antennas, this should return 32 RMS value.
- alarmHealth()
Read the alarm Health State of the device.
This is an aggregated quantity representing if any of the alarm monitoring points are outside of their thresholds. This is used to compute the overall healthState of the tile.
- Return type:
- Returns:
alarm Health State of the device
- antennaIds(antenna_ids)
Set the antenna IDs.
- beamformerTable()
Get beamformer region table.
Bidimensional array of one row for each 8 channels, with elements: 0. start physical channel 1. beam number 2. subarray ID 3. subarray_logical_channel 4. subarray_beam_id 5. substation_id 6. aperture_id
Each row is a set of 7 consecutive elements in the list.
- boardTemperature()
Return the board temperature.
- Return type:
- Returns:
the board temperature
- channeliserRounding(truncation)
Set channeliser rounding.
- clockPresent()
Report if 10 MHz clock signal is present at the TPM input.
- Return type:
- Returns:
presence of 10 MHz clock signal
- create_component_manager()
Create and return a component manager for this device.
- Return type:
- Returns:
a component manager for this device.
- cspDestinationIp()
Return the cspDestinationIp attribute.
- Return type:
- Returns:
the IP address of the csp destination
- cspDestinationMac()
Return the cspDestinationMac attribute.
- Return type:
- Returns:
the MAC address of the csp destination
- cspDestinationPort()
Return the cspDestinationMac attribute.
- Return type:
- Returns:
the port of the csp destination
- cspRounding(rounding)
Set CSP formatter rounding.
- currentFrame()
Return current frame.
in units of 256 ADC frames (276,48 us) Currently this is required, not sure if it will remain so.
- Return type:
- Returns:
current frame
- currentHealth()
Read the current Health State of the device.
This is an aggregated quantity representing if any of the current monitoring points are outside of their thresholds. This is used to compute the overall healthState of the tile.
- Return type:
- Returns:
current Health State of the device
- currentTileBeamformerFrame()
Return current frame.
in units of 256 ADC frames (276,48 us) Currently this is required, not sure if it will remain so.
- Return type:
- Returns:
current frame
- dev_state()
Calculate this device state.
The base device offers some automatic state discovery. However we have some attributes that require explicit analysis as to whether they are in ALARM or not,
e.g. DevBoolean
- Return type:
- Returns:
the ‘tango.DevState’ calculated
- dsp()
Return the tile beamformer and station beamformer status.
- Return type:
- Returns:
the tile beamformer and station beamformer status
- dspHealth()
Read the dsp Health State of the device.
This is an aggregated quantity representing if any of the dsp monitoring points do not have a permitted value. This is used to compute the overall healthState of the tile.
- Return type:
- Returns:
dsp Health State of the device
- firmwareName(value)
Set the firmware name.
- firmwareVersion(value)
Set the firmware version.
- fortyGbDestinationIps()
Return the destination IPs for all 40Gb ports on the tile.
- fortyGbDestinationPorts()
Return the destination ports for all 40Gb ports on the tile.
- fpga1Temperature()
Return the temperature of FPGA 1.
- Return type:
- Returns:
the temperature of FPGA 1
- fpga2Temperature()
Return the temperature of FPGA 2.
- Return type:
- Returns:
the temperature of FPGA 2
- fpgaFrameTime()
Return the FPGA synchronization timestamp.
- Return type:
- Returns:
the FPGA timestamp, in UTC format
- fpgaReferenceTime()
Return the FPGA synchronization timestamp.
- Return type:
- Returns:
the FPGA timestamp, in UTC format
- healthModelParams(argin)
Set the params for health transition rules.
- io()
Return a dictionary of I/O interfaces status available.
- Return type:
- Returns:
I/O interfaces status
- ioHealth()
Read the io Health State of the device.
This is an aggregated quantity representing if any of the io monitoring points do not have a permitted value. This is used to compute the overall healthState of the tile.
- Return type:
- Returns:
io Health State of the device
- isBeamformerRunning()
Check if beamformer is running.
- Return type:
- Returns:
whether the beamformer is running
- isProgrammed()
Return a flag indicating whether of not the board is programmed.
- Return type:
- Returns:
whether of not the board is programmed
- is_ConfigureTestGenerator_allowed()
Check if command is allowed.
It is allowed only in maintenance mode.
- Return type:
- Returns:
whether the command is allowed
- is_Off_allowed()
Check if command On is allowed in the current device state.
- Return type:
- Returns:
True
if the command is allowed
- is_On_allowed()
Check if command On is allowed in the current device state.
- Return type:
- Returns:
True
if the command is allowed
- logicalTileId(value)
Set the logicalTileId attribute.
The logical tile id is the id of the tile in the station.
- pendingDataRequests()
Check for pending data requests.
- Return type:
- Returns:
whether there are data requests pending
- phaseTerminalCount(value)
Set the phase terminal count.
- ppsDelay()
Return the delay between PPS and 10 MHz clock.
- Return type:
- Returns:
Return the PPS delay in nanoseconds
- ppsDelayCorrection(pps_delay_correction)
Set a correction to make to the pps delay.
Note: will be applied during next initialisation.
- ppsPresent()
Report if PPS signal is present at the TPM input.
- Return type:
- Returns:
a tuple with attribute_value, time, quality
- preaduLevels(levels)
Set attenuator level of preADU channels, one per input channel.
- simulationMode(value)
Set the simulation mode.
Writing this attribute is deliberately unimplemented. The simulation mode should instead be set by setting the device’s SimulationConfig property at launch.
- Parameters:
value (
SimulationMode
) – The simulation mode, as a SimulationMode value- Return type:
- staticTimeDelays(delays)
Set static time delay.
- stationId(value)
Set the id of the station to which this tile is assigned.
- sysrefPresent()
Report if SYSREF signal is present at the FPGA.
- Return type:
- Returns:
presence of SYSREF signal
- temperatureHealth()
Read the temperature Health State of the device.
This is an aggregated quantity representing if any of the temperature monitoring points are outside of their thresholds. This is used to compute the overall healthState of the tile.
- Return type:
- Returns:
temperature Health State of the device
- temperatures()
Return all the temperatures values available.
- Return type:
- Returns:
temperatures available
- testGeneratorActive()
Report if the test generator is used for some channels.
- Return type:
- Returns:
test generator status
- testMode(value)
Set the test mode.
Writing this attribute is deliberately unimplemented. The test mode should instead be set by setting the device’s TestConfig property at launch.
- tileProgrammingState()
Get the tile programming state.
- Return type:
- Returns:
a string describing the programming state of the tile
- timing()
Return a dictionary of the timing signals status.
- Return type:
- Returns:
timing signals status
- timingHealth()
Read the timing Health State of the device.
This is an aggregated quantity representing if any of the timing monitoring points do not have a permitted value. This is used to compute the overall healthState of the tile.
- Return type:
- Returns:
timing Health State of the device
- unpack_monitoring_point(health_structure, dictionary_path)
Unpack the monitoring point value from dictionary.
- Parameters:
- Example:
>> tile_health = {‘timing’: { ‘pps’: {‘status’: False}}} >> pps=[‘timing’, ‘pps’, ‘status’] >> value = unpack_monitoring_point(tile_health, pps) >> print(value) -> False
- update_tile_health_attributes()
Update TANGO attributes from the tile health structure dictionary.
- Return type:
- voltageHealth()
Read the voltage Health State of the device.
This is an aggregated quantity representing if any of the voltage monitoring points are outside of their thresholds. This is used to compute the overall healthState of the tile.
- Return type:
- Returns:
voltage Health State of the device
- voltageMon()
Return the internal 5V supply of the TPM.
- Return type:
- Returns:
Internal supply of the TPM
- class MockTpm(logger)
Simulator for a pyfabil::Tpm class.
- __init__(logger)
Initialise the MockTPM.
- Parameters:
logger (
Logger
) – a logger for this simulator to use
- find_register(string, display=False, info=False)
Find a item in a dictionary.
This is mocking the reading of a register for the purpose of testing TPM_driver
- read_address(address, n=1)
Get address value.
- read_register(register, n=1, offset=0)
Get register value.
- property station_beamf: List[StationBeamformer]
Station beamf.
- Returns:
the station_beamf.
- write_address(address, values, retry=True)
Write address value.
- write_register(register, values, offset=0, retry=True)
Set register value.
- Parameters:
- Return type:
:raises LibraryError:Attempting to set a register not in the memory address.
- class TileComponentManager(simulation_mode, test_mode, logger, max_workers, tile_id, station_id, tpm_ip, tpm_cpld_port, tpm_version, subrack_fqdn, subrack_tpm_id, communication_state_changed_callback, component_state_changed_callback, _tpm_driver=None)
A component manager for a TPM (simulator or driver) and its power supply.
- __init__(simulation_mode, test_mode, logger, max_workers, tile_id, station_id, tpm_ip, tpm_cpld_port, tpm_version, subrack_fqdn, subrack_tpm_id, communication_state_changed_callback, component_state_changed_callback, _tpm_driver=None)
Initialise a new instance.
- Parameters:
simulation_mode (
SimulationMode
) – the simulation mode of this component manager. If SimulationMode.TRUE, then this component manager will launch an internal TPM simulator and interact with it; if SimulationMode.FALSE, this component manager will attempt to connect with an external TPM at the configured IP address and port.test_mode (
TestMode
) – the test mode of this component manager. This has no effect when the device is in SimulationMode.FALSE. But when the simulation mode is SimulationMode.TRUE, then this determines some properties of the simulator: if the test mode is TestMode.TEST, then the simulator will return static “canned” values that are easy to assert against during testing; if TestMode.NONE, the simulator will return dynamically changing values for attributes such as temperatures and voltages, making for a nice demo but not so easy to test against.logger (
Logger
) – a logger for this object to usemax_workers (
int
) – nos. of worker threadstile_id (
int
) – the unique ID for the tilestation_id (
int
) – the unique ID for the station to which this tile belongs.tpm_ip (
str
) – the IP address of the tiletpm_cpld_port (
int
) – the port at which the tile is accessed for controltpm_version (
str
) – TPM version: “tpm_v1_2” or “tpm_v1_6”subrack_fqdn (
str
) – FQDN of the subrack that controls power to this tilesubrack_tpm_id (
int
) – This tile’s position in its subrackcommunication_state_changed_callback (
Callable
[[CommunicationStatus
],None
]) – callback to be called when the status of the communications channel between the component manager and its component changescomponent_state_changed_callback (
Callable
[...
,None
]) – callback to be called when the component state changes_tpm_driver (
Optional
[TpmDriver
]) – a optional TpmDriver to inject for testing.
- apply_calibration(load_time='')
Load the calibration coefficients at the specified time delay.
- Parameters:
load_time (
str
) – switch time as ISO formatted time- Raises:
ValueError – invalid time
- Return type:
- apply_pointing_delays(load_time='')
Load the pointing delays at the specified time delay.
- Parameters:
load_time (
str
) – switch time as ISO formatted time- Raises:
ValueError – invalid time
- Return type:
- configure_test_generator(frequency0, amplitude0, frequency1, amplitude1, amplitude_noise, pulse_code, amplitude_pulse, load_time=None)
Test generator setting.
- Parameters:
frequency0 (
float
) – Tone frequency in Hz of DDC 0amplitude0 (
float
) – Tone peak amplitude, normalized to 31.875 ADC units, resolution 0.125 ADUfrequency1 (
float
) – Tone frequency in Hz of DDC 1amplitude1 (
float
) – Tone peak amplitude, normalized to 31.875 ADC units, resolution 0.125 ADUamplitude_noise (
float
) – Amplitude of pseudorandom noise normalized to 26.03 ADC units, resolution 0.102 ADUpulse_code (
int
) – Code for pulse frequency. Range 0 to 7: 16,12,8,6,4,3,2 times frame frequencyamplitude_pulse (
float
) – pulse peak amplitude, normalized to 127.5 ADC units, resolution 0.5 ADUload_time (
Optional
[str
]) – Time to start the generator. in UTC ISO formatted string.
- Raises:
ValueError – invalid time specified
- Return type:
- download_firmware(argin, task_callback=None)
Submit the download_firmware slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
- Return type:
- Returns:
A tuple containing a task status and a unique id string to identify the command
- property fpga_frame_time: str
Return FPGA frame time in UTC format.
frame time is the timestamp for the current frame being processed. Value reported here refers to the ADC frames, but the total processing delay is < 1ms and thus irrelevant on the timescales of MCCS response time
- Returns:
FPGA reference time
- property fpga_reference_time: str
Return FPGA reference time in UTC format.
Reference time is set as part of start_observation. It represents the timestamp for the first frame
- Returns:
FPGA reference time
- property fpgas_unix_time: list[int]
Return FPGA internal Unix time.
Used to check proper synchronization :return: list of two Unix time integers
- initialise(task_callback=None, program_fpga=True)
Submit the initialise slow task.
This method returns immediately after it is submitted for execution.
- off(task_callback=None)
Tell the upstream power supply proxy to turn the tpm off.
- on(task_callback=None)
Tell the upstream power supply proxy to turn the tpm on.
- post_synchronisation(task_callback=None)
Submit the post_synchronisation slow task.
This method returns immediately after it is submitted for execution.
- send_data_samples(data_type='', start_time=None, seconds=0.2, n_samples=1024, sync=False, first_channel=0, last_channel=511, channel_id=128, frequency=100.0, round_bits=3, **params)
Front end for send_xxx_data methods.
- Parameters:
data_type (
str
) – sample type. “raw”, “channel”, “channel_continuous”, “narrowband”, “beam”start_time (
Optional
[str
]) – UTC Time for start sending data. Default start nowseconds (
float
) – Delay if timestamp is not specified. Default 0.2 secondsn_samples (
int
) – number of samples to send per packetsync (
bool
) – (raw) send synchronised antenna samples, vs. round robinfirst_channel (
int
) – (channel) first channel to send, default 0last_channel (
int
) – (channel) last channel to send, default 511channel_id (
int
) – (channel_continuous) channel to sendfrequency (
float
) – (narrowband) Sky frequency for band centre, in Hzround_bits (
int
) – (narrowband) how many bits to roundparams (
Any
) – any additional keyword arguments
- Raises:
ValueError – error in time specification
- Return type:
- set_power_state(power_state)
Set the power state of the tile.
If power state changed, re-evaluate the tile programming state and updates it inside the driver. This pushes a callback if it changed.
- Parameters:
power_state (
PowerState
) – The desired power state- Return type:
- standby(task_callback=None)
Tell the upstream power supply proxy to turn the tpm on.
- start_acquisition(task_callback=None, *, start_time=None, delay=2)
Submit the start_acquisition slow task.
- Parameters:
- Return type:
- Returns:
A tuple containing a task status and a unique id string to identify the command
- start_beamformer(start_time=None, duration=-1, subarray_beam_id=-1, scan_id=0)
Start beamforming on a specific subset of the beamformed channels.
Current firmware version does not support channel mask and scan ID, these are ignored
- Parameters:
start_time (
Optional
[str
]) – Start time as ISO formatted timeduration (
int
) – Scan duration, in frames, default “forever”subarray_beam_id (
int
) – Subarray beam ID of the channels to be started Command affects only beamformed channels for given subarray ID Default -1: all channelsscan_id (
int
) – ID of the scan to be started. Default 0
- Raises:
ValueError – invalid time specified
- Return type:
- start_communicating()
Establish communication with the tpm and the upstream power supply.
- Return type:
- stop_communicating()
Establish communication with the tpm and the upstream power supply.
- Return type:
- update_tpm_power_state(power_state)
Update the power state, calling callbacks as required.
If power state is ON, then the TPM is checked for initialisation, and initialised if not already so.
- Parameters:
power_state (
PowerState
) – the new power state of the component. This can be None, in which case the internal value is updated but no callback is called. This is useful to ensure that the callback is called next time a real value is pushed.- Return type:
- class TileData
This class contain data/facts about a tile needed by multiple classes.
For example the channelized sample and beamformer frame period, the number of antennas per tile. So rather than store this fact in separate places, we store it here.
- classmethod generate_tile_defaults()
Compute the default values for tile monitoring points.
These are computed to be halfway between the minimum and maximum values. In cases where there is a permitted value instead, the permitted value is used
- class TileHealthModel(health_changed_callback, thresholds=None)
A health model for a tile.
At present this uses the base health model; this is a placeholder for a future, better implementation.
- __init__(health_changed_callback, thresholds=None)
Initialise a new instance.
- Parameters:
health_changed_callback (
HealthChangedCallbackProtocol
) – callback to be called whenever there is a change to this this health model’s evaluated health state.thresholds (
Optional
[dict
[str
,Any
]]) – the threshold parameters for the health rules
- evaluate_health()
Compute overall health of the station.
The overall health is based on the fault and communication status of the station overall, together with the health of the tiles that it manages.
This implementation simply sets the health of the station to the health of its least healthy component.
- Return type:
- Returns:
an overall health of the station
- class TileSimulator(logger)
This attempts to simulate pyaavs Tile.
This is used for testing the tpm_driver, it implements __getitem__, __setitem__ so that the TileSimulator can interface with the TPMSimulator in the same way as the AAVS Tile interfaces with the pyfabil TPM. Instead of writing to a register we write to a dictionary. It overwrite read_address, write_address, read_register, write_register for simplicity.
- __init__(logger)
Initialise a new TPM simulator instance.
- Parameters:
logger (
Logger
) – a logger for this simulator to use
- check_arp_table(timeout=30.0)
Check arp table.
- check_global_status_alarms()
Check global status alarms.
- configure_40g_core(core_id=0, arp_table_entry=0, src_mac=None, src_ip=None, src_port=None, dst_ip=None, dst_port=None, rx_port_filter=None, netmask=None, gateway_ip=None)
Configure the 40G code.
The dst_mac parameter is ignored in true 40G core (ARP resolution used instead)
- Parameters:
- Raises:
ValueError – when the core_id is not [0,1]
- Return type:
- configure_integrated_beam_data(integration_time=0.5, first_channel=0, last_channel=192)
Configure and start continuous integrated beam data.
- configure_integrated_channel_data(integration_time=0.5, first_channel=0, last_channel=512)
Configure and start continuous integrated channel data.
TODO Implement generation of integrated packets :type integration_time:
float
:param integration_time: integration time in seconds, defaults to 0.5 :type first_channel:int
:param first_channel: first channel :type last_channel:int
:param last_channel: last channel- Return type:
- connect(initialise=False, load_plugin=True, enable_ada=False, enable_adc=True, dsp_core=True, adc_mono_channel_14_bit=False, adc_mono_channel_sel=0)
Attempt to form a connection with TPM.
- Parameters:
initialise (
bool
) – Initialises the TPM objectload_plugin (
bool
) – loads software pluginsenable_ada (
bool
) – Enable ADC amplifier (usually not present)enable_adc (
bool
) – Enable ADCdsp_core (
bool
) – Enable loading of DSP core pluginsadc_mono_channel_14_bit (
bool
) – Enable ADC mono channel 14bit modeadc_mono_channel_sel (
int
) – Select channel in mono channel mode (0=A, 1=B)
- Return type:
- define_spead_header(station_id, subarray_id, nof_antennas, ref_epoch=-1, start_time=0)
Define the SPEAD header for the given parameters.
- Parameters:
- Return type:
- Returns:
a bool representing if command executed without error.
- erase_fpga(force=True)
Erase the fpga firmware.
- get_40g_core_configuration(core_id=-1, arp_table_entry=0)
Return a 40G configuration.
- Parameters:
- Return type:
- Returns:
core configuration or list of core configurations or none
- get_adc_rms(sync=False)
Get ADC power, immediate.
- get_fpga_time(device)
- Parameters:
device (
Device
) – device.- Return type:
- Returns:
the fpga_time.
- Raises:
LibraryError – If invalid device specified.
- get_fpga_timestamp(device=pyfabil.base.definitions.Device.FPGA_1)
Get timestamp from FPGA.
- Parameters:
device (
Device
) – device.- Return type:
- Returns:
the simulated timestamp.
- Raises:
LibraryError – Invalid device specified
- get_health_status(**kwargs)
Get the health state of the tile.
- get_phase_terminal_count()
Get PPS phase terminal count.
- Return type:
- Returns:
the simulated phase terminal count.
- get_pps_delay(enable_correction=True)
Get the pps delay.
- get_preadu_levels()
Get preADU attenuation levels.
- initialise(station_id=0, tile_id=0, lmc_use_40g=False, lmc_dst_ip=None, lmc_dst_port=4660, lmc_integrated_use_40g=False, src_ip_fpga1=None, src_ip_fpga2=None, dst_ip_fpga1=None, dst_ip_fpga2=None, src_port=4661, dst_port=4660, dst_port_single_port_mode=4662, rx_port_single_port_mode=4662, netmask_40g=None, gateway_ip_40g=None, active_40g_ports_setting='port1-only', enable_adc=True, enable_ada=False, enable_test=False, use_internal_pps=False, pps_delay=0, time_delays=0, is_first_tile=False, is_last_tile=False, qsfp_detection='auto', adc_mono_channel_14_bit=False, adc_mono_channel_sel=0)
Initialise tile.
- Parameters:
station_id (
int
) – station IDtile_id (
int
) – Tile ID in the stationlmc_use_40g (
bool
) – if True use 40G interface to transmit LMC data, otherwise use 1Glmc_dst_ip (
Optional
[str
]) – destination IP address for LMC data packetslmc_dst_port (
int
) – destination UDP port for LMC data packetslmc_integrated_use_40g (
bool
) – if True use 40G interface to transmit LMC integrated data, otherwise use 1Gsrc_ip_fpga1 (
Optional
[str
]) – source IP address for FPGA1 40G interfacesrc_ip_fpga2 (
Optional
[str
]) – source IP address for FPGA2 40G interfacedst_ip_fpga1 (
Optional
[str
]) – destination IP address for beamformed data from FPGA1 40G interfacedst_ip_fpga2 (
Optional
[str
]) – destination IP address for beamformed data from FPGA2 40G interfacesrc_port (
int
) – source UDP port for beamformed data packetsdst_port (
int
) – destination UDP port for beamformed data packetsenable_ada (
bool
) – enable adc amplifier, Not present in most TPM versionsenable_adc (
bool
) – Enable ADCactive_40g_ports_setting (
str
) – placeholder docstringdst_port_single_port_mode (
int
) – placeholder docstringrx_port_single_port_mode (
int
) – placeholder docstringenable_test (
bool
) – setup internal test signal generator instead of ADCuse_internal_pps (
bool
) – use internal PPS generator synchronised across FPGAspps_delay (
int
) – PPS delay correction in 625ps unitstime_delays (
int
) – time domain delays for 32 inputsis_first_tile (
bool
) – True if this tile is the first tile in the beamformer chainis_last_tile (
bool
) – True if this tile is the last tile in the beamformer chainqsfp_detection (
str
) – “auto” detects QSFP cables automatically, “qsfp1”, force QSFP1 cable detected, QSFP2 cable not detected “qsfp2”, force QSFP1 cable not detected, QSFP2 cable detected “all”, force QSFP1 and QSFP2 cable detected “flyover_test”, force QSFP1 and QSFP2 cable detected and adjust polarity for board-to-board cable “none”, force no cable not detectedadc_mono_channel_14_bit (
bool
) – Enable ADC mono channel 14bit modeadc_mono_channel_sel (
int
) – Select channel in mono channel mode (0=A, 1=B)
- Return type:
- initialise_beamformer(start_channel, nof_channels)
Mock set the beamformer parameters.
- Parameters:
- Raises:
ValueError – For out of range values.
- Return type:
- is_programmed()
Return whether the mock has been implemented.
- Return type:
- Returns:
the mocked programmed state
- load_antenna_tapering(beam, tapering_coefficients)
Load antenna tapering.
- load_beam_angle(angle_coefficients)
Load beam angle.
- load_calibration_coefficients(antenna, calibration_coefficients)
Load calibration coefficients.
calibration_coefficients is a bi-dimensional complex array of the form calibration_coefficients[channel, polarization], with each element representing a normalized coefficient, with (1.0, 0.0) the normal, expected response for an ideal antenna. Channel is the index specifying the channels at the beamformer output, i.e. considering only those channels actually processed and beam assignments. The polarization index ranges from 0 to 3. 0: X polarization direct element 1: X->Y polarization cross element 2: Y->X polarization cross element 3: Y polarization direct element The calibration coefficients may include any rotation matrix (e.g. the parallitic angle), but do not include the geometric delay.
- load_pointing_delay(load_time=0, load_delay=64)
Load pointing delay.
- mock_off()
Fake a connection by constructing the TPM.
- NOTE:
This method exists in the Simulator Only
- Return type:
- mock_on()
Fake a connection by constructing the TPM.
- NOTE:
This method exists in the Simulator Only
- Return type:
- program_fpgas(bitfile)
Mock programmed state to True.
- send_beam_data(timeout=0, timestamp=0, seconds=0.2)
Send beam data.
- send_channelised_data(number_of_samples=1024, first_channel=0, last_channel=511, timestamp=None, seconds=0.2)
Send channelised data from the TPM.
- send_channelised_data_continuous(channel_id, number_of_samples=128, wait_seconds=0, timestamp=None, seconds=0.2)
Continuously send channelised data from a single channel.
- send_channelised_data_narrowband(frequency, round_bits, number_of_samples=128, wait_seconds=0, timestamp=None, seconds=0.2)
Continuously send channelised data from a single channel.
- Parameters:
- Return type:
- send_raw_data(sync=False, timestamp=None, seconds=0.2, fpga_id=None)
Send raw data.
- set_beamformer_regions(region_array)
Set beamformer region_array.
- set_channeliser_truncation(trunc, signal=None)
Set the channeliser coefficients to modify the bandpass.
- set_csp_rounding(rounding)
Set the final rounding in the CSP samples, one value per beamformer channel.
- set_first_last_tile(is_first, is_last)
Set first last tile in chain.
- set_lmc_download(mode, payload_length=1024, dst_ip=None, src_port=61648, dst_port=4660, netmask_40g=None, gateway_ip_40g=None)
Specify where the control data will be transmitted.
With the simulator no traffic will leave the cluster. To transmit data from the pod hosting the simulator to the DAQ (data acquisition) receiver, a Kubernetes service is required. Therefore dst_ip is the name of the service to use rather than the IP.
- set_lmc_integrated_download(mode, channel_payload_length, beam_payload_length, dst_ip=None, src_port=61648, dst_port=4660, netmask_40g=None, gateway_ip_40g=None)
Configure link and size of control data for integrated LMC packets.
- Parameters:
mode (
str
) – ‘1G’ or ‘10G’channel_payload_length (
int
) – SPEAD payload length for integrated channel databeam_payload_length (
int
) – SPEAD payload length for integrated beam datasrc_port (
int
) – Source port for integrated data streamsdst_port (
int
) – Destination port for integrated data streamsgateway_ip_40g (
Optional
[str
]) – the gateway ip for the 40g.
- Return type:
- set_pointing_delay(delay_array, beam_index)
Set pointing delay.
- set_preadu_levels(levels)
Set preADU attenuation levels.
- set_station_id(station_id, tile_id)
Set mock registers to some value.
- set_test_generator_pulse(freq_code, amplitude=0.0)
Set test generator pulse.
- set_time_delays(delays)
Set coarse zenith delay for input ADC streams.
- start_acquisition(start_time=None, delay=2, tpm_start_time=None)
Start data acquisition.
- start_beamformer(start_time=0, duration=-1, scan_id=0, mask=1099511627775)
Start beamformer.
- switch_calibration_bank(switch_time=0)
Switch calibration bank.
- test_generator_input_select(inputs)
Test generator input select.
- test_generator_set_noise(amplitude_noise=0.0, load_time=0)
Set generator test noise.
- test_generator_set_tone(generator, frequency=100000000.0, amplitude=0.0, phase=0.0, load_time=0)
Test generator tone setting.
- class TileTime(reference_time=0)
Library to convert from rfc3339 strings to internal Tile time and back.
Frame time is the time expressed as an offset in frames from a timestamp. Unix time is used for the timestamp. It is expressed in integrer seconds from 1970-01-01T01:00:00.000000Z. Time is otherwise expressed as a ISO-8601 (RFC3339) string, e.g. 2021-03-02T12:34.56.789000Z.
- __init__(reference_time=0)
Set the internal reference time. To be used each time it is reset.
- Parameters:
reference_time (
int
) – Unix timestamp of the (integer) reference time
- format_time_from_frame(frame_count)
Format a time expressed as frame count into ISO-8601 (RFC3339) string.
e.g. 2021-03-02T12:34.56.789000Z. Returns the Unix zero time if the object is not yet initialised.
- format_time_from_timestamp(timestamp)
Format a time expressed as a frame count into ISO-8601.
Format a time expressed as a frame count into a properly formatted ISO-8601 (RFC3339) string, e.g. 2021-03-02T12:34.56.789000Z.
- frame_from_utc_time(utc_time)
Return first frame after specified time.
- set_reference_time(reference_time)
Set the internal reference time. To be used each time it is reset.
- timestamp_from_utc_time(utc_time)
Return first timestamp (Unix) second after specified time.
Does not account for leap seconds, utc_time must avoid them.
- class TpmDriver(logger, tile_id, station_id, tile, tpm_version, communication_state_changed_callback, component_state_changed_callback)
Hardware driver for a TPM.
- __init__(logger, tile_id, station_id, tile, tpm_version, communication_state_changed_callback, component_state_changed_callback)
Initialise a new TPM driver instance passing in the Tile object.
- Parameters:
logger (
Logger
) – a logger for this simulator to usetile_id (
int
) – the unique ID for the tilestation_id (
int
) – the unique ID for the station to which this tile belongs.tile (
Tile
) – the tile driven by this TpmDrivertpm_version (
str
) – TPM version: “tpm_v1_2” or “tpm_v1_6”communication_state_changed_callback (
Callable
[[CommunicationStatus
],None
]) – callback to be called when the status of the communications channel between the component manager and its component changescomponent_state_changed_callback (
Callable
[...
,None
]) – callback to be called when the component state changes.
- property adc_rms: list[float]
Return the last measured RMS power of the TPM’s analog-to-digital converter.
- Returns:
the RMS power of the TPM’s ADC
- property alarms: dict[str, Any]
Return the alarms status in the TPM.
- Returns:
alarms status in the TPM
- apply_calibration(switch_time=0)
Switch the calibration bank.
(i.e. apply the calibration coefficients previously loaded by
load_calibration_coefficients()
).
- apply_pointing_delays(load_time)
Load the pointing delay at a specified time.
- property arp_table: dict[int, list[int]]
Check that ARP table has been populated in for all used cores 40G interfaces.
Use cores 0 (fpga0) and 1(fpga1) and ARP ID 0 for beamformer, 1 for LMC 10G interfaces use cores 0,1 (fpga0) and 4,5 (fpga1) for beamforming, and 2, 6 for LMC with only one ARP.
- Returns:
list of core id and arp table populated
- property beamformer_table: list[list[int]]
Fetch internal beamformer table.
Fetch table used by the hardware beamformer to define beams and logical bands :return: bidimensional table, with 48 entries, one every 8 channels
start physical channel
tile hardware beam
subarray ID
subarray start logical channel
subarray_beam_id - (int) ID of the subarray beam
substation_id - (int) Substation
aperture_id: ID of the aperture (station*100+substation?)
- property board_temperature: float
Return the temperature of the TPM.
- Returns:
the temperature of the TPM
- property channeliser_truncation: list[int]
Read the cached value for the channeliser truncation.
- Returns:
cached value for the channeliser truncation
- property clock_present: bool
Check if 10 MHz clock signal is present.
- Returns:
True if 10 MHz clock is present. Checked in poll loop, cached
- configure_40g_core(core_id=0, arp_table_entry=0, src_mac=None, src_ip=None, src_port=None, dst_ip=None, dst_port=None, rx_port_filter=None, netmask=None, gateway_ip=None)
Configure the 40G code.
- configure_integrated_beam_data(integration_time=0.5, first_channel=0, last_channel=191)
Configure and start the transmission of integrated channel data.
Configure with the provided integration time, first channel and last channel. Data are sent continuously until the StopIntegratedData command is run.
- configure_integrated_channel_data(integration_time=0.5, first_channel=0, last_channel=511)
Configure and start the transmission of integrated channel data.
Configure with the provided integration time, first channel and last channel. Data are sent continuously until the StopIntegratedData command is run.
- configure_test_generator(frequency0, amplitude0, frequency1, amplitude1, amplitude_noise, pulse_code, amplitude_pulse, load_time=0)
Test generator setting.
- Parameters:
frequency0 (
float
) – Tone frequency in Hz of DDC 0amplitude0 (
float
) – Tone peak amplitude, normalized to 31.875 ADC units, resolution 0.125 ADUfrequency1 (
float
) – Tone frequency in Hz of DDC 1amplitude1 (
float
) – Tone peak amplitude, normalized to 31.875 ADC units, resolution 0.125 ADUamplitude_noise (
float
) – Amplitude of pseudorandom noise normalized to 26.03 ADC units, resolution 0.102 ADUpulse_code (
int
) – Code for pulse frequency. Range 0 to 7: 16,12,8,6,4,3,2 times frame frequencyamplitude_pulse (
float
) – pulse peak amplitude, normalized to 127.5 ADC units, resolution 0.5 ADUload_time (
int
) – Time to start the generator.
- Return type:
- property csp_rounding: numpy.ndarray | None
Read the cached value for the final rounding in the CSP samples.
Need to be specfied only for the last tile :return: Final rounding for the CSP samples. Up to 384 values
- property current_tile_beamformer_frame: int
Return current tile beamformer frame, in units of 256 ADC frames.
- Returns:
current tile beamformer frame
- property currents: dict[str, Any]
Return a dictionary of all current values available in the TPM.
- Returns:
currents in the TPM
- download_firmware(bitfile)
Download the provided firmware bitfile onto the TPM.
- property dsp: dict[str, Any]
Return the tile beamformer and station beamformer status in the TPM.
- Returns:
tile beamformer and station beamformer status in the TPM
- property firmware_available: list[dict[str, Any]]
Return the list of the firmware loaded in the system.
- Returns:
the firmware list
- property firmware_name: str
Return the name of the firmware that this TPM simulator is running.
- Returns:
firmware name
- property firmware_version: str
Return the name of the firmware that this TPM simulator is running.
- Returns:
firmware version (major.minor)
- property fpga1_temperature: float
Return the temperature of FPGA 1.
- Returns:
the temperature of FPGA 1
- property fpga2_temperature: float
Return the temperature of FPGA 2.
- Returns:
the temperature of FPGA 2
- property fpga_current_frame: int
Return the FPGA current frame counter.
- Returns:
the FPGA_1 current frame counter
- Raises:
ConnectionError – if communication with tile failed
- property fpga_reference_time: int
Return the FPGA reference time.
Required to map the FPGA timestamps, expressed in frames to UTC time
- Returns:
the FPGA_1 reference time, in Unix seconds
- property fpgas_time: list[int]
Return the FPGAs clock time.
Useful for detecting clock skew, propagation delays, contamination delays, etc.
- Returns:
the FPGAs clock time
- Raises:
ConnectionError – if communication with tile failed
- get_40g_configuration(core_id=-1, arp_table_entry=0)
Return a 40G configuration.
- get_tile_id()
Get the tile ID stored in the FPGA.
- Return type:
- Returns:
tile ID
- Raises:
LibraryError
- property hardware_version: str
Return whether this TPM is 1.2 or 1.6.
- Returns:
TPM hardware version. 120 or 160
- initialise_beamformer(start_channel, nof_channels, is_first, is_last)
Initialise the beamformer.
- property io: dict[str, Any]
Return a dictionary of I/O Interfaces status available in the TPM.
- Returns:
io in the TPM
- property is_beamformer_running: bool
Whether the beamformer is currently running.
- Returns:
whether the beamformer is currently running
- property is_programmed: bool
Return whether this TPM is programmed (i.e. firmware has been downloaded to it).
- Returns:
whether this TPM is programmed
- load_calibration_coefficients(antenna, calibration_coefficients)
Load calibration coefficients.
These may include any rotation matrix (e.g. the parallactic angle), but do not include the geometric delay.
- load_pointing_delays(delay_array, beam_index)
Specify the delay in seconds and the delay rate in seconds/second.
The delay_array specifies the delay and delay rate for each antenna. beam_index specifies which beam is desired (range 0-7)
- property pending_data_requests: bool
Check for pending data requests.
- Returns:
whether there are pending send data requests
- property phase_terminal_count: int
Return the phase terminal count.
- Returns:
the phase terminal count
- property pll_locked: bool
Check if ADC clock PLL is locked.
- Returns:
True if PLL is locked. Checked in poll loop, cached
- post_synchronisation()
Perform post tile configuration synchronization.
TODO Private method or must be available externally?
- Return type:
- property pps_delay: int | None
Return last measured delay between PPS and 10 MHz clock.
- Returns:
PPS delay correction in nanoseconds. Rounded to 1.25 ns units
- property pps_delay_correction: int | None
Return last measured ppsdelay correction.
- Returns:
PPS delay correction in nanoseconds. Rounded to 1.25 ns units
- property pps_present: bool
Check if PPS signal is present.
- Returns:
True if PPS is present. Checked in poll loop, cached
- property preadu_levels: list[float] | None
Get preadu levels in dB.
- Returns:
cached values of Preadu attenuation level in dB
- read_address(address, nvalues)
Return a list of values from a given address.
- read_register(register_name)
Read the values in a named register.
- property register_list: list[str]
Return a list of registers available on each device.
- Returns:
list of registers
- send_data_samples(data_type='', timestamp=0, seconds=0.2, n_samples=1024, sync=False, first_channel=0, last_channel=511, channel_id=128, frequency=150000000.0, round_bits=3)
Front end for send_xxx_data methods.
- Parameters:
data_type (
str
) – sample type. “raw”, “channel”, “channel_continuous”, “narrowband”, “beam”timestamp (
int
) – Timestamp for start sending data. Default 0 start nowseconds (
float
) – Delay if timestamp is not specified. Default 0.2 secondsn_samples (
int
) – number of samples to send per packetsync (
bool
) – (raw) send synchronised antenna samples, vs. round robinfirst_channel (
int
) – (channel) first channel to send, default 0last_channel (
int
) – (channel) last channel to send, default 511channel_id (
int
) – (channel_continuous) channel to sendfrequency (
float
) – (narrowband) Sky frequency for band centre, in Hzround_bits (
int
) – (narrowband) how many bits to round
- Raises:
ValueError – if values wrong
- Return type:
- set_beamformer_regions(regions)
Set the frequency regions to be beamformed into a single beam.
The input list contains up to 48 blocks which represent at most 16 contiguous channel regions. Each block has 8 entries which represent: - starting physical channel - number of channels - hardware beam number - subarray ID - subarray logical channel - subarray beam ID - substation ID
- set_lmc_download(mode, payload_length=1024, dst_ip=None, src_port=61648, dst_port=4660, netmask_40g=None, gateway_40g=None)
Specify whether control data will be transmitted over 1G or 40G networks.
- set_lmc_integrated_download(mode, channel_payload_length, beam_payload_length, dst_ip=None, src_port=61648, dst_port=4660, netmask_40g=None, gateway_40g=None)
Configure link and size of control data.
- Parameters:
mode (
str
) – ‘1G’ or ‘10G’channel_payload_length (
int
) – SPEAD payload length for integrated channel databeam_payload_length (
int
) – SPEAD payload length for integrated beam datasrc_port (
int
) – source port, defaults to 0xF0D0dst_port (
int
) – destination port, defaults to 4660gateway_40g (
Optional
[int
]) – IP address of the 40g subnet gateway, if it exists.
- Return type:
- start_acquisition(start_time=None, delay=2)
Start data acquisition.
This must be run as a long running command
- start_beamformer(start_time=0, duration=-1, subarray_beam_id=1, scan_id=0)
Start the beamformer at the specified time.
- Parameters:
- Return type:
- property static_delays: list[float]
Read the cached value for the static delays, in sample.
- Returns:
static delay, in samples one per TPM input
- stop_communicating()
Stop communicating with the TPM.
- Todo:
is there a better way to do this? Should Tile16 have a disconnect() method that we can call here?
- Return type:
- stop_data_transmission()
Stop data transmission for send_channelised_data_continuous.
- Return type:
- property sysref_present: bool
Check if SYSREF signal is present.
- Returns:
True if SYSREF is present. Checked in poll loop, cached
- property temperatures: dict[str, Any]
Return a dictionary of all temperature values available in the TPM.
- Returns:
temperatures in the TPM
- property test_generator_active: bool
Check if the test generator is active.
- Returns:
whether the test generator is active
- test_generator_input_select(inputs=0)
Specify ADC inputs which are substitute to test signal.
Specified using a 32 bit mask, with LSB for ADC input 0.
- property timing: dict[str, Any]
Return a dictionary of the Timing Signals status available in the TPM.
- Returns:
timings in the TPM
- tpm_disconnected(intentional_disconnect=False)
Tile disconnected to tpm.
- property voltage_mon: float
Return the internal 5V supply of the TPM.
- Returns:
the internal 5V supply of the TPM
- property voltages: dict[str, Any]
Return a dictionary of all voltage values available in the TPM.
- Returns:
voltages in the TPM
- write_address(address, values)
Write a list of values to a given address.
- class TpmStatus(value)
Enumerated type for tile status.
Used in initialisation to know what long running commands have been issued
- INITIALISED = 5
Initialise command has been issued.
- OFF = 1
The TPM is not powered.
- PROGRAMMED = 4
The TPM is powered on and FPGAS are programmed.
- SYNCHRONISED = 6
Time has been synchronised with UTC, timestamp is valid.
- UNCONNECTED = 2
The TPM is not connected.
- UNKNOWN = 0
The status is not known.
- UNPROGRAMMED = 3
The TPM is powered on but FPGAS are not programmed.
- Demo tile device
- Tile CLI
CliMeta
MccsTileCli
MccsTileCli.ConfigureIntegratedBeamData()
MccsTileCli.ConfigureIntegratedChannelData()
MccsTileCli.LoadPointingDelay()
MccsTileCli.SendBeamData()
MccsTileCli.SendChannelisedData()
MccsTileCli.SendChannelisedDataContinuous()
MccsTileCli.SendRawData()
MccsTileCli.StartBeamformer()
MccsTileCli.StopBeamformer()
MccsTileCli.__init__()
MccsTileCli.connect()
MccsTileCli.logginglevel()
MccsTileCli.subarrayid()
command_result_as_string()
main()
- Tile orchestrator
Stimulus
Stimulus.DESIRE_OFF
Stimulus.DESIRE_OFFLINE
Stimulus.DESIRE_ON
Stimulus.DESIRE_ONLINE
Stimulus.SUBRACK_COMMS_ESTABLISHED
Stimulus.SUBRACK_COMMS_NOT_ESTABLISHED
Stimulus.SUBRACK_SAYS_TPM_NO_SUPPLY
Stimulus.SUBRACK_SAYS_TPM_OFF
Stimulus.SUBRACK_SAYS_TPM_ON
Stimulus.SUBRACK_SAYS_TPM_UNKNOWN
Stimulus.TPM_COMMS_ESTABLISHED
Stimulus.TPM_COMMS_NOT_ESTABLISHED
TileOrchestrator
TileOrchestrator.__init__()
TileOrchestrator.desire_off()
TileOrchestrator.desire_offline()
TileOrchestrator.desire_on()
TileOrchestrator.desire_online()
TileOrchestrator.desire_standby()
TileOrchestrator.propogate_subrack_lrc()
TileOrchestrator.update_subrack_communication_state()
TileOrchestrator.update_tpm_communication_state()
TileOrchestrator.update_tpm_power_state()
- Tile component manager
TileComponentManager
TileComponentManager.__init__()
TileComponentManager.apply_calibration()
TileComponentManager.apply_pointing_delays()
TileComponentManager.configure_test_generator()
TileComponentManager.download_firmware()
TileComponentManager.fpga_frame_time
TileComponentManager.fpga_reference_time
TileComponentManager.fpga_time
TileComponentManager.fpgas_unix_time
TileComponentManager.initialise()
TileComponentManager.off()
TileComponentManager.on()
TileComponentManager.post_synchronisation()
TileComponentManager.send_data_samples()
TileComponentManager.set_power_state()
TileComponentManager.standby()
TileComponentManager.start_acquisition()
TileComponentManager.start_beamformer()
TileComponentManager.start_communicating()
TileComponentManager.stop_communicating()
TileComponentManager.tpm_status
TileComponentManager.update_tpm_power_state()
- Tile device
MccsTile
MccsTile.ApplyCalibration()
MccsTile.ApplyCalibrationCommand
MccsTile.ApplyPointingDelays()
MccsTile.ApplyPointingDelaysCommand
MccsTile.Configure()
MccsTile.Configure40GCore()
MccsTile.Configure40GCoreCommand
MccsTile.ConfigureIntegratedBeamData()
MccsTile.ConfigureIntegratedBeamDataCommand
MccsTile.ConfigureIntegratedChannelData()
MccsTile.ConfigureIntegratedChannelDataCommand
MccsTile.ConfigureStationBeamformer()
MccsTile.ConfigureStationBeamformerCommand
MccsTile.ConfigureTestGenerator()
MccsTile.ConfigureTestGeneratorCommand
MccsTile.DownloadFirmware()
MccsTile.Get40GCoreConfiguration()
MccsTile.Get40GCoreConfigurationCommand
MccsTile.GetArpTable()
MccsTile.GetArpTableCommand
MccsTile.GetFirmwareAvailable()
MccsTile.GetFirmwareAvailableCommand
MccsTile.GetRegisterList()
MccsTile.GetRegisterListCommand
MccsTile.InitCommand
MccsTile.Initialise()
MccsTile.LoadCalibrationCoefficients()
MccsTile.LoadCalibrationCoefficientsCommand
MccsTile.LoadPointingDelays()
MccsTile.LoadPointingDelaysCommand
MccsTile.ReadAddress()
MccsTile.ReadAddressCommand
MccsTile.ReadRegister()
MccsTile.ReadRegisterCommand
MccsTile.SendDataSamples()
MccsTile.SendDataSamplesCommand
MccsTile.SetBeamFormerRegions()
MccsTile.SetBeamFormerRegionsCommand
MccsTile.SetLmcDownload()
MccsTile.SetLmcDownloadCommand
MccsTile.SetLmcIntegratedDownload()
MccsTile.SetLmcIntegratedDownloadCommand
MccsTile.StartAcquisition()
MccsTile.StartAcquisitionCommand
MccsTile.StartBeamformer()
MccsTile.StartBeamformerCommand
MccsTile.StopBeamformer()
MccsTile.StopBeamformerCommand
MccsTile.StopDataTransmission()
MccsTile.StopDataTransmissionCommand
MccsTile.StopIntegratedData()
MccsTile.StopIntegratedDataCommand
MccsTile.WriteAddress()
MccsTile.WriteAddressCommand
MccsTile.WriteRegister()
MccsTile.WriteRegisterCommand
MccsTile.__init__()
MccsTile.adcHealth()
MccsTile.adcPower()
MccsTile.adcs()
MccsTile.alarmHealth()
MccsTile.alarms()
MccsTile.antennaIds()
MccsTile.beamformerTable()
MccsTile.boardTemperature()
MccsTile.channeliserRounding()
MccsTile.clockPresent()
MccsTile.create_component_manager()
MccsTile.cspDestinationIp()
MccsTile.cspDestinationMac()
MccsTile.cspDestinationPort()
MccsTile.cspRounding()
MccsTile.currentFrame()
MccsTile.currentHealth()
MccsTile.currentTileBeamformerFrame()
MccsTile.currents()
MccsTile.dev_state()
MccsTile.dsp()
MccsTile.dspHealth()
MccsTile.firmwareName()
MccsTile.firmwareVersion()
MccsTile.fortyGbDestinationIps()
MccsTile.fortyGbDestinationPorts()
MccsTile.fpga1Temperature()
MccsTile.fpga2Temperature()
MccsTile.fpgaFrameTime()
MccsTile.fpgaReferenceTime()
MccsTile.fpgaTime()
MccsTile.fpgasUnixTime()
MccsTile.healthModelParams()
MccsTile.init_command_objects()
MccsTile.init_device()
MccsTile.io()
MccsTile.ioHealth()
MccsTile.isBeamformerRunning()
MccsTile.isProgrammed()
MccsTile.is_ConfigureTestGenerator_allowed()
MccsTile.is_Off_allowed()
MccsTile.is_On_allowed()
MccsTile.logicalTileId()
MccsTile.pendingDataRequests()
MccsTile.phaseTerminalCount()
MccsTile.pllLocked()
MccsTile.ppsDelay()
MccsTile.ppsDelayCorrection()
MccsTile.ppsPresent()
MccsTile.preaduLevels()
MccsTile.simulationMode()
MccsTile.staticTimeDelays()
MccsTile.stationId()
MccsTile.sysrefPresent()
MccsTile.temperatureHealth()
MccsTile.temperatures()
MccsTile.testGeneratorActive()
MccsTile.testMode()
MccsTile.tileProgrammingState()
MccsTile.timing()
MccsTile.timingHealth()
MccsTile.unpack_monitoring_point()
MccsTile.update_tile_health_attributes()
MccsTile.voltageHealth()
MccsTile.voltageMon()
MccsTile.voltages()
main()
- Tile health model
- Tile health rules