Skip to content

Instantly share code, notes, and snippets.

@brianv0
Created November 9, 2018 05:07
Show Gist options
  • Save brianv0/340866422bb3a031b9c935e0a1be3256 to your computer and use it in GitHub Desktop.
Save brianv0/340866422bb3a031b9c935e0a1be3256 to your computer and use it in GitHub Desktop.
Felis Output
---
name: sdqa
description: The SDQA Schema
tables:
- name: sdqa_ImageStatus
'@id': "#sdqa_ImageStatus"
description: Unique set of status names and their definitions, e.g. 'passed', 'failed',
etc.
columns:
- name: sdqa_imageStatusId
"@id": "#sdqa_ImageStatus.sdqa_imageStatusId"
datatype: short
description: Primary key
mysql:datatype: SMALLINT
- name: statusName
"@id": "#sdqa_ImageStatus.statusName"
datatype: string
description: One-word, camel-case, descriptive name of a possible image status
(e.g., passedAuto, marginallyPassedManual, etc.)
length: 30
mysql:datatype: VARCHAR(30)
- name: definition
"@id": "#sdqa_ImageStatus.definition"
datatype: string
description: Detailed Definition of the image status
length: 255
mysql:datatype: VARCHAR(255)
primaryKey: "#sdqa_ImageStatus.sdqa_imageStatusId"
mysql:engine: MyISAM
- name: sdqa_Metric
"@id": "#sdqa_Metric"
description: Unique set of metric names and associated metadata (e.g., 'nDeadPix';,
'median';, etc.). There will be approximately 30 records total in this table.
columns:
- name: sdqa_metricId
"@id": "#sdqa_Metric.sdqa_metricId"
datatype: short
description: Primary key.
mysql:datatype: SMALLINT
- name: metricName
"@id": "#sdqa_Metric.metricName"
datatype: string
description: One-word, camel-case, descriptive name of a possible metric (e.g.,
mSatPix, median, etc).
length: 30
mysql:datatype: VARCHAR(30)
- name: physicalUnits
"@id": "#sdqa_Metric.physicalUnits"
datatype: string
description: Physical units of metric.
length: 30
mysql:datatype: VARCHAR(30)
- name: dataType
"@id": "#sdqa_Metric.dataType"
datatype: char
description: Flag indicating whether data type of the metric value is integer
(0) or float (1).
length: 1
mysql:datatype: CHAR(1)
- name: definition
"@id": "#sdqa_Metric.definition"
datatype: string
length: 255
mysql:datatype: VARCHAR(255)
primaryKey: "#sdqa_Metric.sdqa_metricId"
constraints:
- name: UQ_sdqaMetric_metricName
"@id": "#UQ_sdqaMetric_metricName"
"@type": Unique
columns:
- "#sdqa_Metric.metricName"
mysql:engine: MyISAM
- name: sdqa_Rating_ForAmpVisit
"@id": "#sdqa_Rating_ForAmpVisit"
description: Various SDQA ratings for a given amplifier image. There will approximately
30 of these records per image record.
columns:
- name: sdqa_ratingId
"@id": "#sdqa_Rating_ForAmpVisit.sdqa_ratingId"
datatype: long
description: Primary key. Auto-increment is used, we define a composite unique
key, so potential duplicates will be captured.
mysql:datatype: BIGINT
- name: sdqa_metricId
"@id": "#sdqa_Rating_ForAmpVisit.sdqa_metricId"
datatype: short
description: Pointer to sdqa_Metric.
mysql:datatype: SMALLINT
- name: sdqa_thresholdId
"@id": "#sdqa_Rating_ForAmpVisit.sdqa_thresholdId"
datatype: short
description: Pointer to sdqa_Threshold.
mysql:datatype: SMALLINT
- name: ampVisitId
"@id": "#sdqa_Rating_ForAmpVisit.ampVisitId"
datatype: long
description: Pointer to AmpVisit.
mysql:datatype: BIGINT
ivoa:ucd: meta.id;obs.image
- name: metricValue
"@id": "#sdqa_Rating_ForAmpVisit.metricValue"
datatype: double
description: Value of this SDQA metric.
mysql:datatype: DOUBLE
- name: metricSigma
"@id": "#sdqa_Rating_ForAmpVisit.metricSigma"
datatype: double
description: Uncertainty of the value of this metric.
mysql:datatype: DOUBLE
primaryKey: "#sdqa_Rating_ForAmpVisit.sdqa_ratingId"
constraints:
- name: UQ_sdqaRatingForAmpVisit_metricId_ampVisitId
"@id": "#UQ_sdqaRatingForAmpVisit_metricId_ampVisitId"
"@type": Unique
columns:
- "#sdqa_Rating_ForAmpVisit.sdqa_metricId"
- "#sdqa_Rating_ForAmpVisit.ampVisitId"
indexes:
- name: IDX_sdqaRatingForAmpVisit_metricId
"@id": "#IDX_sdqaRatingForAmpVisit_metricId"
columns:
- "#sdqa_Rating_ForAmpVisit.sdqa_metricId"
- name: IDX_sdqaRatingForAmpVisit_thresholdId
"@id": "#IDX_sdqaRatingForAmpVisit_thresholdId"
columns:
- "#sdqa_Rating_ForAmpVisit.sdqa_thresholdId"
- name: IDX_sdqaRatingForAmpVisit_ampVisitId
"@id": "#IDX_sdqaRatingForAmpVisit_ampVisitId"
columns:
- "#sdqa_Rating_ForAmpVisit.ampVisitId"
mysql:engine: MyISAM
- name: sdqa_Rating_CcdVisit
"@id": "#sdqa_Rating_CcdVisit"
description: Various SDQA ratings for a given CcdVisit.
columns:
- name: sdqa_ratingId
"@id": "#sdqa_Rating_CcdVisit.sdqa_ratingId"
datatype: long
description: Primary key. Auto-increment is used, we define a composite unique
key, so potential duplicates will be captured.
mysql:datatype: BIGINT
- name: sdqa_metricId
"@id": "#sdqa_Rating_CcdVisit.sdqa_metricId"
datatype: short
description: Pointer to sdqa_Metric.
mysql:datatype: SMALLINT
- name: sdqa_thresholdId
"@id": "#sdqa_Rating_CcdVisit.sdqa_thresholdId"
datatype: short
description: Pointer to sdqa_Threshold.
mysql:datatype: SMALLINT
- name: ccdVisitId
"@id": "#sdqa_Rating_CcdVisit.ccdVisitId"
datatype: long
description: Pointer to CcdVisit.
mysql:datatype: BIGINT
ivoa:ucd: meta.id;obs.image
- name: metricValue
"@id": "#sdqa_Rating_CcdVisit.metricValue"
datatype: double
description: Value of this SDQA metric.
mysql:datatype: DOUBLE
- name: metricSigma
"@id": "#sdqa_Rating_CcdVisit.metricSigma"
datatype: double
description: Uncertainty of the value of this metric.
mysql:datatype: DOUBLE
primaryKey: "#sdqa_Rating_CcdVisit.sdqa_ratingId"
constraints:
- name: UQ_sdqaRatingCcdVisit_metricId_ccdVisitId
"@id": "#UQ_sdqaRatingCcdVisit_metricId_ccdVisitId"
"@type": Unique
columns:
- "#sdqa_Rating_CcdVisit.sdqa_metricId"
- "#sdqa_Rating_CcdVisit.ccdVisitId"
indexes:
- name: IDX_sdqaRatingCcdVisit_metricId
"@id": "#IDX_sdqaRatingCcdVisit_metricId"
columns:
- "#sdqa_Rating_CcdVisit.sdqa_metricId"
- name: IDX_sdqaRatingCcdVisit_thresholdId
"@id": "#IDX_sdqaRatingCcdVisit_thresholdId"
columns:
- "#sdqa_Rating_CcdVisit.sdqa_thresholdId"
- name: IDX_sdqaRatingCcdVisit_ccdVisitId
"@id": "#IDX_sdqaRatingCcdVisit_ccdVisitId"
columns:
- "#sdqa_Rating_CcdVisit.ccdVisitId"
mysql:engine: MyISAM
- name: sdqa_Threshold
"@id": "#sdqa_Threshold"
description: Version-controlled metric thresholds. Total number of these records
is approximately equal to 30 x the number of times the thresholds will be changed
over the entire period of LSST operations (of order of 100), with most of the
changes occuring in the first year of operations.
columns:
- name: sdqa_thresholdId
"@id": "#sdqa_Threshold.sdqa_thresholdId"
datatype: short
description: Primary key.
mysql:datatype: SMALLINT
- name: sdqa_metricId
"@id": "#sdqa_Threshold.sdqa_metricId"
datatype: short
description: Pointer to sdqa_Metric table.
mysql:datatype: SMALLINT
- name: upperThreshold
"@id": "#sdqa_Threshold.upperThreshold"
datatype: double
description: Threshold for which a metric value is tested to be greater than.
mysql:datatype: DOUBLE
- name: lowerThreshold
"@id": "#sdqa_Threshold.lowerThreshold"
datatype: double
description: Threshold for which a metric value is tested to be less than.
mysql:datatype: DOUBLE
- name: createdDate
"@id": "#sdqa_Threshold.createdDate"
datatype: timestamp
description: Database timestamp when the record is inserted.
value: CURRENT_TIMESTAMP
mysql:datatype: TIMESTAMP
primaryKey: "#sdqa_Threshold.sdqa_thresholdId"
indexes:
- name: IDX_sdqaThreshold_metricId
"@id": "#IDX_sdqaThreshold_metricId"
columns:
- "#sdqa_Threshold.sdqa_metricId"
mysql:engine: MyISAM
CREATE TABLE sdqa.`sdqa_ImageStatus` (
`sdqa_imageStatusId` SMALLINT NOT NULL COMMENT 'Primary key' AUTO_INCREMENT,
`statusName` VARCHAR(30) COMMENT 'One-word, camel-case, descriptive name of a possible image status (e.g., passedAuto, marginallyPassedManual, etc.)',
definition VARCHAR(255) COMMENT 'Detailed Definition of the image status',
PRIMARY KEY (`sdqa_imageStatusId`)
)COMMENT='Unique set of status names and their definitions, e.g. ''passed'', ''failed'', etc.'
CREATE TABLE sdqa.`sdqa_Metric` (
`sdqa_metricId` SMALLINT NOT NULL COMMENT 'Primary key.' AUTO_INCREMENT,
`metricName` VARCHAR(30) COMMENT 'One-word, camel-case, descriptive name of a possible metric (e.g., mSatPix, median, etc).',
`physicalUnits` VARCHAR(30) COMMENT 'Physical units of metric.',
`dataType` CHAR(1) COMMENT 'Flag indicating whether data type of the metric value is integer (0) or float (1).',
definition VARCHAR(255),
PRIMARY KEY (`sdqa_metricId`),
CONSTRAINT `UQ_sdqaMetric_metricName` UNIQUE (`metricName`)
)COMMENT='Unique set of metric names and associated metadata (e.g., ''nDeadPix'';, ''median'';, etc.). There will be approximately 30 records total in this table.'
CREATE TABLE sdqa.`sdqa_Rating_ForAmpVisit` (
`sdqa_ratingId` BIGINT NOT NULL COMMENT 'Primary key. Auto-increment is used, we define a composite unique key, so potential duplicates will be captured.' AUTO_INCREMENT,
`sdqa_metricId` SMALLINT COMMENT 'Pointer to sdqa_Metric.',
`sdqa_thresholdId` SMALLINT COMMENT 'Pointer to sdqa_Threshold.',
`ampVisitId` BIGINT COMMENT 'Pointer to AmpVisit.',
`metricValue` DOUBLE COMMENT 'Value of this SDQA metric.',
`metricSigma` DOUBLE COMMENT 'Uncertainty of the value of this metric.',
PRIMARY KEY (`sdqa_ratingId`),
CONSTRAINT `UQ_sdqaRatingForAmpVisit_metricId_ampVisitId` UNIQUE (`sdqa_metricId`, `ampVisitId`)
)COMMENT='Various SDQA ratings for a given amplifier image. There will approximately 30 of these records per image record.'
CREATE INDEX `IDX_sdqaRatingForAmpVisit_metricId` ON sdqa.`sdqa_Rating_ForAmpVisit` (`sdqa_metricId`)
CREATE INDEX `IDX_sdqaRatingForAmpVisit_thresholdId` ON sdqa.`sdqa_Rating_ForAmpVisit` (`sdqa_thresholdId`)
CREATE INDEX `IDX_sdqaRatingForAmpVisit_ampVisitId` ON sdqa.`sdqa_Rating_ForAmpVisit` (`ampVisitId`)
CREATE TABLE sdqa.`sdqa_Rating_CcdVisit` (
`sdqa_ratingId` BIGINT NOT NULL COMMENT 'Primary key. Auto-increment is used, we define a composite unique key, so potential duplicates will be captured.' AUTO_INCREMENT,
`sdqa_metricId` SMALLINT COMMENT 'Pointer to sdqa_Metric.',
`sdqa_thresholdId` SMALLINT COMMENT 'Pointer to sdqa_Threshold.',
`ccdVisitId` BIGINT COMMENT 'Pointer to CcdVisit.',
`metricValue` DOUBLE COMMENT 'Value of this SDQA metric.',
`metricSigma` DOUBLE COMMENT 'Uncertainty of the value of this metric.',
PRIMARY KEY (`sdqa_ratingId`),
CONSTRAINT `UQ_sdqaRatingCcdVisit_metricId_ccdVisitId` UNIQUE (`sdqa_metricId`, `ccdVisitId`)
)COMMENT='Various SDQA ratings for a given CcdVisit.'
CREATE INDEX `IDX_sdqaRatingCcdVisit_metricId` ON sdqa.`sdqa_Rating_CcdVisit` (`sdqa_metricId`)
CREATE INDEX `IDX_sdqaRatingCcdVisit_ccdVisitId` ON sdqa.`sdqa_Rating_CcdVisit` (`ccdVisitId`)
CREATE INDEX `IDX_sdqaRatingCcdVisit_thresholdId` ON sdqa.`sdqa_Rating_CcdVisit` (`sdqa_thresholdId`)
CREATE TABLE sdqa.`sdqa_Threshold` (
`sdqa_thresholdId` SMALLINT NOT NULL COMMENT 'Primary key.' AUTO_INCREMENT,
`sdqa_metricId` SMALLINT COMMENT 'Pointer to sdqa_Metric table.',
`upperThreshold` DOUBLE COMMENT 'Threshold for which a metric value is tested to be greater than.',
`lowerThreshold` DOUBLE COMMENT 'Threshold for which a metric value is tested to be less than.',
`createdDate` TIMESTAMP NULL DEFAULT 'CURRENT_TIMESTAMP' COMMENT 'Database timestamp when the record is inserted.',
PRIMARY KEY (`sdqa_thresholdId`)
)COMMENT='Version-controlled metric thresholds. Total number of these records is approximately equal to 30 x the number of times the thresholds will be changed over the entire period of LSST operations (of order of 100), with most of the changes occuring in the first year of operations.'
CREATE INDEX `IDX_sdqaThreshold_metricId` ON sdqa.`sdqa_Threshold` (`sdqa_metricId`)
CREATE TABLE sdqa."sdqa_ImageStatus" (
"sdqa_imageStatusId" SMALLSERIAL NOT NULL,
"statusName" VARCHAR(30),
definition VARCHAR(255),
PRIMARY KEY ("sdqa_imageStatusId")
)
COMMENT ON TABLE sdqa."sdqa_ImageStatus" IS 'Unique set of status names and their definitions, e.g. ''passed'', ''failed'', etc.'
COMMENT ON COLUMN sdqa."sdqa_ImageStatus"."sdqa_imageStatusId" IS 'Primary key'
COMMENT ON COLUMN sdqa."sdqa_ImageStatus"."statusName" IS 'One-word, camel-case, descriptive name of a possible image status (e.g., passedAuto, marginallyPassedManual, etc.)'
COMMENT ON COLUMN sdqa."sdqa_ImageStatus".definition IS 'Detailed Definition of the image status'
CREATE TABLE sdqa."sdqa_Metric" (
"sdqa_metricId" SMALLSERIAL NOT NULL,
"metricName" VARCHAR(30),
"physicalUnits" VARCHAR(30),
"dataType" CHAR(1),
definition VARCHAR(255),
PRIMARY KEY ("sdqa_metricId"),
CONSTRAINT "UQ_sdqaMetric_metricName" UNIQUE ("metricName")
)
COMMENT ON TABLE sdqa."sdqa_Metric" IS 'Unique set of metric names and associated metadata (e.g., ''nDeadPix'';, ''median'';, etc.). There will be approximately 30 records total in this table.'
COMMENT ON COLUMN sdqa."sdqa_Metric"."sdqa_metricId" IS 'Primary key.'
COMMENT ON COLUMN sdqa."sdqa_Metric"."metricName" IS 'One-word, camel-case, descriptive name of a possible metric (e.g., mSatPix, median, etc).'
COMMENT ON COLUMN sdqa."sdqa_Metric"."physicalUnits" IS 'Physical units of metric.'
COMMENT ON COLUMN sdqa."sdqa_Metric"."dataType" IS 'Flag indicating whether data type of the metric value is integer (0) or float (1).'
CREATE TABLE sdqa."sdqa_Rating_ForAmpVisit" (
"sdqa_ratingId" BIGSERIAL NOT NULL,
"sdqa_metricId" SMALLINT,
"sdqa_thresholdId" SMALLINT,
"ampVisitId" BIGINT,
"metricValue" DOUBLE PRECISION,
"metricSigma" DOUBLE PRECISION,
PRIMARY KEY ("sdqa_ratingId"),
CONSTRAINT "UQ_sdqaRatingForAmpVisit_metricId_ampVisitId" UNIQUE ("sdqa_metricId", "ampVisitId")
)
CREATE INDEX "IDX_sdqaRatingForAmpVisit_metricId" ON sdqa."sdqa_Rating_ForAmpVisit" ("sdqa_metricId")
CREATE INDEX "IDX_sdqaRatingForAmpVisit_thresholdId" ON sdqa."sdqa_Rating_ForAmpVisit" ("sdqa_thresholdId")
CREATE INDEX "IDX_sdqaRatingForAmpVisit_ampVisitId" ON sdqa."sdqa_Rating_ForAmpVisit" ("ampVisitId")
COMMENT ON TABLE sdqa."sdqa_Rating_ForAmpVisit" IS 'Various SDQA ratings for a given amplifier image. There will approximately 30 of these records per image record.'
COMMENT ON COLUMN sdqa."sdqa_Rating_ForAmpVisit"."sdqa_ratingId" IS 'Primary key. Auto-increment is used, we define a composite unique key, so potential duplicates will be captured.'
COMMENT ON COLUMN sdqa."sdqa_Rating_ForAmpVisit"."sdqa_metricId" IS 'Pointer to sdqa_Metric.'
COMMENT ON COLUMN sdqa."sdqa_Rating_ForAmpVisit"."sdqa_thresholdId" IS 'Pointer to sdqa_Threshold.'
COMMENT ON COLUMN sdqa."sdqa_Rating_ForAmpVisit"."ampVisitId" IS 'Pointer to AmpVisit.'
COMMENT ON COLUMN sdqa."sdqa_Rating_ForAmpVisit"."metricValue" IS 'Value of this SDQA metric.'
COMMENT ON COLUMN sdqa."sdqa_Rating_ForAmpVisit"."metricSigma" IS 'Uncertainty of the value of this metric.'
CREATE TABLE sdqa."sdqa_Rating_CcdVisit" (
"sdqa_ratingId" BIGSERIAL NOT NULL,
"sdqa_metricId" SMALLINT,
"sdqa_thresholdId" SMALLINT,
"ccdVisitId" BIGINT,
"metricValue" DOUBLE PRECISION,
"metricSigma" DOUBLE PRECISION,
PRIMARY KEY ("sdqa_ratingId"),
CONSTRAINT "UQ_sdqaRatingCcdVisit_metricId_ccdVisitId" UNIQUE ("sdqa_metricId", "ccdVisitId")
)
CREATE INDEX "IDX_sdqaRatingCcdVisit_metricId" ON sdqa."sdqa_Rating_CcdVisit" ("sdqa_metricId")
CREATE INDEX "IDX_sdqaRatingCcdVisit_ccdVisitId" ON sdqa."sdqa_Rating_CcdVisit" ("ccdVisitId")
CREATE INDEX "IDX_sdqaRatingCcdVisit_thresholdId" ON sdqa."sdqa_Rating_CcdVisit" ("sdqa_thresholdId")
COMMENT ON TABLE sdqa."sdqa_Rating_CcdVisit" IS 'Various SDQA ratings for a given CcdVisit.'
COMMENT ON COLUMN sdqa."sdqa_Rating_CcdVisit"."sdqa_ratingId" IS 'Primary key. Auto-increment is used, we define a composite unique key, so potential duplicates will be captured.'
COMMENT ON COLUMN sdqa."sdqa_Rating_CcdVisit"."sdqa_metricId" IS 'Pointer to sdqa_Metric.'
COMMENT ON COLUMN sdqa."sdqa_Rating_CcdVisit"."sdqa_thresholdId" IS 'Pointer to sdqa_Threshold.'
COMMENT ON COLUMN sdqa."sdqa_Rating_CcdVisit"."ccdVisitId" IS 'Pointer to CcdVisit.'
COMMENT ON COLUMN sdqa."sdqa_Rating_CcdVisit"."metricValue" IS 'Value of this SDQA metric.'
COMMENT ON COLUMN sdqa."sdqa_Rating_CcdVisit"."metricSigma" IS 'Uncertainty of the value of this metric.'
CREATE TABLE sdqa."sdqa_Threshold" (
"sdqa_thresholdId" SMALLSERIAL NOT NULL,
"sdqa_metricId" SMALLINT,
"upperThreshold" DOUBLE PRECISION,
"lowerThreshold" DOUBLE PRECISION,
"createdDate" TIMESTAMP WITHOUT TIME ZONE DEFAULT 'CURRENT_TIMESTAMP',
PRIMARY KEY ("sdqa_thresholdId")
)
CREATE INDEX "IDX_sdqaThreshold_metricId" ON sdqa."sdqa_Threshold" ("sdqa_metricId")
COMMENT ON TABLE sdqa."sdqa_Threshold" IS 'Version-controlled metric thresholds. Total number of these records is approximately equal to 30 x the number of times the thresholds will be changed over the entire period of LSST operations (of order of 100), with most of the changes occuring in the first year of operations.'
COMMENT ON COLUMN sdqa."sdqa_Threshold"."sdqa_thresholdId" IS 'Primary key.'
COMMENT ON COLUMN sdqa."sdqa_Threshold"."sdqa_metricId" IS 'Pointer to sdqa_Metric table.'
COMMENT ON COLUMN sdqa."sdqa_Threshold"."upperThreshold" IS 'Threshold for which a metric value is tested to be greater than.'
COMMENT ON COLUMN sdqa."sdqa_Threshold"."lowerThreshold" IS 'Threshold for which a metric value is tested to be less than.'
COMMENT ON COLUMN sdqa."sdqa_Threshold"."createdDate" IS 'Database timestamp when the record is inserted.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment