# $Id: warp.md,v 1.9 2007-11-09 03:34:05 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
    mode        STR         64      # Key
    state       STR         64      # Key
    workdir     STR         255
    dvodb       STR         255
    registered  TAI         NULL
END

#
# Warp to Sky Cell Mode
#

# the list of imfiles in our skycell keyed against phase 3
# only allow one cam_version of an exp_id per warpRun
warpInputExp METADATA
    warp_id     S64         0       # Primary Key fkey(warp_id) ref warpRun(warp_id)
    cam_id      S64         0       # Primary Key fkey(cam_id) ref camProcessedExp(cam_id)
# 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 warpInputExp(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
    good_frac   F64         0.0     # Key
    ignored     BOOL        f       # Key
    fault       S16         0       # Key
END

