WindsonicSensor

class lsst.ts.ess.common.sensor.WindsonicSensor(log: Logger, num_channels: int = 0)

Bases: BaseSensor

GILL Windsonic 2-D Sonic Anemometer Sensor.

Perform protocol conversion for a Gill Windsonic 2-D Sonic Anemometer.

Parameters:
loglogger

The logger for which to create a child logger.

Attributes Summary

charset

default_direction_str

default_speed_str

delimiter

end_character

good_status

start_character

telemetry_pattern

terminator

unit_identifier

windspeed_unit

Methods Summary

extract_telemetry(line)

Extract the wind telemetry from a line of Sensor data.

Attributes Documentation

charset = 'ASCII'
default_direction_str: str = '999'
default_speed_str: str = '9999.9990'
delimiter = ','
end_character = '\x03'
good_status: str = '00'
start_character: str = '\x02'
telemetry_pattern = re.compile('^\x02Q,(?P<direction>\\d{3})?,(?P<speed>\\d{3}\\.\\d{2}),M,(?P<status>\\d{2}),\x03(?P<checksum>[\\da-fA-F]{2})\r\n$')
terminator = '\r\n'
unit_identifier: str = 'Q'
windspeed_unit: str = 'M'

Methods Documentation

async extract_telemetry(line: str) list[float | int | str]

Extract the wind telemetry from a line of Sensor data.

Parameters:
linestr

A line of comma separated telemetry as described in the doc string of this class.

Returns:
list

A list of 2 floats containing the telemetry as measured by the sensor: the wind speed and direction.