From 312ad8857837627e9d3f00e7959551ec1a720bdc Mon Sep 17 00:00:00 2001 From: Brian Brondel Date: Thu, 5 Feb 2026 17:15:47 -0300 Subject: [PATCH] Add astrometric RA and Dec to quicklook tables. --- ...dd_astrometric_ra_and_dec_to_quicklook_.py | 104 ++++++++++++++++++ ...dd_astrometric_ra_and_dec_to_quicklook_.py | 104 ++++++++++++++++++ ...dd_astrometric_ra_and_dec_to_quicklook_.py | 65 +++++++++++ ...dd_astrometric_ra_and_dec_to_quicklook_.py | 65 +++++++++++ 4 files changed, 338 insertions(+) create mode 100644 alembic/latiss/versions/6250c0fab3fe_add_astrometric_ra_and_dec_to_quicklook_.py create mode 100644 alembic/lsstcam/versions/9db9c1e9e8d3_add_astrometric_ra_and_dec_to_quicklook_.py create mode 100644 alembic/lsstcomcam/versions/283fe87848b1_add_astrometric_ra_and_dec_to_quicklook_.py create mode 100644 alembic/lsstcomcamsim/versions/07d289e251ec_add_astrometric_ra_and_dec_to_quicklook_.py diff --git a/alembic/latiss/versions/6250c0fab3fe_add_astrometric_ra_and_dec_to_quicklook_.py b/alembic/latiss/versions/6250c0fab3fe_add_astrometric_ra_and_dec_to_quicklook_.py new file mode 100644 index 00000000..f953d9f5 --- /dev/null +++ b/alembic/latiss/versions/6250c0fab3fe_add_astrometric_ra_and_dec_to_quicklook_.py @@ -0,0 +1,104 @@ +"""Add astrometric RA and Dec to quicklook tables + +Revision ID: 6250c0fab3fe +Revises: e390971cbc59 +Create Date: 2026-02-05 20:10:17.272364+00:00 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import mysql + +# revision identifiers, used by Alembic. +revision: str = "6250c0fab3fe" +down_revision: Union[str, None] = "e390971cbc59" +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.alter_column( + "exposure", + "s_ra", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; right ascension of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_comment="Central Spatial Position in ICRS; Right ascension of targeted focal plane center.", + existing_nullable=True, + schema="cdb_latiss", + ) + op.alter_column( + "exposure", + "s_dec", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; declination of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_comment="Central Spatial Position in ICRS; Declination of targeted focal plane center.", + existing_nullable=True, + schema="cdb_latiss", + ) + op.add_column( + "visit1_quicklook", + sa.Column( + "astrom_ra", + sa.DOUBLE() + .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") + .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), + nullable=True, + comment="Central Spatial Position in ICRS; Right ascension of the CCD center. In contrast with #exposure.s_ra, which is the targeted sky position, this is the position fitted after plate solving the image.", + ), + schema="cdb_latiss", + ) + op.add_column( + "visit1_quicklook", + sa.Column( + "astrom_dec", + sa.DOUBLE() + .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") + .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), + nullable=True, + comment="Central Spatial Position in ICRS; Declination of the CCD center. In contrast with #exposure.s_dec, which is the targeted sky position, this is the position fitted after plate solving the image.", + ), + schema="cdb_latiss", + ) + op.add_column( + "visit1_quicklook", + sa.Column( + "astrom_sky_rotation", + sa.DOUBLE() + .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") + .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), + nullable=True, + comment="Fitted sky rotation angle based on plate solving. This quantity can be compared to #exposure.sky_rotation, the targeted sky rotation angle.", + ), + schema="cdb_latiss", + ) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column("visit1_quicklook", "astrom_sky_rotation", schema="cdb_latiss") + op.drop_column("visit1_quicklook", "astrom_dec", schema="cdb_latiss") + op.drop_column("visit1_quicklook", "astrom_ra", schema="cdb_latiss") + op.alter_column( + "exposure", + "s_dec", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; Declination of targeted focal plane center.", + existing_comment="Central Spatial Position in ICRS; declination of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_nullable=True, + schema="cdb_latiss", + ) + op.alter_column( + "exposure", + "s_ra", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; Right ascension of targeted focal plane center.", + existing_comment="Central Spatial Position in ICRS; right ascension of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_nullable=True, + schema="cdb_latiss", + ) + # ### end Alembic commands ### diff --git a/alembic/lsstcam/versions/9db9c1e9e8d3_add_astrometric_ra_and_dec_to_quicklook_.py b/alembic/lsstcam/versions/9db9c1e9e8d3_add_astrometric_ra_and_dec_to_quicklook_.py new file mode 100644 index 00000000..ed4d90be --- /dev/null +++ b/alembic/lsstcam/versions/9db9c1e9e8d3_add_astrometric_ra_and_dec_to_quicklook_.py @@ -0,0 +1,104 @@ +"""Add astrometric RA and Dec to quicklook tables + +Revision ID: 9db9c1e9e8d3 +Revises: a322490c4e0f +Create Date: 2026-02-05 20:10:29.413963+00:00 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import mysql + +# revision identifiers, used by Alembic. +revision: str = "9db9c1e9e8d3" +down_revision: Union[str, None] = "a322490c4e0f" +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.alter_column( + "exposure", + "s_ra", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; right ascension of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_comment="Central Spatial Position in ICRS; Right ascension of targeted focal plane center.", + existing_nullable=True, + schema="cdb_lsstcam", + ) + op.alter_column( + "exposure", + "s_dec", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; declination of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_comment="Central Spatial Position in ICRS; Declination of targeted focal plane center.", + existing_nullable=True, + schema="cdb_lsstcam", + ) + op.add_column( + "visit1_quicklook", + sa.Column( + "astrom_ra", + sa.DOUBLE() + .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") + .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), + nullable=True, + comment="Central Spatial Position in ICRS; Right ascension of the center position of the central CCD (R22_S11). In contrast with #exposure.s_ra, which is the targeted sky position, this is the position fitted after plate solving the image.", + ), + schema="cdb_lsstcam", + ) + op.add_column( + "visit1_quicklook", + sa.Column( + "astrom_dec", + sa.DOUBLE() + .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") + .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), + nullable=True, + comment="Central Spatial Position in ICRS; Declination of the center position of the central CCD (R22_S11). In contrast with #exposure.s_dec, which is the targeted sky position, this is the position fitted after plate solving the image.", + ), + schema="cdb_lsstcam", + ) + op.add_column( + "visit1_quicklook", + sa.Column( + "astrom_sky_rotation", + sa.DOUBLE() + .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") + .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), + nullable=True, + comment="Fitted sky rotation angle based on plate solving. This quantity can be compared to #exposure.sky_rotation, the targeted sky rotation angle.", + ), + schema="cdb_lsstcam", + ) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column("visit1_quicklook", "astrom_sky_rotation", schema="cdb_lsstcam") + op.drop_column("visit1_quicklook", "astrom_dec", schema="cdb_lsstcam") + op.drop_column("visit1_quicklook", "astrom_ra", schema="cdb_lsstcam") + op.alter_column( + "exposure", + "s_dec", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; Declination of targeted focal plane center.", + existing_comment="Central Spatial Position in ICRS; declination of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_nullable=True, + schema="cdb_lsstcam", + ) + op.alter_column( + "exposure", + "s_ra", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; Right ascension of targeted focal plane center.", + existing_comment="Central Spatial Position in ICRS; right ascension of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_nullable=True, + schema="cdb_lsstcam", + ) + # ### end Alembic commands ### diff --git a/alembic/lsstcomcam/versions/283fe87848b1_add_astrometric_ra_and_dec_to_quicklook_.py b/alembic/lsstcomcam/versions/283fe87848b1_add_astrometric_ra_and_dec_to_quicklook_.py new file mode 100644 index 00000000..0acac7dd --- /dev/null +++ b/alembic/lsstcomcam/versions/283fe87848b1_add_astrometric_ra_and_dec_to_quicklook_.py @@ -0,0 +1,65 @@ +"""Add astrometric RA and Dec to quicklook tables + +Revision ID: 283fe87848b1 +Revises: b3bf526692dd +Create Date: 2026-02-05 20:10:21.349589+00:00 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision: str = "283fe87848b1" +down_revision: Union[str, None] = "b3bf526692dd" +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.alter_column( + "exposure", + "s_ra", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; right ascension of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_comment="Central Spatial Position in ICRS; Right ascension of targeted focal plane center.", + existing_nullable=True, + schema="cdb_lsstcomcam", + ) + op.alter_column( + "exposure", + "s_dec", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; declination of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_comment="Central Spatial Position in ICRS; Declination of targeted focal plane center.", + existing_nullable=True, + schema="cdb_lsstcomcam", + ) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column( + "exposure", + "s_dec", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; Declination of targeted focal plane center.", + existing_comment="Central Spatial Position in ICRS; declination of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_nullable=True, + schema="cdb_lsstcomcam", + ) + op.alter_column( + "exposure", + "s_ra", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; Right ascension of targeted focal plane center.", + existing_comment="Central Spatial Position in ICRS; right ascension of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_nullable=True, + schema="cdb_lsstcomcam", + ) + # ### end Alembic commands ### diff --git a/alembic/lsstcomcamsim/versions/07d289e251ec_add_astrometric_ra_and_dec_to_quicklook_.py b/alembic/lsstcomcamsim/versions/07d289e251ec_add_astrometric_ra_and_dec_to_quicklook_.py new file mode 100644 index 00000000..c7937a38 --- /dev/null +++ b/alembic/lsstcomcamsim/versions/07d289e251ec_add_astrometric_ra_and_dec_to_quicklook_.py @@ -0,0 +1,65 @@ +"""Add astrometric RA and Dec to quicklook tables + +Revision ID: 07d289e251ec +Revises: 42cf2352803d +Create Date: 2026-02-05 20:10:24.844899+00:00 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision: str = "07d289e251ec" +down_revision: Union[str, None] = "42cf2352803d" +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.alter_column( + "exposure", + "s_ra", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; right ascension of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_comment="Central Spatial Position in ICRS; Right ascension of targeted focal plane center.", + existing_nullable=True, + schema="cdb_lsstcomcamsim", + ) + op.alter_column( + "exposure", + "s_dec", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; declination of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_comment="Central Spatial Position in ICRS; Declination of targeted focal plane center.", + existing_nullable=True, + schema="cdb_lsstcomcamsim", + ) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column( + "exposure", + "s_dec", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; Declination of targeted focal plane center.", + existing_comment="Central Spatial Position in ICRS; declination of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_nullable=True, + schema="cdb_lsstcomcamsim", + ) + op.alter_column( + "exposure", + "s_ra", + existing_type=sa.DOUBLE_PRECISION(precision=53), + comment="Central Spatial Position in ICRS; Right ascension of targeted focal plane center.", + existing_comment="Central Spatial Position in ICRS; right ascension of focal plane center derived from encoder readings and correcting for annual abberation, precession-nutation, earth orientation, atmospheric refraction, and mount/flexure model, determined without reference to a plate solution.", + existing_nullable=True, + schema="cdb_lsstcomcamsim", + ) + # ### end Alembic commands ###