detRun METADATA
    det_id      S64         0       # Primary Key AUTO_INCREMENT
    iteration   S32         0       # Key
    det_type    STR         64      # Key
    mode        STR         64      # Key
    state       STR         64      # Key
    filelevel   STR         64
    workdir     STR         255     # destination for output files
    camera      STR         64
    telescope   STR         64
    exp_type    STR         64      # XXX this should be dropped
    filter      STR         64
    airmass_min F32         0.0
    airmass_max F32         0.0
    exp_time_min F32        0.0
    exp_time_max F32        0.0
    ccd_temp_min F32        0.0
    ccd_temp_max F32        0.0
    posang_min  F64         0.0 
    posang_max  F64         0.0 
    registered  TAI         0001-01-01T00:00:00Z
    time_begin  TAI         0001-01-01T00:00:00Z
    time_end    TAI         0001-01-01T00:00:00Z
    use_begin   TAI         0001-01-01T00:00:00Z
    use_end     TAI         0001-01-01T00:00:00Z
    solang_min  F32         0.0
    solang_max  F32         0.0
    label       STR         64      # key
    parent      S32         0       # Key
END

detInputExp METADATA
    det_id      S64         0       # Primary Key
    iteration   S32         0       # Primary Key
    exp_tag     STR         64      # Primary Key
    include     BOOL        f
END

detProcessedImfile METADATA
    det_id      S64         0      # Primary Key
    exp_tag     STR         64     # Primary Key
    class_id    STR         64     # Primary Key
    uri         STR         255
    recipe      STR         64
    bg          F64         0.0
    bg_stdev    F64         0.0
    bg_mean_stdev   F64     0.0
    fringe_0    F64         0.0
    fringe_1    F64         0.0
    fringe_2    F64         0.0
    user_1      F64         0.0
    user_2      F64         0.0
    user_3      F64         0.0
    user_4      F64         0.0
    user_5      F64         0.0
    path_base   STR         255
    fault       S16         0       # Key NOT NULL
END

detProcessedExp METADATA
    det_id      S64         0      # Primary Key
    exp_tag     STR         64     # Primary Key
    recipe      STR         64
    bg          F64         0.0
    bg_stdev    F64         0.0
    bg_mean_stdev   F64     0.0
    fringe_0    F64         0.0
    fringe_1    F64         0.0
    fringe_2    F64         0.0
    user_1      F64         0.0
    user_2      F64         0.0
    user_3      F64         0.0
    user_4      F64         0.0
    user_5      F64         0.0
    path_base   STR         255
    fault       S16         0       # Key NOT NULL
END

detStackedImfile METADATA
    det_id      S64         0       # Primary Key
    iteration   S32         0       # Primary Key
    class_id    STR         64      # Primary Key
    uri         STR         255
    recipe      STR         64
    bg          F64         0.0
    bg_stdev    F64         0.0
    bg_mean_stdev   F64     0.0
    user_1      F64         0.0
    user_2      F64         0.0
    user_3      F64         0.0
    user_4      F64         0.0
    user_5      F64         0.0
    fault       S16         0       # Key NOT NULL
END

detNormalizedStatImfile METADATA
    det_id      S64         0       # Primary Key
    iteration   S32         0       # Primary Key
    class_id    STR         64      # Primary Key
    norm        F32         0.0
    fault       S16         0       # Key NOT NULL
END

detNormalizedImfile METADATA
    det_id      S64         0       # Primary Key
    iteration   S32         0       # Primary Key
    class_id    STR         64      # Primary Key
    uri         STR         255
    bg          F64         0.0
    bg_stdev    F64         0.0
    bg_mean_stdev   F64     0.0
    user_1      F64         0.0
    user_2      F64         0.0
    user_3      F64         0.0
    user_4      F64         0.0
    user_5      F64         0.0
    path_base   STR         255
    fault       S16         0       # Key NOT NULL
END

detNormalizedExp METADATA
    det_id      S64         0       # Primary Key
    iteration   S32         0       # Primary Key
    recipe      STR         64
    bg          F64         0.0
    bg_stdev    F64         0.0
    bg_mean_stdev   F64     0.0
    user_1      F64         0.0
    user_2      F64         0.0
    user_3      F64         0.0
    user_4      F64         0.0
    user_5      F64         0.0
    path_base   STR         255
    fault       S16         0       # Key NOT NULL
END

#detMasterFrame METADATA
#    det_id      S64         0       # Primary Key
#    iteration   S32         0       # Primary Key
#    comment     STR         255
#END
#
## drop?
#detMasterImfile METADATA
#    det_id      S64         0       # Primary Key
#    class_id    STR         64      # Primary Key
#    uri         STR         255
#    recipe      STR         64
#END

detResidImfile METADATA
    det_id      S64         0       # Primary Key
    iteration   S32         0       # Primary Key
    exp_tag     STR         64      # Primary Key
    class_id    STR         64      # Primary Key
    uri         STR         255
    recipe      STR         64
    bg          F64         0.0
    bg_stdev    F64         0.0
    bg_mean_stdev   F64     0.0
    bin_stdev   F64         0.0
    fringe_0    F64         0.0
    fringe_1    F64         0.0
    fringe_2    F64         0.0
    user_1      F64         0.0
    user_2      F64         0.0
    user_3      F64         0.0
    user_4      F64         0.0
    user_5      F64         0.0
    path_base   STR         255
    fault       S16         0       # Key NOT NULL
END

detResidExp METADATA
    det_id      S64         0       # Primary Key
    iteration   S32         0       # Primary Key
    exp_tag     STR         64      # Primary Key
    recipe      STR         64
    bg          F64         0.0
    bg_stdev    F64         0.0
    bg_mean_stdev   F64     0.0
    bin_stdev   F64         0.0
    fringe_0    F64         0.0
    fringe_1    F64         0.0
    fringe_2    F64         0.0
    user_1      F64         0.0
    user_2      F64         0.0
    user_3      F64         0.0
    user_4      F64         0.0
    user_5      F64         0.0
    path_base   STR         255
    accept      BOOL        f
    fault       S16         0       # Key NOT NULL
END

detRunSummary METADATA
    det_id      S64         0       # Primary Key
    iteration   S32         0       # Primary Key
    bg          F64         0.0
    bg_stdev    F64         0.0
    bg_mean_stdev   F64     0.0
    accept      BOOL        f
    fault       S16         0       # Key NOT NULL
END
