Index: /trunk/dbconfig/ipp.m4
===================================================================
--- /trunk/dbconfig/ipp.m4	(revision 11663)
+++ /trunk/dbconfig/ipp.m4	(revision 11664)
@@ -10,3 +10,3 @@
 include(tasks.md)
 include(p4.md)
-dnl include(skycell.md)
+include(skycell.md)
Index: /trunk/dbconfig/p4.md
===================================================================
--- /trunk/dbconfig/p4.md	(revision 11663)
+++ /trunk/dbconfig/p4.md	(revision 11664)
@@ -1,3 +1,3 @@
-# $Id: p4.md,v 1.7 2007-02-06 02:37:40 jhoblitt Exp $
+# $Id: p4.md,v 1.8 2007-02-06 04:28:08 jhoblitt Exp $
 
 #
@@ -9,42 +9,26 @@
 
 # define a new p4run for a single skycell
-p4Run METADATA
-    p4_id       S32         0       # Primary Key AUTO_INCREMENT
-    survey_mode  STR       64      # Key
+p4aRun METADATA
+    p4a_id      S32         0       # Primary Key AUTO_INCREMENT
     state       STR         64      # Key
 #    mode        STR         64      # Key
     workdir     STR         255
-    filter      STR         64
-END
-
-p4InputSkyCell METADATA
-    p4_id       S32         0       # Primary Key
-    skycell_id  STR         64      # Primary Key
-    tess_id     STR         64      # Primary Key
+    magic       BOOL        f       # Primary Key
 END
 
 # the list of imfiles in our skycell keyed against phase 3
-p4InputImfile  METADATA
-    p4_id       S32         0       # Primary Key
+p4aInputExp METADATA
+    p4a_id      S32         0       # Primary Key
+    exp_tag     STR         64      # Primary Key
+    p3_version  S32         0       # Primary Key
+# if magic is T then look for the exp_tag in the magic output tables
+END
+
+p4aScfile METADATA
+    p4a_id      S32         0       # Primary Key
     skycell_id  STR         64      # Primary Key
     tess_id     STR         64      # Primary Key
     exp_tag     STR         64      # Primary Key
     p3_version  S32         0       # Primary Key
-# class is not yet consistently carried through pXtools
-#    class       STR         64      # Primary Key
-    class_id    STR         64      # Primary Key
-# either a input or a template
-    kind        STR         64      # Key 
-END
-
-p4WarpedImfile METADATA
-    p4_id       S32         0       # Primary Key
-    skycell_id  STR         64      # Primary Key
-    tess_id     STR         64      # Primary Key
-    exp_tag     STR         64      # Primary Key
-    p3_version  S32         0       # Primary Key
-# class is not yet consistently carried through pXtools
-#    class       STR         64      # Primary Key
-    class_id    STR         64      # Primary Key
     uri         STR         255
     bg          F64         0.0
@@ -52,15 +36,29 @@
 END
 
-# one diff image per input to the current stack
-# XXX how will diff against the static sky be handled?
-p4DiffImfile METADATA
-    p4_id       S32         0       # Primary Key
+p4bRun METADATA
+    p4b_id      S32         0       # Primary Key AUTO_INCREMENT
+    state       STR         64      # Key
+#    mode        STR         64      # Key
+    workdir     STR         255
+    magic       BOOL        f       # Primary Key
+END
+
+# only ever 2 per run
+p4bInputScfile METADATA
+    p4b_id      S32         0       # Primary Key
     skycell_id  STR         64      # Primary Key
     tess_id     STR         64      # Primary Key
     exp_tag     STR         64      # Primary Key
     p3_version  S32         0       # Primary Key
-# class is not yet consistently carried through pXtools
-#    class       STR         64      # Primary Key
-    class_id    STR         64      # Primary Key
+# either a input or a template
+    kind        STR         64      # Key 
+END
+
+p4bDiffScfile METADATA
+    p4b_id      S32         0       # Primary Key
+    skycell_id  STR         64      # Primary Key
+    tess_id     STR         64      # Primary Key
+    exp_tag     STR         64      # Primary Key
+    p3_version  S32         0       # Primary Key
     uri         STR         255
     bg          F64         0.0
