From 25a7d059a599a672e4d8b6f90c8710a120c4b6a0 Mon Sep 17 00:00:00 2001 From: Rodrigo Boufleur Date: Thu, 29 Jan 2026 06:08:11 -0800 Subject: [PATCH 1/2] Add TMA truss temperature columns to lsstcam EFD Add truss_temp_plus_x_plus_y and truss_temp_minus_x_minus_y to exposure_efd and visit1_efd, sourced from lsst.sal.ESS.temperature. Bump schema version to 1.1.0. DM-53861 --- .../16ba20e74d5d_add_temperature_tma_truss.py | 74 +++++++++++++++++++ .../config/config_lsstcam.yaml | 32 +++++++- .../schemas/yml/efd_lsstcam.yaml | 26 ++++++- 3 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 alembic/efd_lsstcam/versions/16ba20e74d5d_add_temperature_tma_truss.py diff --git a/alembic/efd_lsstcam/versions/16ba20e74d5d_add_temperature_tma_truss.py b/alembic/efd_lsstcam/versions/16ba20e74d5d_add_temperature_tma_truss.py new file mode 100644 index 00000000..632f8d44 --- /dev/null +++ b/alembic/efd_lsstcam/versions/16ba20e74d5d_add_temperature_tma_truss.py @@ -0,0 +1,74 @@ +"""Add temperature TMA truss + +Revision ID: 16ba20e74d5d +Revises: f0e8602d7819 +Create Date: 2026-01-28 18:17:29.503282+00:00 + +""" + +from typing import Sequence, Union + +import sqlalchemy as sa +from sqlalchemy.dialects import mysql + +from alembic import op + +# revision identifiers, used by Alembic. +revision: str = "16ba20e74d5d" +down_revision: Union[str, None] = "f0e8602d7819" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.add_column( + "exposure_efd", + sa.Column( + "truss_temp_plus_x_plus_y", + sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), + nullable=True, + comment="Temperature of the TMA truss at the plus X position and plus Y structure position", + ), + schema="efd_lsstcam", + ) + op.add_column( + "exposure_efd", + sa.Column( + "truss_temp_minus_x_minus_y", + sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), + nullable=True, + comment="Temperature of the TMA truss at the minus X minus Y structure position", + ), + schema="efd_lsstcam", + ) + op.add_column( + "visit1_efd", + sa.Column( + "truss_temp_plus_x_plus_y", + sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), + nullable=True, + comment="Temperature of the TMA truss at the plus X position and plus Y structure position", + ), + schema="efd_lsstcam", + ) + op.add_column( + "visit1_efd", + sa.Column( + "truss_temp_minus_x_minus_y", + sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), + nullable=True, + comment="Temperature of the TMA truss at the minus X minus Y structure position", + ), + schema="efd_lsstcam", + ) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column("visit1_efd", "truss_temp_minus_x_minus_y", schema="efd_lsstcam") + op.drop_column("visit1_efd", "truss_temp_plus_x_plus_y", schema="efd_lsstcam") + op.drop_column("exposure_efd", "truss_temp_minus_x_minus_y", schema="efd_lsstcam") + op.drop_column("exposure_efd", "truss_temp_plus_x_plus_y", schema="efd_lsstcam") + # ### end Alembic commands ### diff --git a/python/lsst/consdb/transformed_efd/config/config_lsstcam.yaml b/python/lsst/consdb/transformed_efd/config/config_lsstcam.yaml index c590b901..1d6a6d80 100644 --- a/python/lsst/consdb/transformed_efd/config/config_lsstcam.yaml +++ b/python/lsst/consdb/transformed_efd/config/config_lsstcam.yaml @@ -1,4 +1,4 @@ -version: 1.0.0 +version: 1.1.0 columns: - name: mt_azimuth_encoder_absolute_position_0_rms_jitter tables: ["exposure_efd"] @@ -16852,3 +16852,33 @@ columns: - name: absoluteTemperature93 - name: absoluteTemperature94 - name: absoluteTemperature95 + +- name: truss_temp_plus_x_plus_y + tables: ["exposure_efd","visit1_efd"] + function: mean + datatype: float + ivoa: {"unit":"deg_C", "ucd":"meta.ucd;stat.mean"} + description: Temperature of the TMA truss at the plus X position and plus Y structure position + packed_series: False + subset_field: salIndex + subset_value: [121,122] + topics: + - name: lsst.sal.ESS.temperature + fields: + - name: temperatureItem6 + - name: salIndex + +- name: truss_temp_minus_x_minus_y + tables: ["exposure_efd","visit1_efd"] + function: mean + datatype: float + ivoa: {"unit":"deg_C", "ucd":"meta.ucd;stat.mean"} + description: Temperature of the TMA truss at the minus X minus Y structure position + packed_series: False + subset_field: salIndex + subset_value: [121,122] + topics: + - name: lsst.sal.ESS.temperature + fields: + - name: temperatureItem7 + - name: salIndex diff --git a/python/lsst/consdb/transformed_efd/schemas/yml/efd_lsstcam.yaml b/python/lsst/consdb/transformed_efd/schemas/yml/efd_lsstcam.yaml index ebf0f43e..1f98cd11 100644 --- a/python/lsst/consdb/transformed_efd/schemas/yml/efd_lsstcam.yaml +++ b/python/lsst/consdb/transformed_efd/schemas/yml/efd_lsstcam.yaml @@ -3,7 +3,7 @@ name: efd_lsstcam "@id": "#efd_lsstcam" description: Transformed EFD Consolidated Database for lsstcam. version: - current: 1.0.0 + current: 1.1.0 tables: - name: exposure_efd "@id": "#exposure_efd" @@ -2854,6 +2854,18 @@ tables: datatype: float ivoa:ucd: meta.ucd ivoa:unit: um + - name: truss_temp_plus_x_plus_y + "@id": "#exposure_efd.truss_temp_plus_x_plus_y" + description: Temperature of the TMA truss at the plus X position and plus Y structure position + datatype: float + ivoa:ucd: meta.ucd;stat.mean + ivoa:unit: deg_C + - name: truss_temp_minus_x_minus_y + "@id": "#exposure_efd.truss_temp_minus_x_minus_y" + description: Temperature of the TMA truss at the minus X minus Y structure position + datatype: float + ivoa:ucd: meta.ucd;stat.mean + ivoa:unit: deg_C - name: exposure_efd_unpivoted "@id": "#exposure_efd_unpivoted" @@ -5708,6 +5720,18 @@ tables: datatype: float ivoa:ucd: meta.ucd ivoa:unit: um + - name: truss_temp_plus_x_plus_y + "@id": "#visit1_efd.truss_temp_plus_x_plus_y" + description: Temperature of the TMA truss at the plus X position and plus Y structure position + datatype: float + ivoa:ucd: meta.ucd;stat.mean + ivoa:unit: deg_C + - name: truss_temp_minus_x_minus_y + "@id": "#visit1_efd.truss_temp_minus_x_minus_y" + description: Temperature of the TMA truss at the minus X minus Y structure position + datatype: float + ivoa:ucd: meta.ucd;stat.mean + ivoa:unit: deg_C - name: visit1_efd_unpivoted "@id": "#visit1_efd_unpivoted" From 55419f262238eb92a691459bb16d3ba60967e117 Mon Sep 17 00:00:00 2001 From: Rodrigo Boufleur Date: Mon, 2 Feb 2026 09:39:03 -0800 Subject: [PATCH 2/2] Rename truss temperature columns and correct schema UCDs --- ... => 32db1f589156_add_truss_temperature.py} | 32 +++++++++---------- .../config/config_lsstcam.yaml | 16 +++++----- .../schemas/yml/efd_lsstcam.yaml | 32 +++++++++---------- 3 files changed, 40 insertions(+), 40 deletions(-) rename alembic/efd_lsstcam/versions/{16ba20e74d5d_add_temperature_tma_truss.py => 32db1f589156_add_truss_temperature.py} (60%) diff --git a/alembic/efd_lsstcam/versions/16ba20e74d5d_add_temperature_tma_truss.py b/alembic/efd_lsstcam/versions/32db1f589156_add_truss_temperature.py similarity index 60% rename from alembic/efd_lsstcam/versions/16ba20e74d5d_add_temperature_tma_truss.py rename to alembic/efd_lsstcam/versions/32db1f589156_add_truss_temperature.py index 632f8d44..50dc2bdc 100644 --- a/alembic/efd_lsstcam/versions/16ba20e74d5d_add_temperature_tma_truss.py +++ b/alembic/efd_lsstcam/versions/32db1f589156_add_truss_temperature.py @@ -1,8 +1,8 @@ -"""Add temperature TMA truss +"""Add truss temperature -Revision ID: 16ba20e74d5d +Revision ID: 32db1f589156 Revises: f0e8602d7819 -Create Date: 2026-01-28 18:17:29.503282+00:00 +Create Date: 2026-02-02 17:14:04.823186+00:00 """ @@ -14,7 +14,7 @@ from alembic import op # revision identifiers, used by Alembic. -revision: str = "16ba20e74d5d" +revision: str = "32db1f589156" down_revision: Union[str, None] = "f0e8602d7819" branch_labels: Union[str, Sequence[str], None] = None depends_on: Union[str, Sequence[str], None] = None @@ -25,40 +25,40 @@ def upgrade() -> None: op.add_column( "exposure_efd", sa.Column( - "truss_temp_plus_x_plus_y", + "mt_salindex122_temperature_6", sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), nullable=True, - comment="Temperature of the TMA truss at the plus X position and plus Y structure position", + comment="M2-ESS02, temperature item 6, plus X plus Y Truss Structure", ), schema="efd_lsstcam", ) op.add_column( "exposure_efd", sa.Column( - "truss_temp_minus_x_minus_y", + "mt_salindex122_temperature_7", sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), nullable=True, - comment="Temperature of the TMA truss at the minus X minus Y structure position", + comment="M2-ESS02, temperature item 7, minus X minus Y Truss Structure", ), schema="efd_lsstcam", ) op.add_column( "visit1_efd", sa.Column( - "truss_temp_plus_x_plus_y", + "mt_salindex122_temperature_6", sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), nullable=True, - comment="Temperature of the TMA truss at the plus X position and plus Y structure position", + comment="M2-ESS02, temperature item 6, plus X plus Y Truss Structure", ), schema="efd_lsstcam", ) op.add_column( "visit1_efd", sa.Column( - "truss_temp_minus_x_minus_y", + "mt_salindex122_temperature_7", sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), nullable=True, - comment="Temperature of the TMA truss at the minus X minus Y structure position", + comment="M2-ESS02, temperature item 7, minus X minus Y Truss Structure", ), schema="efd_lsstcam", ) @@ -67,8 +67,8 @@ def upgrade() -> None: def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### - op.drop_column("visit1_efd", "truss_temp_minus_x_minus_y", schema="efd_lsstcam") - op.drop_column("visit1_efd", "truss_temp_plus_x_plus_y", schema="efd_lsstcam") - op.drop_column("exposure_efd", "truss_temp_minus_x_minus_y", schema="efd_lsstcam") - op.drop_column("exposure_efd", "truss_temp_plus_x_plus_y", schema="efd_lsstcam") + op.drop_column("visit1_efd", "mt_salindex122_temperature_7", schema="efd_lsstcam") + op.drop_column("visit1_efd", "mt_salindex122_temperature_6", schema="efd_lsstcam") + op.drop_column("exposure_efd", "mt_salindex122_temperature_7", schema="efd_lsstcam") + op.drop_column("exposure_efd", "mt_salindex122_temperature_6", schema="efd_lsstcam") # ### end Alembic commands ### diff --git a/python/lsst/consdb/transformed_efd/config/config_lsstcam.yaml b/python/lsst/consdb/transformed_efd/config/config_lsstcam.yaml index 1d6a6d80..648727f7 100644 --- a/python/lsst/consdb/transformed_efd/config/config_lsstcam.yaml +++ b/python/lsst/consdb/transformed_efd/config/config_lsstcam.yaml @@ -16853,30 +16853,30 @@ columns: - name: absoluteTemperature94 - name: absoluteTemperature95 -- name: truss_temp_plus_x_plus_y +- name: mt_salindex122_temperature_6 tables: ["exposure_efd","visit1_efd"] function: mean datatype: float - ivoa: {"unit":"deg_C", "ucd":"meta.ucd;stat.mean"} - description: Temperature of the TMA truss at the plus X position and plus Y structure position + ivoa: {"unit":"deg_C", "ucd":"phys.temperature;stat.mean"} + description: M2-ESS02, temperature item 6, plus X plus Y Truss Structure packed_series: False subset_field: salIndex - subset_value: [121,122] + subset_value: 122 topics: - name: lsst.sal.ESS.temperature fields: - name: temperatureItem6 - name: salIndex -- name: truss_temp_minus_x_minus_y +- name: mt_salindex122_temperature_7 tables: ["exposure_efd","visit1_efd"] function: mean datatype: float - ivoa: {"unit":"deg_C", "ucd":"meta.ucd;stat.mean"} - description: Temperature of the TMA truss at the minus X minus Y structure position + ivoa: {"unit":"deg_C", "ucd":"phys.temperature;stat.mean"} + description: M2-ESS02, temperature item 7, minus X minus Y Truss Structure packed_series: False subset_field: salIndex - subset_value: [121,122] + subset_value: 122 topics: - name: lsst.sal.ESS.temperature fields: diff --git a/python/lsst/consdb/transformed_efd/schemas/yml/efd_lsstcam.yaml b/python/lsst/consdb/transformed_efd/schemas/yml/efd_lsstcam.yaml index 1f98cd11..b7510bd4 100644 --- a/python/lsst/consdb/transformed_efd/schemas/yml/efd_lsstcam.yaml +++ b/python/lsst/consdb/transformed_efd/schemas/yml/efd_lsstcam.yaml @@ -2854,17 +2854,17 @@ tables: datatype: float ivoa:ucd: meta.ucd ivoa:unit: um - - name: truss_temp_plus_x_plus_y - "@id": "#exposure_efd.truss_temp_plus_x_plus_y" - description: Temperature of the TMA truss at the plus X position and plus Y structure position + - name: mt_salindex122_temperature_6 + "@id": "#exposure_efd.mt_salindex122_temperature_6" + description: M2-ESS02, temperature item 6, plus X plus Y Truss Structure datatype: float - ivoa:ucd: meta.ucd;stat.mean + ivoa:ucd: phys.temperature;stat.mean ivoa:unit: deg_C - - name: truss_temp_minus_x_minus_y - "@id": "#exposure_efd.truss_temp_minus_x_minus_y" - description: Temperature of the TMA truss at the minus X minus Y structure position + - name: mt_salindex122_temperature_7 + "@id": "#exposure_efd.mt_salindex122_temperature_7" + description: M2-ESS02, temperature item 7, minus X minus Y Truss Structure datatype: float - ivoa:ucd: meta.ucd;stat.mean + ivoa:ucd: phys.temperature;stat.mean ivoa:unit: deg_C - name: exposure_efd_unpivoted @@ -5720,17 +5720,17 @@ tables: datatype: float ivoa:ucd: meta.ucd ivoa:unit: um - - name: truss_temp_plus_x_plus_y - "@id": "#visit1_efd.truss_temp_plus_x_plus_y" - description: Temperature of the TMA truss at the plus X position and plus Y structure position + - name: mt_salindex122_temperature_6 + "@id": "#visit1_efd.mt_salindex122_temperature_6" + description: M2-ESS02, temperature item 6, plus X plus Y Truss Structure datatype: float - ivoa:ucd: meta.ucd;stat.mean + ivoa:ucd: phys.temperature;stat.mean ivoa:unit: deg_C - - name: truss_temp_minus_x_minus_y - "@id": "#visit1_efd.truss_temp_minus_x_minus_y" - description: Temperature of the TMA truss at the minus X minus Y structure position + - name: mt_salindex122_temperature_7 + "@id": "#visit1_efd.mt_salindex122_temperature_7" + description: M2-ESS02, temperature item 7, minus X minus Y Truss Structure datatype: float - ivoa:ucd: meta.ucd;stat.mean + ivoa:ucd: phys.temperature;stat.mean ivoa:unit: deg_C - name: visit1_efd_unpivoted