From 190d5e22175406f9b748f73f7f8a5b1fabd7f625 Mon Sep 17 00:00:00 2001 From: Valerie Becker Date: Tue, 12 Nov 2024 13:29:42 -0700 Subject: [PATCH] Removed ccdvisit1 and visit1 tables --- ...4_add_exposure_quicklook_to_latiss_and_.py | 384 +----------------- ...b_add_exposure_quicklook_to_latiss_and_.py | 372 +---------------- ...c_add_exposure_quicklook_to_latiss_and_.py | 372 +---------------- 3 files changed, 3 insertions(+), 1125 deletions(-) diff --git a/alembic/latiss/versions/bf7ba4e029d4_add_exposure_quicklook_to_latiss_and_.py b/alembic/latiss/versions/bf7ba4e029d4_add_exposure_quicklook_to_latiss_and_.py index d2b4b19a..949eccf1 100644 --- a/alembic/latiss/versions/bf7ba4e029d4_add_exposure_quicklook_to_latiss_and_.py +++ b/alembic/latiss/versions/bf7ba4e029d4_add_exposure_quicklook_to_latiss_and_.py @@ -9,7 +9,7 @@ from typing import Sequence, Union import sqlalchemy as sa -from sqlalchemy.dialects import mysql, postgresql +from sqlalchemy.dialects import mysql from alembic import op @@ -22,386 +22,6 @@ def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### - op.create_table( - "ccdvisit1", - sa.Column( - "ccdvisit_id", - sa.BIGINT().with_variant(mysql.BIGINT(), "mysql").with_variant(sa.BIGINT(), "postgresql"), - nullable=False, - comment="Unique identifier.", - ), - sa.Column( - "visit_id", - sa.BIGINT().with_variant(mysql.BIGINT(), "mysql").with_variant(sa.BIGINT(), "postgresql"), - nullable=False, - comment="Identifier of the visit.", - ), - sa.Column( - "detector", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, - comment="Number of the detector in the focal plane.", - ), - sa.Column( - "s_region", - sa.VARCHAR(length=1024) - .with_variant(mysql.VARCHAR(length=1024), "mysql") - .with_variant(sa.VARCHAR(length=1024), "postgresql"), - nullable=True, - comment="Sky region in STC-S format (https://www.ivoa.net/documents/STC-S/20130917/index.html).", - ), - sa.PrimaryKeyConstraint("ccdvisit_id"), - schema="cdb_latiss", - mysql_engine="MyISAM", - ) - op.create_table( - "visit1", - sa.Column( - "visit_id", - sa.BIGINT().with_variant(mysql.BIGINT(), "mysql").with_variant(sa.BIGINT(), "postgresql"), - nullable=False, - comment="Unique identifier.", - ), - sa.Column( - "exposure_name", - sa.VARCHAR(length=20) - .with_variant(mysql.VARCHAR(length=20), "mysql") - .with_variant(sa.VARCHAR(length=20), "postgresql"), - nullable=False, - comment="Official name of the exposure mapped to this visit by the 1-to-1 visit system.", - ), - sa.Column( - "controller", - sa.VARCHAR(length=1) - .with_variant(mysql.VARCHAR(length=1), "mysql") - .with_variant(sa.VARCHAR(length=1), "postgresql"), - nullable=False, - comment="The abbreviation of the controller used for the observation (O, C).", - ), - sa.Column( - "day_obs", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, - comment="Day of observation.", - ), - sa.Column( - "seq_num", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, - comment="Sequence number.", - ), - sa.Column( - "physical_filter", - sa.VARCHAR(length=32) - .with_variant(mysql.VARCHAR(length=32), "mysql") - .with_variant(sa.VARCHAR(length=32), "postgresql"), - nullable=True, - comment="ID of physical filter, the filter associated with a particular instrument.", - ), - sa.Column( - "band", - sa.VARCHAR(length=32) - .with_variant(mysql.VARCHAR(length=32), "mysql") - .with_variant(sa.VARCHAR(length=32), "postgresql"), - nullable=True, - comment="Name of the band used to take the visit. Abstract filter that is not associated with a particular instrument.", - ), - sa.Column( - "s_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 targeted focal plane center.", - ), - sa.Column( - "s_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 targeted focal plane center.", - ), - sa.Column( - "sky_rotation", - sa.DOUBLE() - .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") - .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), - nullable=True, - comment="Targeted sky rotation angle.", - ), - sa.Column( - "azimuth_start", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Azimuth of focal plane center at the start of the visit.", - ), - sa.Column( - "azimuth_end", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Azimuth of focal plane center at the end of the visit.", - ), - sa.Column( - "azimuth", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Azimuth of focal plane center at the middle of the visit.", - ), - sa.Column( - "altitude_start", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Altitude of focal plane center at the start of the visit.", - ), - sa.Column( - "altitude_end", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Altitude of focal plane center at the end of the visit.", - ), - sa.Column( - "altitude", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Altitude of focal plane center at the middle of the visit.", - ), - sa.Column( - "zenith_distance_start", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Zenith distance at the start of the visit.", - ), - sa.Column( - "zenith_distance_end", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Zenith distance at the end of the visit.", - ), - sa.Column( - "zenith_distance", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Zenith distance at the middle of the visit.", - ), - sa.Column( - "airmass", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Airmass of the observed line of sight at the middle of the visit.", - ), - sa.Column( - "exp_midpt", - sa.TIMESTAMP() - .with_variant(mysql.DATETIME(fsp=6), "mysql") - .with_variant(postgresql.TIMESTAMP(precision=6), "postgresql"), - nullable=True, - comment="Midpoint time for visit at the fiducial center of the focal plane. array. TAI, accurate to 10ms.", - ), - sa.Column( - "exp_midpt_mjd", - sa.DOUBLE() - .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") - .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), - nullable=True, - comment="Midpoint time for visit at the fiducial center of the focal plane. array in MJD. TAI, accurate to 10ms.", - ), - sa.Column( - "obs_start", - sa.TIMESTAMP() - .with_variant(mysql.DATETIME(fsp=6), "mysql") - .with_variant(postgresql.TIMESTAMP(precision=6), "postgresql"), - nullable=True, - comment="Start time of the visit at the fiducial center of the focal plane. array, TAI, accurate to 10ms.", - ), - sa.Column( - "obs_start_mjd", - sa.DOUBLE() - .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") - .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), - nullable=True, - comment="Start of the visit in MJD, TAI, accurate to 10ms.", - ), - sa.Column( - "obs_end", - sa.TIMESTAMP() - .with_variant(mysql.DATETIME(fsp=6), "mysql") - .with_variant(postgresql.TIMESTAMP(precision=6), "postgresql"), - nullable=True, - comment="End time of the visit at the fiducial center of the focal plane. array, TAI, accurate to 10ms.", - ), - sa.Column( - "obs_end_mjd", - sa.DOUBLE() - .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") - .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), - nullable=True, - comment="End of the visit in MJD, TAI, accurate to 10ms.", - ), - sa.Column( - "exp_time", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Spatially-averaged duration of visit, accurate to 10ms.", - ), - sa.Column( - "shut_time", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Spatially-averaged shutter-open duration, accurate to 10ms.", - ), - sa.Column( - "dark_time", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Duration from last clear to readout, accurate to 10ms.", - ), - sa.Column( - "group_id", - sa.VARCHAR(length=64) - .with_variant(mysql.VARCHAR(length=64), "mysql") - .with_variant(sa.VARCHAR(length=64), "postgresql"), - nullable=True, - comment="Identifier for the group that this visit is part of.", - ), - sa.Column( - "cur_index", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=True, - comment="Number (1-based) of the observation within its group.", - ), - sa.Column( - "max_index", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=True, - comment="Expected number of observations within the group.", - ), - sa.Column( - "img_type", - sa.VARCHAR(length=64) - .with_variant(mysql.VARCHAR(length=64), "mysql") - .with_variant(sa.VARCHAR(length=64), "postgresql"), - nullable=True, - comment="Type of visit taken.", - ), - sa.Column( - "emulated", - sa.BOOLEAN().with_variant(sa.BOOLEAN(), "mysql").with_variant(sa.BOOLEAN(), "postgresql"), - nullable=True, - comment="True if the visit was taken in emulation mode.", - ), - sa.Column( - "science_program", - sa.VARCHAR(length=64) - .with_variant(mysql.VARCHAR(length=64), "mysql") - .with_variant(sa.VARCHAR(length=64), "postgresql"), - nullable=True, - comment="Science program.", - ), - sa.Column( - "observation_reason", - sa.VARCHAR(length=68) - .with_variant(mysql.VARCHAR(length=68), "mysql") - .with_variant(sa.VARCHAR(length=68), "postgresql"), - nullable=True, - comment="Reason for the observation.", - ), - sa.Column( - "target_name", - sa.VARCHAR(length=64) - .with_variant(mysql.VARCHAR(length=64), "mysql") - .with_variant(sa.VARCHAR(length=64), "postgresql"), - nullable=True, - comment="Target of the observation.", - ), - sa.Column( - "air_temp", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Outside air temperature in degC.", - ), - sa.Column( - "pressure", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Outside air pressure.", - ), - sa.Column( - "humidity", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Outside relative humidity.", - ), - sa.Column( - "wind_speed", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Outside wind speed.", - ), - sa.Column( - "wind_dir", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Wind direction.", - ), - sa.Column( - "dimm_seeing", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Seeing as measured by external DIMM (FWHM).", - ), - sa.Column( - "shut_lower", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Dome dropout door opening percentage.", - ), - sa.Column( - "shut_upper", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Dome main door opening percentage.", - ), - sa.Column( - "focus_z", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Focus Z position.", - ), - sa.Column( - "simulated", - sa.BOOLEAN().with_variant(sa.BOOLEAN(), "mysql").with_variant(sa.BOOLEAN(), "postgresql"), - nullable=True, - comment="Were any control system components simulated?", - ), - sa.Column( - "vignette", - sa.VARCHAR(length=10) - .with_variant(mysql.VARCHAR(length=10), "mysql") - .with_variant(sa.VARCHAR(length=10), "postgresql"), - nullable=True, - comment="Instrument blocked from the sky: UNKNOWN, NO, PARTIALLY, FULLY.", - ), - sa.Column( - "vignette_min", - sa.VARCHAR(length=10) - .with_variant(mysql.VARCHAR(length=10), "mysql") - .with_variant(sa.VARCHAR(length=10), "postgresql"), - nullable=True, - comment="Lowest amount of instrument vignetting detected during the visit: UNKNOWN, NO, PARTIALLY, FULLY.", - ), - sa.Column( - "s_region", - sa.VARCHAR(length=1024) - .with_variant(mysql.VARCHAR(length=1024), "mysql") - .with_variant(sa.VARCHAR(length=1024), "postgresql"), - nullable=True, - comment="Sky region in STC-S format (https://www.ivoa.net/documents/STC-S/20130917/index.html).", - ), - sa.PrimaryKeyConstraint("day_obs", "seq_num"), - schema="cdb_latiss", - mysql_engine="MyISAM", - ) op.create_table( "exposure_quicklook", sa.Column( @@ -612,6 +232,4 @@ def downgrade() -> None: op.drop_column("ccdvisit1_quicklook", "psf_ap_flux_delta", schema="cdb_latiss") op.drop_column("ccdvisit1_quicklook", "pixel_scale", schema="cdb_latiss") op.drop_table("exposure_quicklook", schema="cdb_latiss") - op.drop_table("visit1", schema="cdb_latiss") - op.drop_table("ccdvisit1", schema="cdb_latiss") # ### end Alembic commands ### diff --git a/alembic/lsstcomcam/versions/6534582f91db_add_exposure_quicklook_to_latiss_and_.py b/alembic/lsstcomcam/versions/6534582f91db_add_exposure_quicklook_to_latiss_and_.py index aeaa0b87..e90ebfb4 100644 --- a/alembic/lsstcomcam/versions/6534582f91db_add_exposure_quicklook_to_latiss_and_.py +++ b/alembic/lsstcomcam/versions/6534582f91db_add_exposure_quicklook_to_latiss_and_.py @@ -9,7 +9,7 @@ from typing import Sequence, Union import sqlalchemy as sa -from sqlalchemy.dialects import mysql, postgresql +from sqlalchemy.dialects import mysql from alembic import op @@ -22,374 +22,6 @@ def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### - op.create_table( - "ccdvisit1", - sa.Column( - "ccdvisit_id", - sa.BIGINT().with_variant(mysql.BIGINT(), "mysql").with_variant(sa.BIGINT(), "postgresql"), - nullable=False, - comment="Unique identifier.", - ), - sa.Column( - "visit_id", - sa.BIGINT().with_variant(mysql.BIGINT(), "mysql").with_variant(sa.BIGINT(), "postgresql"), - nullable=False, - comment="Identifier of the visit.", - ), - sa.Column( - "detector", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, - comment="Number of the detector in the focal plane.", - ), - sa.Column( - "s_region", - sa.VARCHAR(length=1024) - .with_variant(mysql.VARCHAR(length=1024), "mysql") - .with_variant(sa.VARCHAR(length=1024), "postgresql"), - nullable=True, - comment="Sky region in STC-S format (https://www.ivoa.net/documents/STC-S/20130917/index.html).", - ), - sa.PrimaryKeyConstraint("ccdvisit_id"), - schema="cdb_lsstcomcam", - mysql_engine="MyISAM", - ) - op.create_table( - "visit1", - sa.Column( - "visit_id", - sa.BIGINT().with_variant(mysql.BIGINT(), "mysql").with_variant(sa.BIGINT(), "postgresql"), - nullable=False, - comment="Unique identifier.", - ), - sa.Column( - "exposure_name", - sa.VARCHAR(length=20) - .with_variant(mysql.VARCHAR(length=20), "mysql") - .with_variant(sa.VARCHAR(length=20), "postgresql"), - nullable=False, - comment="Official name of the exposure mapped to this visit by the 1-to-1 visit system.", - ), - sa.Column( - "controller", - sa.VARCHAR(length=1) - .with_variant(mysql.VARCHAR(length=1), "mysql") - .with_variant(sa.VARCHAR(length=1), "postgresql"), - nullable=False, - comment="The abbreviation of the controller used for the observation (O, C).", - ), - sa.Column( - "day_obs", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, - comment="Day of observation.", - ), - sa.Column( - "seq_num", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, - comment="Sequence number.", - ), - sa.Column( - "physical_filter", - sa.VARCHAR(length=32) - .with_variant(mysql.VARCHAR(length=32), "mysql") - .with_variant(sa.VARCHAR(length=32), "postgresql"), - nullable=True, - comment="ID of physical filter, the filter associated with a particular instrument.", - ), - sa.Column( - "band", - sa.VARCHAR(length=32) - .with_variant(mysql.VARCHAR(length=32), "mysql") - .with_variant(sa.VARCHAR(length=32), "postgresql"), - nullable=True, - comment="Name of the band used to take the visit. Abstract filter that is not associated with a particular instrument.", - ), - sa.Column( - "s_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 targeted focal plane center.", - ), - sa.Column( - "s_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 targeted focal plane center.", - ), - sa.Column( - "sky_rotation", - sa.DOUBLE() - .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") - .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), - nullable=True, - comment="Targeted sky rotation angle.", - ), - sa.Column( - "azimuth_start", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Azimuth of focal plane center at the start of the visit.", - ), - sa.Column( - "azimuth_end", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Azimuth of focal plane center at the end of the visit.", - ), - sa.Column( - "azimuth", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Azimuth of focal plane center at the middle of the visit.", - ), - sa.Column( - "altitude_start", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Altitude of focal plane center at the start of the visit.", - ), - sa.Column( - "altitude_end", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Altitude of focal plane center at the end of the visit.", - ), - sa.Column( - "altitude", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Altitude of focal plane center at the middle of the visit.", - ), - sa.Column( - "zenith_distance_start", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Zenith distance at the start of the visit.", - ), - sa.Column( - "zenith_distance_end", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Zenith distance at the end of the visit.", - ), - sa.Column( - "zenith_distance", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Zenith distance at the middle of the visit.", - ), - sa.Column( - "airmass", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Airmass of the observed line of sight at the middle of the visit.", - ), - sa.Column( - "exp_midpt", - sa.TIMESTAMP() - .with_variant(mysql.DATETIME(fsp=6), "mysql") - .with_variant(postgresql.TIMESTAMP(precision=6), "postgresql"), - nullable=True, - comment="Midpoint time for visit at the fiducial center of the focal plane. array. TAI, accurate to 10ms.", - ), - sa.Column( - "exp_midpt_mjd", - sa.DOUBLE() - .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") - .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), - nullable=True, - comment="Midpoint time for visit at the fiducial center of the focal plane. array in MJD. TAI, accurate to 10ms.", - ), - sa.Column( - "obs_start", - sa.TIMESTAMP() - .with_variant(mysql.DATETIME(fsp=6), "mysql") - .with_variant(postgresql.TIMESTAMP(precision=6), "postgresql"), - nullable=True, - comment="Start time of the visit at the fiducial center of the focal plane. array, TAI, accurate to 10ms.", - ), - sa.Column( - "obs_start_mjd", - sa.DOUBLE() - .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") - .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), - nullable=True, - comment="Start of the visit in MJD, TAI, accurate to 10ms.", - ), - sa.Column( - "obs_end", - sa.TIMESTAMP() - .with_variant(mysql.DATETIME(fsp=6), "mysql") - .with_variant(postgresql.TIMESTAMP(precision=6), "postgresql"), - nullable=True, - comment="End time of the visit at the fiducial center of the focal plane. array, TAI, accurate to 10ms.", - ), - sa.Column( - "obs_end_mjd", - sa.DOUBLE() - .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") - .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), - nullable=True, - comment="End of the visit in MJD, TAI, accurate to 10ms.", - ), - sa.Column( - "exp_time", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Spatially-averaged duration of visit, accurate to 10ms.", - ), - sa.Column( - "shut_time", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Spatially-averaged shutter-open duration, accurate to 10ms.", - ), - sa.Column( - "dark_time", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Duration from last clear to readout, accurate to 10ms.", - ), - sa.Column( - "group_id", - sa.VARCHAR(length=64) - .with_variant(mysql.VARCHAR(length=64), "mysql") - .with_variant(sa.VARCHAR(length=64), "postgresql"), - nullable=True, - comment="Identifier for the group that this visit is part of.", - ), - sa.Column( - "cur_index", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=True, - comment="Number (1-based) of the observation within its group.", - ), - sa.Column( - "max_index", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=True, - comment="Expected number of observations within the group.", - ), - sa.Column( - "img_type", - sa.VARCHAR(length=64) - .with_variant(mysql.VARCHAR(length=64), "mysql") - .with_variant(sa.VARCHAR(length=64), "postgresql"), - nullable=True, - comment="Type of visit taken.", - ), - sa.Column( - "emulated", - sa.BOOLEAN().with_variant(sa.BOOLEAN(), "mysql").with_variant(sa.BOOLEAN(), "postgresql"), - nullable=True, - comment="True if the visit was taken in emulation mode.", - ), - sa.Column( - "science_program", - sa.VARCHAR(length=64) - .with_variant(mysql.VARCHAR(length=64), "mysql") - .with_variant(sa.VARCHAR(length=64), "postgresql"), - nullable=True, - comment="Science program.", - ), - sa.Column( - "observation_reason", - sa.VARCHAR(length=68) - .with_variant(mysql.VARCHAR(length=68), "mysql") - .with_variant(sa.VARCHAR(length=68), "postgresql"), - nullable=True, - comment="Reason for the observation.", - ), - sa.Column( - "target_name", - sa.VARCHAR(length=64) - .with_variant(mysql.VARCHAR(length=64), "mysql") - .with_variant(sa.VARCHAR(length=64), "postgresql"), - nullable=True, - comment="Target of the observation.", - ), - sa.Column( - "air_temp", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Outside air temperature in degC.", - ), - sa.Column( - "pressure", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Outside air pressure.", - ), - sa.Column( - "humidity", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Outside relative humidity.", - ), - sa.Column( - "wind_speed", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Outside wind speed.", - ), - sa.Column( - "wind_dir", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Wind direction.", - ), - sa.Column( - "dimm_seeing", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Seeing as measured by external DIMM (FWHM).", - ), - sa.Column( - "focus_z", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Focus Z position.", - ), - sa.Column( - "simulated", - sa.BOOLEAN().with_variant(sa.BOOLEAN(), "mysql").with_variant(sa.BOOLEAN(), "postgresql"), - nullable=True, - comment="Were any control system components simulated?", - ), - sa.Column( - "vignette", - sa.VARCHAR(length=10) - .with_variant(mysql.VARCHAR(length=10), "mysql") - .with_variant(sa.VARCHAR(length=10), "postgresql"), - nullable=True, - comment="Instrument blocked from the sky: UNKNOWN, NO, PARTIALLY, FULLY.", - ), - sa.Column( - "vignette_min", - sa.VARCHAR(length=10) - .with_variant(mysql.VARCHAR(length=10), "mysql") - .with_variant(sa.VARCHAR(length=10), "postgresql"), - nullable=True, - comment="Lowest amount of instrument vignetting detected during the visit: UNKNOWN, NO, PARTIALLY, FULLY.", - ), - sa.Column( - "s_region", - sa.VARCHAR(length=1024) - .with_variant(mysql.VARCHAR(length=1024), "mysql") - .with_variant(sa.VARCHAR(length=1024), "postgresql"), - nullable=True, - comment="Sky region in STC-S format (https://www.ivoa.net/documents/STC-S/20130917/index.html).", - ), - sa.PrimaryKeyConstraint("day_obs", "seq_num"), - schema="cdb_lsstcomcam", - mysql_engine="MyISAM", - ) op.create_table( "exposure_quicklook", sa.Column( @@ -771,6 +403,4 @@ def downgrade() -> None: op.drop_column("ccdvisit1_quicklook", "pixel_scale", schema="cdb_lsstcomcam") op.drop_table("ccdexposure_quicklook", schema="cdb_lsstcomcam") op.drop_table("exposure_quicklook", schema="cdb_lsstcomcam") - op.drop_table("visit1", schema="cdb_lsstcomcam") - op.drop_table("ccdvisit1", schema="cdb_lsstcomcam") # ### end Alembic commands ### diff --git a/alembic/lsstcomcamsim/versions/7d07063255ac_add_exposure_quicklook_to_latiss_and_.py b/alembic/lsstcomcamsim/versions/7d07063255ac_add_exposure_quicklook_to_latiss_and_.py index 32e4f242..f60447c4 100644 --- a/alembic/lsstcomcamsim/versions/7d07063255ac_add_exposure_quicklook_to_latiss_and_.py +++ b/alembic/lsstcomcamsim/versions/7d07063255ac_add_exposure_quicklook_to_latiss_and_.py @@ -9,7 +9,7 @@ from typing import Sequence, Union import sqlalchemy as sa -from sqlalchemy.dialects import mysql, postgresql +from sqlalchemy.dialects import mysql from alembic import op @@ -22,374 +22,6 @@ def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### - op.create_table( - "ccdvisit1", - sa.Column( - "ccdvisit_id", - sa.BIGINT().with_variant(mysql.BIGINT(), "mysql").with_variant(sa.BIGINT(), "postgresql"), - nullable=False, - comment="Unique identifier.", - ), - sa.Column( - "visit_id", - sa.BIGINT().with_variant(mysql.BIGINT(), "mysql").with_variant(sa.BIGINT(), "postgresql"), - nullable=False, - comment="Identifier of the visit.", - ), - sa.Column( - "detector", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, - comment="Number of the detector in the focal plane.", - ), - sa.Column( - "s_region", - sa.VARCHAR(length=1024) - .with_variant(mysql.VARCHAR(length=1024), "mysql") - .with_variant(sa.VARCHAR(length=1024), "postgresql"), - nullable=True, - comment="Sky region in STC-S format (https://www.ivoa.net/documents/STC-S/20130917/index.html).", - ), - sa.PrimaryKeyConstraint("ccdvisit_id"), - schema="cdb_lsstcomcamsim", - mysql_engine="MyISAM", - ) - op.create_table( - "visit1", - sa.Column( - "visit_id", - sa.BIGINT().with_variant(mysql.BIGINT(), "mysql").with_variant(sa.BIGINT(), "postgresql"), - nullable=False, - comment="Unique identifier.", - ), - sa.Column( - "exposure_name", - sa.VARCHAR(length=20) - .with_variant(mysql.VARCHAR(length=20), "mysql") - .with_variant(sa.VARCHAR(length=20), "postgresql"), - nullable=False, - comment="Official name of the exposure mapped to this visit by the 1-to-1 visit system.", - ), - sa.Column( - "controller", - sa.VARCHAR(length=1) - .with_variant(mysql.VARCHAR(length=1), "mysql") - .with_variant(sa.VARCHAR(length=1), "postgresql"), - nullable=False, - comment="The abbreviation of the controller used for the observation (O, C).", - ), - sa.Column( - "day_obs", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, - comment="Day of observation.", - ), - sa.Column( - "seq_num", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=False, - comment="Sequence number.", - ), - sa.Column( - "physical_filter", - sa.VARCHAR(length=32) - .with_variant(mysql.VARCHAR(length=32), "mysql") - .with_variant(sa.VARCHAR(length=32), "postgresql"), - nullable=True, - comment="ID of physical filter, the filter associated with a particular instrument.", - ), - sa.Column( - "band", - sa.VARCHAR(length=32) - .with_variant(mysql.VARCHAR(length=32), "mysql") - .with_variant(sa.VARCHAR(length=32), "postgresql"), - nullable=True, - comment="Name of the band used to take the visit. Abstract filter that is not associated with a particular instrument.", - ), - sa.Column( - "s_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 targeted focal plane center.", - ), - sa.Column( - "s_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 targeted focal plane center.", - ), - sa.Column( - "sky_rotation", - sa.DOUBLE() - .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") - .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), - nullable=True, - comment="Targeted sky rotation angle.", - ), - sa.Column( - "azimuth_start", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Azimuth of focal plane center at the start of the visit.", - ), - sa.Column( - "azimuth_end", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Azimuth of focal plane center at the end of the visit.", - ), - sa.Column( - "azimuth", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Azimuth of focal plane center at the middle of the visit.", - ), - sa.Column( - "altitude_start", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Altitude of focal plane center at the start of the visit.", - ), - sa.Column( - "altitude_end", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Altitude of focal plane center at the end of the visit.", - ), - sa.Column( - "altitude", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Altitude of focal plane center at the middle of the visit.", - ), - sa.Column( - "zenith_distance_start", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Zenith distance at the start of the visit.", - ), - sa.Column( - "zenith_distance_end", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Zenith distance at the end of the visit.", - ), - sa.Column( - "zenith_distance", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Zenith distance at the middle of the visit.", - ), - sa.Column( - "airmass", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Airmass of the observed line of sight at the middle of the visit.", - ), - sa.Column( - "exp_midpt", - sa.TIMESTAMP() - .with_variant(mysql.DATETIME(fsp=6), "mysql") - .with_variant(postgresql.TIMESTAMP(precision=6), "postgresql"), - nullable=True, - comment="Midpoint time for visit at the fiducial center of the focal plane. array. TAI, accurate to 10ms.", - ), - sa.Column( - "exp_midpt_mjd", - sa.DOUBLE() - .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") - .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), - nullable=True, - comment="Midpoint time for visit at the fiducial center of the focal plane. array in MJD. TAI, accurate to 10ms.", - ), - sa.Column( - "obs_start", - sa.TIMESTAMP() - .with_variant(mysql.DATETIME(fsp=6), "mysql") - .with_variant(postgresql.TIMESTAMP(precision=6), "postgresql"), - nullable=True, - comment="Start time of the visit at the fiducial center of the focal plane. array, TAI, accurate to 10ms.", - ), - sa.Column( - "obs_start_mjd", - sa.DOUBLE() - .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") - .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), - nullable=True, - comment="Start of the visit in MJD, TAI, accurate to 10ms.", - ), - sa.Column( - "obs_end", - sa.TIMESTAMP() - .with_variant(mysql.DATETIME(fsp=6), "mysql") - .with_variant(postgresql.TIMESTAMP(precision=6), "postgresql"), - nullable=True, - comment="End time of the visit at the fiducial center of the focal plane. array, TAI, accurate to 10ms.", - ), - sa.Column( - "obs_end_mjd", - sa.DOUBLE() - .with_variant(mysql.DOUBLE(asdecimal=True), "mysql") - .with_variant(sa.DOUBLE_PRECISION(), "postgresql"), - nullable=True, - comment="End of the visit in MJD, TAI, accurate to 10ms.", - ), - sa.Column( - "exp_time", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Spatially-averaged duration of visit, accurate to 10ms.", - ), - sa.Column( - "shut_time", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Spatially-averaged shutter-open duration, accurate to 10ms.", - ), - sa.Column( - "dark_time", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Duration from last clear to readout, accurate to 10ms.", - ), - sa.Column( - "group_id", - sa.VARCHAR(length=64) - .with_variant(mysql.VARCHAR(length=64), "mysql") - .with_variant(sa.VARCHAR(length=64), "postgresql"), - nullable=True, - comment="Identifier for the group that this visit is part of.", - ), - sa.Column( - "cur_index", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=True, - comment="Number (1-based) of the observation within its group.", - ), - sa.Column( - "max_index", - sa.INTEGER().with_variant(mysql.INTEGER(), "mysql").with_variant(sa.INTEGER(), "postgresql"), - nullable=True, - comment="Expected number of observations within the group.", - ), - sa.Column( - "img_type", - sa.VARCHAR(length=64) - .with_variant(mysql.VARCHAR(length=64), "mysql") - .with_variant(sa.VARCHAR(length=64), "postgresql"), - nullable=True, - comment="Type of visit taken.", - ), - sa.Column( - "emulated", - sa.BOOLEAN().with_variant(sa.BOOLEAN(), "mysql").with_variant(sa.BOOLEAN(), "postgresql"), - nullable=True, - comment="True if the visit was taken in emulation mode.", - ), - sa.Column( - "science_program", - sa.VARCHAR(length=64) - .with_variant(mysql.VARCHAR(length=64), "mysql") - .with_variant(sa.VARCHAR(length=64), "postgresql"), - nullable=True, - comment="Science program.", - ), - sa.Column( - "observation_reason", - sa.VARCHAR(length=68) - .with_variant(mysql.VARCHAR(length=68), "mysql") - .with_variant(sa.VARCHAR(length=68), "postgresql"), - nullable=True, - comment="Reason for the observation.", - ), - sa.Column( - "target_name", - sa.VARCHAR(length=64) - .with_variant(mysql.VARCHAR(length=64), "mysql") - .with_variant(sa.VARCHAR(length=64), "postgresql"), - nullable=True, - comment="Target of the observation.", - ), - sa.Column( - "air_temp", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Outside air temperature in degC.", - ), - sa.Column( - "pressure", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Outside air pressure.", - ), - sa.Column( - "humidity", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Outside relative humidity.", - ), - sa.Column( - "wind_speed", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Outside wind speed.", - ), - sa.Column( - "wind_dir", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Wind direction.", - ), - sa.Column( - "dimm_seeing", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Seeing as measured by external DIMM (FWHM).", - ), - sa.Column( - "focus_z", - sa.FLOAT().with_variant(mysql.FLOAT(), "mysql").with_variant(sa.FLOAT(), "postgresql"), - nullable=True, - comment="Focus Z position.", - ), - sa.Column( - "simulated", - sa.BOOLEAN().with_variant(sa.BOOLEAN(), "mysql").with_variant(sa.BOOLEAN(), "postgresql"), - nullable=True, - comment="Were any control system components simulated?", - ), - sa.Column( - "vignette", - sa.VARCHAR(length=10) - .with_variant(mysql.VARCHAR(length=10), "mysql") - .with_variant(sa.VARCHAR(length=10), "postgresql"), - nullable=True, - comment="Instrument blocked from the sky: UNKNOWN, NO, PARTIALLY, FULLY.", - ), - sa.Column( - "vignette_min", - sa.VARCHAR(length=10) - .with_variant(mysql.VARCHAR(length=10), "mysql") - .with_variant(sa.VARCHAR(length=10), "postgresql"), - nullable=True, - comment="Lowest amount of instrument vignetting detected during the visit: UNKNOWN, NO, PARTIALLY, FULLY.", - ), - sa.Column( - "s_region", - sa.VARCHAR(length=1024) - .with_variant(mysql.VARCHAR(length=1024), "mysql") - .with_variant(sa.VARCHAR(length=1024), "postgresql"), - nullable=True, - comment="Sky region in STC-S format (https://www.ivoa.net/documents/STC-S/20130917/index.html).", - ), - sa.PrimaryKeyConstraint("day_obs", "seq_num"), - schema="cdb_lsstcomcamsim", - mysql_engine="MyISAM", - ) op.add_column( "ccdvisit1_quicklook", sa.Column( @@ -571,6 +203,4 @@ def downgrade() -> None: op.drop_column("ccdvisit1_quicklook", "psf_ap_flux_delta", schema="cdb_lsstcomcamsim") op.drop_column("ccdvisit1_quicklook", "stats_mag_lim", schema="cdb_lsstcomcamsim") op.drop_column("ccdvisit1_quicklook", "pixel_scale", schema="cdb_lsstcomcamsim") - op.drop_table("visit1", schema="cdb_lsstcomcamsim") - op.drop_table("ccdvisit1", schema="cdb_lsstcomcamsim") # ### end Alembic commands ###