SiglentSSA3000xSpectrumAnalyzerDataClient

class lsst.ts.ess.csc.SiglentSSA3000xSpectrumAnalyzerDataClient(config: SimpleNamespace, topics: lsst.ts.salobj.controller.Controller | types.SimpleNamespace, log: Logger, simulation_mode: int = 0)

Bases: BaseReadLoopDataClient

Get data from a Siglent SSA3000X Spectrum analyzer.

Parameters:
configtypes.SimpleNamespace

The configuration, after validation by the schema returned by get_config_schema and conversion to a types.SimpleNamespace.

topicssalobj.Controller or types.SimpleNamespace

The telemetry topics this data client can write, as a struct with attributes such as tel_spectrumAnalyzer.

loglogging.Logger

Logger.

simulation_modeint, optional

Simulation mode; 0 for normal operation.

Attributes Summary

connected

query_trace_data_cmd

set_freq_start_cmd

set_freq_stop_cmd

start_frequency

stop_frequency

Methods Summary

connect()

Connect to the data server.

descr()

Return a brief description, without the class name.

disconnect()

Disconnect from the data server.

get_config_schema()

Get the config schema as jsonschema dict.

read_data()

Read raw data from the SSA3000X Spectrum Analyzer.

read_loop()

Call the read_data method in a loop.

run()

Read data from the server and publish it as ESS telemetry.

setup_reading()

Perform any tasks before starting the read loop.

start()

Call disconnect, connect, and start the run task.

stop()

Stop reading and publishing data.

write(data)

Write the data appended with the standard terminator.

Attributes Documentation

connected
query_trace_data_cmd = ':trace:data? 1'
set_freq_start_cmd = ':frequency:start 0.0 GHz'
set_freq_stop_cmd = ':frequency:stop 3.0 GHz'
start_frequency = 0.0
stop_frequency = 3000000000.0

Methods Documentation

async connect() None

Connect to the data server.

This will not be called if already connected. See the Raises section for exceptions subclasses should raise.

Raises:
ConnectionError

If the data server rejects the connection. This may happen if the data server is down or the configuration specified an invalid address.

asyncio.TimeoutError

If a connection cannot be made in reasonable time.

Exception

(or any subclass) if any other serious problem occurs.

descr() str

Return a brief description, without the class name.

This should be just enough information to distinguish one instance of this client from another. For example RPiDataClient should return something like:

f"host={self.config.host}, port={self.config.port}"
async disconnect() None

Disconnect from the data server.

This must always be safe to call, whether connected or not.

classmethod get_config_schema() dict[str, Any]

Get the config schema as jsonschema dict.

async read_data() None

Read raw data from the SSA3000X Spectrum Analyzer.

async read_loop() None

Call the read_data method in a loop.

Allow for max_timeouts timeouts before raising a TimeoutError.

async run() None

Read data from the server and publish it as ESS telemetry.

This is called once after connect and it should keep running until cancelled. See the Raises section for exceptions subclasses should raise.

Raises:
ConnectionError

If the connection to the data server is lost.

asyncio.TimeoutError

If data is not received in reasonable time.

Exception

(or any subclass) if any other serious problem occurs.

async setup_reading() None

Perform any tasks before starting the read loop.

async start() None

Call disconnect, connect, and start the run task.

Raises the same exceptions as connect. If disconnect raises, this logs the exception and continues.

async stop() None

Stop reading and publishing data.

This is alway safe to call, whether connected or not. This should raise no exceptions except asyncio.CancelledError. If disconnect raises, this logs the exception and continues.

async write(data: str) None

Write the data appended with the standard terminator.

Parameters:
datastr

The data to write.