[INSTRM-150] Updating scheme for AIT sequence/exposure database Created: 13/Jul/17  Updated: 04/Jul/18  Resolved: 04/Jul/18

Status: Done
Project: Instrument control development
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Normal
Reporter: arnaud.lefur Assignee: arnaud.lefur
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates INSTRM-114 Design per-exposure logs Done
Relates
relates to INSTRM-114 Design per-exposure logs Done
Sprint: 2017-10A

 Description   

We agreed on a updated scheme for the AIT exposure database in order to facilitate the sharing of the data between institutes.

This consist in 3 tables :

  • a table which list all the exposures (filled by the ccdActor)
    CREATE TABLE exp
    (
      expid bigint NOT NULL,
      exptype text,
      exptime double precision,
      obsdate text,
      quality text,
      CONSTRAINT id PRIMARY KEY (expid)
    
  • a table which link a single exposure to an exposure group
CREATE TABLE expgroup
(
  expid bigint NOT NULL,
  groupid bigint,
  CONSTRAINT id PRIMARY KEY (expid)
  • a table which list the experiments (per sm):
CREATE TABLE sm0
(
  testid bigint NOT NULL,
  groupid bigint,
  testname text,
  experiment text,
  date text,
  arm text,
  drp text,
  operator text,
  cmdstr text,
  status text,
  comments text,
  anomalies text,
  exptime double precision,
  lowbound double precision,
  upbound double precision,
  nbimage bigint,
  CONSTRAINT id PRIMARY KEY (index)


 Comments   
Comment by cloomis [ 13/Jul/17 ]

How much should this be compatible with Yasuda-san's survey ops db? (See the schema pages 7+)

The obvious overlap is the Exposure table. I think that the observing schema needs to be split, with the core part merged into AIT's exp and the observing conditions and fiber allocation details pulled out. Something like:

CREATE TABLE Exposure
(
  --    include Pxyz and seqno, to allow merging 
  --    from multiple sites.
  exposureId CHAR[10] PRIMARY KEY, 

  --    denormalize frameId for convenience. Or
  --    add functions.
  visitId INTEGER NOT NULL,
  site CHAR[1] NOT NULL,

  --    add WITHOUT TIME ZONE?
  obsdate TIMESTAMP,
  exptime FLOAT,

  --    bias, dark, arc, flat, object, junk
  exptype TEXT,

  --    OK, bad
  quality TEXT DEFAULT 'OK',
)

We also need to know which cameras are part of this Exposure. Note
that the individual cameras will have their own exptime and obsdate, but we do not track that here. We could. And the NIR 5.57s*N exptimes argue that we have to.

CREATE TABLE CamExposure
(
  camExposureId PRIMARY KEY,

  exposureId CHAR[10] NOT NULL,
  spectrograph INTEGER,
  arm CHAR[1], 
)

Yes, there will be up to 12 CamExposure rows per Exposure.

Comment by cloomis [ 27/Jul/17 ]

Comment from fmadec copied from INSTRM-114:

The current very simple exposure logs of LAM is there:
https://people.lam.fr/madec.fabrice/pfs/

Comment by arnaud.lefur [ 04/Jun/18 ]

I've almost covered everything fixing tickets/INSTRM-274. The mechanism to fill experiment table is not working yet .

The scheme is very similar to Craig's proposal

  1. Create table
    c.execute('''CREATE TABLE Exposure
                 (exposureId CHAR[10] PRIMARY KEY, 
                  site CHAR[1] NOT NULL, 
                  visit INTEGER NOT NULL,
                  obsdate TIMESTAMP,
                  exptime FLOAT,
                  exptype TEXT,
                  quality TEXT)''')
  1. c.execute('''CREATE TABLE CamExposure
                (camExposureId CHAR[12] NOT NULL PRIMARY KEY,
                 exposureId CHAR[10] NOT NULL,
                 spectrograph INTEGER,
                 arm CHAR[1])''')
  1. c.execute('''CREATE TABLE Experiment
                 (experimentId INTEGER PRIMARY KEY,
                  name TEXT,
                  visitStart INTEGER NOT NULL,
                  visitEnd INTEGER NOT NULL,
                  type Text,
                  cmdStr TEXT,
                  comments TEXT,
                  anomalies TEXT)''')

 

For now the quality flag is by default set to "OK". 
But we have to be careful because the definition of "OK" is certainly not the same for us, rhl or ncaplar.

Comment by arnaud.lefur [ 04/Jul/18 ]

merged in 428f8d0 

Generated at Sat Feb 10 16:22:03 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.