@@ -68,21 +66,23 @@
 END
 
-p4StackedImfile METADATA
-    p4_id       S32         0       # Primary Key
-    skycell_id  STR         64      # Primary Key
-    tess_id     STR         64      # Primary Key
+# define a new p4run for a single skycell
+p4cRun METADATA
+    p4c_id      S32         0       # Primary Key AUTO_INCREMENT
+    state       STR         64      # Key
+#    mode        STR         64      # Key
+    workdir     STR         255
+    magic       BOOL        f       # Primary Key
+END
+
+# the list of imfiles in our skycell keyed against phase 3
+p4cInputExp METADATA
+    p4c_id      S32         0       # Primary Key
     exp_tag     STR         64      # Primary Key
     p3_version  S32         0       # Primary Key
-# class is not yet consistently carried through pXtools
-#    class       STR         64      # Primary Key
-    class_id    STR         64      # Primary Key
-    uri         STR         255
-    bg          F64         0.0
-    bg_mean_stdev   F64     0.0
 END
 
 # output from magic
 p4MagicMaskImfile METADATA
-    p4_id       S32         0       # Primary Key
+    p4c_id       S32         0       # Primary Key
     exp_tag     STR         64      # Primary Key
     p3_version  S32         0       # Primary Key
@@ -92,2 +92,69 @@
     uri         STR         255
 END
+
+# output from magic
+# p4MagicMaskImfile METADATA
+#     p4_id       S32         0       # Primary Key
+#     exp_tag     STR         64      # Primary Key
+#     p3_version  S32         0       # Primary Key
+# # class is not yet consistently carried through pXtools
+# #    class       STR         64      # Primary Key
+#     class_id    STR         64      # Primary Key
+#     uri         STR         255
+# END
+# 
+# # the list of imfiles in our skycell keyed against phase 3
+# p4InputImfile  METADATA
+#     p4_id       S32         0       # Primary Key
+#     skycell_id  STR         64      # Primary Key
+#     tess_id     STR         64      # Primary Key
+#     exp_tag     STR         64      # Primary Key
+#     p3_version  S32         0       # Primary Key
+# # class is not yet consistently carried through pXtools
+# #    class       STR         64      # Primary Key
+#     class_id    STR         64      # Primary Key
+# # either a input or a template
+#     kind        STR         64      # Key 
+# END
+# 
+# 
+# # one diff image per input to the current stack
+# # XXX how will diff against the static sky be handled?
+# p4DiffImfile METADATA
+#     p4_id       S32         0       # Primary Key
+#     skycell_id  STR         64      # Primary Key
+#     tess_id     STR         64      # Primary Key
+#     exp_tag     STR         64      # Primary Key
+#     p3_version  S32         0       # Primary Key
+# # class is not yet consistently carried through pXtools
+# #    class       STR         64      # Primary Key
+#     class_id    STR         64      # Primary Key
+#     uri         STR         255
+#     bg          F64         0.0
+#     bg_mean_stdev   F64     0.0
+# END
+# 
+# p4StackedImfile METADATA
+#     p4_id       S32         0       # Primary Key
+#     skycell_id  STR         64      # Primary Key
+#     tess_id     STR         64      # Primary Key
+#     exp_tag     STR         64      # Primary Key
+#     p3_version  S32         0       # Primary Key
+# # class is not yet consistently carried through pXtools
+# #    class       STR         64      # Primary Key
+#     class_id    STR         64      # Primary Key
+#     uri         STR         255
+#     bg          F64         0.0
+#     bg_mean_stdev   F64     0.0
+# END
+# 
+# # output from magic
+# p4MagicMaskImfile METADATA
+#     p4_id       S32         0       # Primary Key
+#     exp_tag     STR         64      # Primary Key
+#     p3_version  S32         0       # Primary Key
+# # class is not yet consistently carried through pXtools
+# #    class       STR         64      # Primary Key
+#     class_id    STR         64      # Primary Key
+#     uri         STR         255
+# END
