Index: trunk/ippTasks/simtest.flatcorr.auto
===================================================================
--- trunk/ippTasks/simtest.flatcorr.auto	(revision 20384)
+++ trunk/ippTasks/simtest.flatcorr.auto	(revision 20385)
@@ -13,5 +13,5 @@
   name       STR BIAS
   check      STR "regtool -processedexp -exp_type BIAS -inst @CAMERA@ -dbname @DBNAME@"
-  ncheck     S32 20
+  ncheck     S32 10
   launch     STR "dettool -definebyquery -workdir file://@CWD@/detwork -inst @CAMERA@ -det_type BIAS -select_exp_type BIAS -dbname @DBNAME@"
   block      STR "dettool -runs -active -det_type BIAS -dbname @DBNAME@"
@@ -42,10 +42,27 @@
 END
 
-# wait until the master bias frame is registered, then define a new flat-i run
+# wait until the master flat-r frame is registered, then initiate a flat-field correction analysis
 automate METADATA
-  name       STR RAWFLAT-i
-  check      STR "detselect -search -inst @CAMERA@ -det_type SHUTTER -dbname @DBNAME@"
-  launch     STR "dettool -definebyquery -workdir file://@CWD@/detwork -inst @CAMERA@ -det_type FLAT_RAW -filter i -select_exp_type FLAT -select_filter i -dbname @DBNAME@"
-  block      STR "dettool -runs -active -det_type FLAT_RAW -filter i -dbname @DBNAME@"
+  name       STR FLATCORR-r
+  check      STR "detselect -dbname @DBNAME@ -search -inst @CAMERA@ -filter r -det_type FLAT_RAW"
+  launch     STR "flatcorr -definebyquery -dbname @DBNAME@ -det_type FLATCORR -inst @CAMERA@ -exp_type OBJECT -filter r -set_workdir file://@CWD@/detwork -set_reduction FLATCORR -set_dvodb @CWD@/catdir.flatcorr -set_region 270.6,270.9:-23.8,-23.5 -set_filter r"
+  block      STR "dettool -runs -active -det_type FLATCORR -filter r -dbname @DBNAME@"
+END
+
+# wait until the flat-r correction frame is registered, then define the flat-fields to be corrected
+# XXX for the moment, the det_id here is hard-wired
+automate METADATA
+  name       STR FLATFIX-r
+  check      STR "detselect -dbname @DBNAME@ -search -inst @CAMERA@ -filter r -det_type FLATCORR"
+  launch     STR "dettool -makecorrection -dbname @DBNAME@ -det_id 4 -iteration 0 -det_type FLAT -workdir file://@CWD@/detwork"
+  block      STR "dettool -runs -active -det_type FLAT -filter r -dbname @DBNAME@"
+END
+
+# wait until the corrected master flat-r frame is registered, then initiate a second flat-field correction analysis
+automate METADATA
+  name       STR FLATTEST-r
+  check      STR "detselect -dbname @DBNAME@ -search -inst @CAMERA@ -filter r -det_type FLAT"
+  launch     STR "flatcorr -definebyquery -dbname @DBNAME@ -det_type FLATTEST -inst @CAMERA@ -exp_type OBJECT -filter r -set_workdir file://@CWD@/detwork -set_reduction FLATTEST -set_dvodb @CWD@/catdir.flattest -set_region 270.6,270.9:-23.8,-23.5 -set_filter r"
+  block      STR "dettool -runs -active -det_type FLATCORR -filter r -dbname @DBNAME@"
 END
 
@@ -58,20 +75,2 @@
 ## END
 ## 
