From 1d146d614302dd8d8d9add66d5e11ab80de28a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Kub=C3=A1nek?= Date: Mon, 21 Oct 2024 18:16:52 -0300 Subject: [PATCH] ESS's M1M3 Thermocouple telemetry and events. --- .../data/sal_interfaces/ESS/ESS_Events.xml | 49 ++++++++- .../data/sal_interfaces/ESS/ESS_Telemetry.xml | 12 ++ python/lsst/ts/xml/enums/ESS.py | 22 ++++ python/lsst/ts/xml/tables/m1m3/__init__.py | 1 + .../ts/xml/tables/m1m3/thermocouple_table.py | 104 ++++++++++++++++++ 5 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 python/lsst/ts/xml/tables/m1m3/thermocouple_table.py diff --git a/python/lsst/ts/xml/data/sal_interfaces/ESS/ESS_Events.xml b/python/lsst/ts/xml/data/sal_interfaces/ESS/ESS_Events.xml index f935d04a2..1c142e97d 100644 --- a/python/lsst/ts/xml/data/sal_interfaces/ESS/ESS_Events.xml +++ b/python/lsst/ts/xml/data/sal_interfaces/ESS/ESS_Events.xml @@ -1,7 +1,7 @@ - + ESS ESS_logevent_lightningStrike Lightning strike, if detected. If all values are zero then this indicates that no strike was detected for a configurable amount of time since the last strike. @@ -114,4 +114,51 @@ 1 + + HONEYCOMB_TOP=1, + HONEYCOMB_MIDDLE=2, + HONEYCOMB_BOTTOM=3, + PLENUM=4, + CELL_TOP=5, + CELL_BOTTOM=6 + + + ESS + ESS_logevent_thermocouples + Details about M1M3 thermocouples. Thermal scanner is provided in topic's index, and port number is the item's index. + + name + Comma separated lists of thermocouple name/ID. + str + unitless + + + location + Thermocouple location. One of the HONEYCOMB_XXX,PLENUM or CELL_XXX enumerations. + int + unitless + 94 + + + xPosition + Thermocouple X position in meters. + float + m + 94 + + + yPosition + Thermocouple Y position in meters. + float + m + 94 + + + zPosition + Thermocouple Z position in meters. + float + m + 94 + + diff --git a/python/lsst/ts/xml/data/sal_interfaces/ESS/ESS_Telemetry.xml b/python/lsst/ts/xml/data/sal_interfaces/ESS/ESS_Telemetry.xml index 904870515..3f37b21c9 100644 --- a/python/lsst/ts/xml/data/sal_interfaces/ESS/ESS_Telemetry.xml +++ b/python/lsst/ts/xml/data/sal_interfaces/ESS/ESS_Telemetry.xml @@ -1677,4 +1677,16 @@ 1 + + MTM1M3ThermalScanner + MTM1M3ThermalScanner_thermocouplesTemperatures + Temperatures measured by thermocouples. Details of the thermocouple's locations are in lsst.ts.xml.tables.m1m3 + + temperatures + Measured thermocouple temperatures. Index is thermal scanner port number (0-based). As CSC is indexed, the index gives thermal scanner. + float + deg_C + 94 + + diff --git a/python/lsst/ts/xml/enums/ESS.py b/python/lsst/ts/xml/enums/ESS.py index 8f419572d..7da9b57d9 100644 --- a/python/lsst/ts/xml/enums/ESS.py +++ b/python/lsst/ts/xml/enums/ESS.py @@ -71,3 +71,25 @@ class OnOff(enum.IntEnum): ON = 1 OFF = 2 + + +class M1M3Thermocouple(enum.IntEnum): + """M1M3 Thermocouple location. + + Values: + + * HONEYCOMB_TOP: Top of the mirror's honeycomb. + * HONEYCOMB_MIDDLE: Middle in the mirror's honeycomb. + * HONEYCOMB_BOTTOM: Bottom of the mirror's honeycomb. + * PLENUM: Air plenum (area between the glass mirror and top of the mirror + cell, where conditioned air enters). + * CELL_TOP: Top of the mirror cell. + * CELL_BOTTOMz: Bottom of the mirror cell. + """ + + HONEYCOMB_TOP = 1 + HONEYCOMB_MIDDLE = 2 + HONEYCOMB_BOTTOM = 3 + PLENUM = 4 + CELL_TOP = 5 + CELL_BOTTOM = 6 diff --git a/python/lsst/ts/xml/tables/m1m3/__init__.py b/python/lsst/ts/xml/tables/m1m3/__init__.py index 69670b846..fdcd8a699 100644 --- a/python/lsst/ts/xml/tables/m1m3/__init__.py +++ b/python/lsst/ts/xml/tables/m1m3/__init__.py @@ -34,3 +34,4 @@ force_actuator_from_id, ) from .fcu_table import FCUData, FCUTable, fcu_from_address +from .thermocouple_table import ThermocoupleData, ThermocoupleTable diff --git a/python/lsst/ts/xml/tables/m1m3/thermocouple_table.py b/python/lsst/ts/xml/tables/m1m3/thermocouple_table.py new file mode 100644 index 000000000..eab2fb114 --- /dev/null +++ b/python/lsst/ts/xml/tables/m1m3/thermocouple_table.py @@ -0,0 +1,104 @@ +# This file is part of ts_xml. +# +# Developed for Vera Rubin Observatory. +# This product includes software developed by the LSST Project +# (https://www.lsst.org). +# See the COPYRIGHT file at the top-level directory of this distribution +# for details of code ownership. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation either version 3 of the License or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import enum +from dataclasses import dataclass + +__all__ = [ + "ThermalScanner", + "ThermocoupleLocation", + "ThermocoupleData", + "ThermocoupleTable", +] + +"""This module provides location and names for M1M3 thermocouples. Thermocouple +measurements are read by the M1M3 Thermal Scanner CSC. + +Attributes +---------- +ThermocoupleTable : `[ThermocoupleData]` +""" + + +class ThermalScanner(enum.IntEnum): + """Thermal scanner measurement box location.""" + + Y_PLUS = 1 + X_PLUS = 2 + Y_MINUS = 3 + X_MINUS = 4 + + +class ThermocoupleLocation(enum.IntEnum): + """Location of the mirror thermocouple. HC is for the mirror HoneyComb - + the sensor is located in the glass mirror.""" + + HC_BOTTOM = 1 + HC_MIDDLE = 2 + HC_TOP = 3 + + +@dataclass +class ThermocoupleData: + """Represent thermocouple index, name and location inside the mirror cell. + + Attributes + ---------- + name : `str` + Thermocouple name - e.g. MTC017B1. + location : `ThermocoupleLocation` + Location type + scanner : `ThermalScanner` + Scanner to which is the thermocouple connected. + port : `int` + Thermocouple 1-based port. Gives port where the termocouple is + connected. Shall be integer in range 1-96. + x_position : `float` + X position in mirror cell. + y_position : `float` + Y position in mirror cell. + z_position : `float` + Z position in mirror cell. + """ + + name: str + location: ThermocoupleLocation + scanner: ThermalScanner + port: int + x_position: float + y_position: float + z_position: float + + +ThermocoupleTable = [ + ThermocoupleData( + "MTC038B1", + ThermocoupleLocation.HC_BOTTOM, + ThermalScanner.Y_PLUS, + 1, + 0.1, + 0.1, + -0.1, + ), + ThermocoupleData( + "MTC038F", ThermocoupleLocation.HC_TOP, ThermalScanner.Y_PLUS, 2, 0.1, 0.1, 0.1 + ), +]