Index: trunk/ippTasks/simtest.ctemask.auto
===================================================================
--- trunk/ippTasks/simtest.ctemask.auto	(revision 23478)
+++ trunk/ippTasks/simtest.ctemask.auto	(revision 23478)
@@ -0,0 +1,39 @@
+
+automate MULTI
+
+# we run in the sequence BLOCK -> CHECK -> LAUNCH -> BLOCK -> CHECK
+# success on CHECK -> LAUNCH
+# failure on BLOCK -> CHECK
+
+# XXX these steps all refer to "@DBNAME@"; they need to be more generic, even for the basic simtest analysis
+
+automate METADATA
+  name       STR BIAS
+  check      STR "regtool -processedexp -exp_type BIAS -inst @CAMERA@ -dbname @DBNAME@"
+  ncheck     S32 5
+  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@"
+END
+
+automate METADATA
+  name       STR DARK
+  check      STR "detselect -search -inst @CAMERA@ -det_type BIAS -dbname @DBNAME@"
+  launch     STR "dettool -definebyquery -workdir file://@CWD@/detwork -inst @CAMERA@ -det_type DARK -select_exp_type DARK -dbname @DBNAME@"
+  block      STR "dettool -runs -active -det_type DARK -dbname @DBNAME@"
+END
+ 
+automate METADATA
+  name       STR SHUTTER
+  check      STR "detselect -search -inst @CAMERA@ -det_type DARK -dbname @DBNAME@"
+  launch     STR "dettool -definebyquery -workdir file://@CWD@/detwork -inst @CAMERA@ -det_type SHUTTER -filter r -select_exp_type FLAT -select_filter r -dbname @DBNAME@"
+  block      STR "dettool -runs -active -det_type SHUTTER -dbname @DBNAME@"
+END
+
+automate METADATA
+  name       STR FLAT-r
+  check      STR "detselect -search -inst @CAMERA@ -det_type SHUTTER -dbname @DBNAME@"
+  launch     STR "dettool -definebyquery -workdir file://@CWD@/detwork -inst @CAMERA@ -det_type FLAT -filter r -select_exp_type FLAT -select_filter r -dbname @DBNAME@"
+  block      STR "dettool -runs -active -det_type FLAT -filter r -dbname @DBNAME@"
+END
+
+# XXX let's build the necessary data, then see how to run the cte mask generation (input is flattened flats)
Index: trunk/ippTasks/simtest.ctemask.config
===================================================================
--- trunk/ippTasks/simtest.ctemask.config	(revision 23478)
+++ trunk/ippTasks/simtest.ctemask.config	(revision 23478)
@@ -0,0 +1,38 @@
+
+# very basic test to generate flats and test the CTE masking process
+# define the simulated data to be generated
+SEQUENCE MULTI
+
+SEQUENCE METADATA
+  OBSTYPE    STR BIAS
+  CAMERA     STR SIMTEST
+  NIMAGES    S32  5
+END
+
+SEQUENCE METADATA
+  OBSTYPE    STR DARK
+  CAMERA     STR SIMTEST
+  @EXPTIMES  F32  30.0, 300.0
+  @NIMAGES   S32  3,    3
+END
+
+SEQUENCE METADATA
+  OBSTYPE    STR FLAT
+  CAMERA     STR SIMTEST
+
+  FILTERS    STR r,r,r,r,r
+  @EXPTIMES  F32 0.5,1.0,2.0,5.0,10.0
+
+  NSETUP     S32 1
+END
+
+SEQUENCE METADATA
+  OBSTYPE    STR FLAT
+  CAMERA     STR SIMTEST
+
+  FILTERS    STR r
+  @EXPTIMES  F32 20.0
+
+  NSETUP     S32 7
+END
+
Index: trunk/ippTasks/simtest.pro
===================================================================
--- trunk/ippTasks/simtest.pro	(revision 23477)
+++ trunk/ippTasks/simtest.pro	(revision 23478)
@@ -45,4 +45,5 @@
     echo "  simtest.setup.detverify : run detrend creation and detrend verification"
     echo "  simtest.setup.flatcorr : run a flat-field correction demonstration"
+    echo "  simtest.setup.ctemask : run a ctemask demonstration"
     break
   end
@@ -126,4 +127,10 @@
 end
 
+macro simtest.setup.ctemask
+  $PPSIM_RECIPE = BADCTE.TEST
+  $SIMTEST_SEQUENCE = simtest.ctemask.config
+  $SIMTEST_AUTO = simtest.ctemask.auto
+end
+
 macro simtest.setup.flatcorr
   $PPSIM_RECIPE = FLATCORR
