TMATelemetryConfigParser

class lsst.ts.mtmount.TMATelemetryConfigParser(tma_config_path: pathlib.Path | str)

Bases: object

Create MTMount_Telemetry.xml from the TMA telemetry config file.

Parameters:
tma_config_pathstr | pathlib.Path

Path to TMA telemetry config file TelemetryTopicsConfiguration.ini

Notes

To use:

processor = TMATelemetryConfigParser(tma_config_path=...)
topics = TMATelemetryConfigParser.process_file()
processor.write_xml(xml_telemetry_path=..., topics=topics)

or call run_tma_telemetry_config_parser to do this from the command line.

** Format of the TMA telemetry configuration file **

This file is used for feeding data to the EUI and for feeding telemetry data (but not events) to the CSC.

Boolean and String items are discrete state and so are not published to the CSC as telemetry, but instead are sent as events (and not configured via this file).

Ignore the word Array in the data type; it is for internal use.

The following fields are specific to sending data to the CSC and we can set them as we like (with one noted exception):

  • TCP_Publish: if "TRUE" send the data to the CSC; if “FALSE” do not. Note: for the few timestamp fields this may have to be left at “TRUE” for internal reasons. This parser ignores “timestamp” fields and adds the standard timestamp field to all telemetry topics.

  • TCP_PublishName: the field name used for telemetry data sent to the CSC, and also for the corresponding SAL telemetry field.

  • Comments: the data used for the Description section of each SAL telemetry fields.

  • Unit: the value used for the Units section of each SAL telemetry field.

Do not touch the url fields; these are for the EUI.

Items may be re-ordered, but you must change the integer indices (at the end of each data type) to match the new order. This seems like a lot of work, so I did not rearrange any items.

Sensor names for meters on the telescope or pier have these parts:

  • First part:

    • TMA or tMA: TMA

    • TEC: top-end chiller

    • TEA: top-end chiller assembly

  • Second part: location

    • FA: facilities

    • FS: a typo for FA

    • PI: pier

    • AZ, EL

    • AX: a typo for AZ

  • Third part: liquid or air:

    • GW: glycol water

    • CP: compressed air

    • DY: Dynalene

    • GP: general purpose glycol

    • HB: hydrostatic bearing

    • OC: oil chiller

    • OS: oil or oil supply

  • Fourth part:

    • AAA: valve state if bool, valve position (%) if double (AAA…PV)

    • CPD: valve open/closed (bool only)

    • CPM: pressure meter (bar)

    • CTM: temperature meter (deg_C)

    • CLM: oil film thickness meter (µm, except FA_OS_CLM, see below):

      • AZ/EL_HB_CLM are measured film thickness

        at hydrostatic bearings.

      • AZ/EL_OS_CLM are computed film thickness

        at hydrostatic bearings.

      • FA_OS_CLM is the amount of oil in the oil tank,

        measured as pressure in mmH2O (mm of water column).

    • CFM: flow meter (l/min)

    • MOT: pump motor on/off (bool only)

Sensor names for cabinet sensors have these parts:

  • The first and second parts are the same as above.

  • Third part:

    • OS: oil system

    • PD: power distribution

    • CS: control system

    • DR: drive; may also be door switch?

    • DZ: typo for DR

  • Fourth part:

    • CBT: cabinet

    • TRM: electrical transformer

Other notes:

  • There are a few explicit timestamp fields, though in most cases timestamp is provided without being listed. These explicit fields are needed by the TMA for internal use (including, at least in some cases, setting TCP_Publish = “TRUE”). So the config file parser ignores timestamp fields and adds the standard “timestamp” field to every topic.

  • Field described as Comments = "Reserved" are for internal use. Do not publish them.

  • In [LockingPins] and some other sections the original comment said “current %” but the TCP name said “torque” or vice-versa. These are all % torque.

  • HX = heat exchanger

Methods Summary

consolidate_fields(fields)

Try to consolidate array-like fields into a new dict.

create_config(tma_config_path)

Create a config parser that reads the specified file.

make_basic_fields(section)

Process one section (topic).

process_file()

write_telemetry_map(topics)

Write the data for RAW_TELEMETRY_MAP in telemetry_map.py

write_xml(topics, xml_telemetry_path)

Write data for MTMount_Telemetry.xml

Methods Documentation

consolidate_fields(fields: dict[str, lsst.ts.mtmount.tma_telemetry_config_parser.FieldInfo]) dict[str, lsst.ts.mtmount.tma_telemetry_config_parser.FieldInfo]

Try to consolidate array-like fields into a new dict.

Fields whose numeric suffixes make a sequence from 1 to N are consolidated into a single array topic. All other fields are copied from fields “as is”, i.e. as scalars.

Parameters:
fieldsFieldsType

Information for all fields.

Returns:
consolidated_fieidsFieldsType

Consolidated field info.

create_config(tma_config_path: pathlib.Path | str) ConfigParser

Create a config parser that reads the specified file.

make_basic_fields(section: SectionProxy) tuple[int, dict[str, lsst.ts.mtmount.tma_telemetry_config_parser.FieldInfo]]

Process one section (topic).

Do not consolidate array-like values.

Parameters:
sectionconfigparser.SectionProxy

One section (telemetry topic) of the TMA config file.

Returns:
topic_id_field_infotuple [int, FieldsType]

A tuple of:

  • topic_id: integer topic ID

  • fields: a dict of field name: FieldInfo

Notes

Add the timestamp field, which is not in the TMA telemetry config (except for internal use in a few cases; ignore that one).

process_file() dict[str, lsst.ts.mtmount.tma_telemetry_config_parser.TelemetryTopicInfo]
write_telemetry_map(topics: dict[str, lsst.ts.mtmount.tma_telemetry_config_parser.TelemetryTopicInfo]) None

Write the data for RAW_TELEMETRY_MAP in telemetry_map.py

Parameters:
topicsTopicsType

Topics data as a dict of topic name: TopicInfo.

write_xml(topics: dict[str, lsst.ts.mtmount.tma_telemetry_config_parser.TelemetryTopicInfo], xml_telemetry_path: pathlib.Path | str) None

Write data for MTMount_Telemetry.xml

Parameters:
topicsTopicsType

Topics data as a dict of topic name: TopicInfo.

xml_telemetry_pathstr | pathlib.Path

Path to output file, which should be named MTMount_Telemetry.xml.