-## # wait until the master flat-i frame is registered, then unblock the i-band data for chip-level processing
-## automate METADATA
-##   name       STR OBJECT-r
-##   check      STR "detselect -dbname @DBNAME@ -search    -inst @CAMERA@ -filter r -det_type FLAT"
-##   launch     STR "chiptool  -dbname @DBNAME@ -updaterun -inst @CAMERA@ -filter r -label wait -set_label proc"
-##   block      STR NONE
-## END
-## 
-## # wait until the r-band is done with camera, then define a new flat-correction run
-## automate METADATA
-##   name       STR FLATCORR-i
-##   check      STR "camtool -dbname @DBNAME@ -search -inst @CAMERA@ -filter r"
-##   ncheck     S32 8
-##   launch     STR "chiptool  -dbname @DBNAME@ -updaterun -inst @CAMERA@ -filter i -label wait -set_label proc"
-##   block      STR NONE
-## END
-
-## flatcorr -definebyquery -dbname eamtest -filter r -set_workdir /data/alala.0/eugene/swtests/simtest/test.f1/work -set_reduction FLATCORR -set_dvodb /data/alala.0/eugene/swtests/simtest/test.f1/catdir.flatcorr -set_region 270.6,270.9:-23.8,-23.5 -set_filter r
Index: trunk/ippTasks/simtest.flatcorr.config
===================================================================
--- trunk/ippTasks/simtest.flatcorr.config	(revision 20384)
+++ trunk/ippTasks/simtest.flatcorr.config	(revision 20385)
@@ -9,5 +9,5 @@
   OBSTYPE    STR BIAS
   CAMERA     STR SIMTEST
-  NIMAGES    S32  20
+  NIMAGES    S32  10
 END
 
@@ -16,5 +16,5 @@
   CAMERA     STR SIMTEST
   @EXPTIMES  F32  30.0, 300.0
-  @NIMAGES   S32  10,   10
+  @NIMAGES   S32  5,   5
 END
 
@@ -23,8 +23,8 @@
   CAMERA     STR SIMTEST
 
-  FILTERS    STR r,r,i
-  @EXPTIMES  F32 0.1,20.0,20.0
+  FILTERS    STR r,r
+  @EXPTIMES  F32 0.1,20.0
 
-  NSETUP     S32 5
+  NSETUP     S32 3
 END
 
@@ -63,7 +63,7 @@
   # XXX is DVODB used?
   DVODB      STR /data/alala.0/ipp/ippRefs/catdir.synth.simtest 
-  FILTERS    STR r,i
-  @EXPTIMES  F32 10.00,10.00
-  @SKYMAGS   F32 20.86,20.15
+  FILTERS    STR r
+  @EXPTIMES  F32 10.00
+  @SKYMAGS   F32 20.86
 
   # modest IQ range here
@@ -100,7 +100,7 @@
   # XXX is DVODB used?
   DVODB      STR /data/alala.0/ipp/ippRefs/catdir.synth.simtest 
-  FILTERS    STR r,i
-  @EXPTIMES  F32 10.00,10.00
-  @SKYMAGS   F32 20.86,20.15
+  FILTERS    STR r
+  @EXPTIMES  F32 10.00
+  @SKYMAGS   F32 20.86
 
   # modest IQ range here
@@ -137,7 +137,7 @@
   # XXX is DVODB used?
   DVODB      STR /data/alala.0/ipp/ippRefs/catdir.synth.simtest 
-  FILTERS    STR r,i
-  @EXPTIMES  F32 10.00,10.00
-  @SKYMAGS   F32 20.86,20.15
+  FILTERS    STR r
+  @EXPTIMES  F32 10.00
+  @SKYMAGS   F32 20.86
 
   # modest IQ range here
@@ -174,7 +174,7 @@
   # XXX is DVODB used?
   DVODB      STR /data/alala.0/ipp/ippRefs/catdir.synth.simtest 
-  FILTERS    STR r,i
-  @EXPTIMES  F32 10.00,10.00
-  @SKYMAGS   F32 20.86,20.15
+  FILTERS    STR r
+  @EXPTIMES  F32 10.00
+  @SKYMAGS   F32 20.86
 
   # modest IQ range here
