# $Id: warp.md,v 1.17 2008-06-09 22:55:57 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
    fake_id      S64         0       # Key INDEX(warp_id, fake_id) fkey(fake_id) ref camProcessedExp(fake_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) ref warpRun(warp_id)
    skycell_id  STR         64      # Primary Key
    tess_id     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
    xmin        S32         0
    xmax        S32         0
    ymin        S32         0
    ymax        S32         0
    ignored     BOOL        f       # Key
    fault       S16         0       # Key
END

warpMask METADATA
    label       STR         64      # Primary Key
END
