# $Id: warp.md,v 1.15 2008-03-25 23:14:07 jhoblitt Exp $

#
# We have at least 3 different run types
# a) single epoch differing
# b) magic run operates on "complete" exposures
# c) multiple epoch differing/stacking operations
#

# define a new warprun for a single skycell
warpRun METADATA
    warp_id     S64         0       # Primary Key AUTO_INCREMENT
    cam_id      S64         0       # Key INDEX(warp_id, cam_id) fkey(cam_id) ref camProcessedExp(cam_id)
    mode        STR         64      # Key
    state       STR         64      # Key
    workdir     STR         255
    workdir_state STR       64      # Key
    label       STR         64      # key
    dvodb       STR         255
    tess_id     STR         64
    end_stage   STR         64      # Key
    registered  TAI         NULL
# if magic is T then look for the exp_id in the magic output tables
    magiced     BOOL        f       # Key
END

warpSkyCellMap METADATA
    warp_id     S64         0       # Primary Key fkey(warp_id, cam_id) ref warpRun(warp_id, cam_id)
    skycell_id  STR         64      # Primary Key
    tess_id     STR         64      # Primary Key
    cam_id      S64         0       # Primary Key
# class is not yet consistently carried through pXtools
#    class       STR         64      # Primary Key
    class_id    STR         64      # Primary Key
    fault       S16         0       # Key
END

warpSkyfile METADATA
    warp_id     S64         0       # Primary Key fkey(warp_id, skycell_id, tess_id) ref warpSkyCellMap(warp_id, skycell_id, tess_id)
    skycell_id  STR         64      # Primary Key
    tess_id     STR         64      # Primary Key
    uri         STR         255
    path_base   STR         255
    bg          F64         0.0
    bg_stdev    F64         0.0
    dtime_warp  F32         0.0
    hostname    STR         64
    good_frac   F32         0.0     # Key
    ignored     BOOL        f       # Key
    fault       S16         0       # Key
END

warpMask METADATA
    label       STR         64      # Primary Key
END
