Index: /trunk/ippScripts/scripts/detrend_process_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 10722)
+++ /trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 10723)
@@ -40,4 +40,5 @@
     and defined $camera;
 
+# XXX this exits with status = 0 on failure
 $ipprc->define_camera($camera);
 
Index: /trunk/ippTasks/detrend.norm.pro
===================================================================
--- /trunk/ippTasks/detrend.norm.pro	(revision 10722)
+++ /trunk/ippTasks/detrend.norm.pro	(revision 10723)
@@ -54,5 +54,6 @@
 
   task.exec
-    command      dettool -tonormalizedstat -simple -limit {$DetrendNormStatFail + 20}
+    # command      dettool -tonormalizedstat -simple -limit {$DetrendNormStatFail + 20}
+    command      dettool -tonormalizedstat -simple
   end
 
@@ -86,14 +87,10 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE) 
-      echo       "detrend.norm: failure"
-    end
-  end
-
-  # operation times out?
-  task.exit    timeout
-    if ($VERBOSE) 
-      echo       "detrend.norm: timeout"
-    end
+    showcommand failure
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
   end
 end
@@ -153,7 +150,5 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo "failure detrend_norm_calc.pl $options:0"
-    end
+    showcommand failure
     queuepush DetrendNormStat -replace -key 1:3 "FAIL $options:0"
     $DetrendNormStatFail ++
@@ -162,7 +157,5 @@
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE)
-      echo "failure detrend_norm_calc.pl $options:0"
-    end
+    showcommand timeout
     queuepush DetrendNormStat -replace -key 1:3 "TIMEOUT $options:0"
    $DetrendNormStatFail ++
@@ -184,5 +177,6 @@
 
   task.exec
-    command      dettool -tonormalize -simple -limit {$DetrendNormFail + 20}
+    # command      dettool -tonormalize -simple -limit {$DetrendNormFail + 20}
+    command      dettool -tonormalize -simple
   end
 
@@ -219,14 +213,10 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE) 
-      echo       "detrend.norm: failure"
-    end
-  end
-
-  # operation times out?
-  task.exit    timeout
-    if ($VERBOSE) 
-      echo       "detrend.norm: timeout"
-    end
+    showcommand failure
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
   end
 end
@@ -288,7 +278,5 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo "failure detrend_norm_apply.pl $options:0"
-    end
+    showcommand failure
     queuepush DetrendNorm -replace -key 4:5 "FAIL $options:0"
     $DetrendNormFail ++
@@ -297,7 +285,5 @@
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE)
-      echo "failure detrend_norm_apply.pl $options:0"
-    end
+    showcommand timeout
     queuepush DetrendNorm -replace -key 4:5 "TIMEOUT $options:0"
     $DetrendNormFail ++
@@ -319,5 +305,6 @@
 
   task.exec
-    command      dettool -tonormalizedexp -simple -limit {$DetrendNormExpFail + 20}
+    # command      dettool -tonormalizedexp -simple -limit {$DetrendNormExpFail + 20}
+    command      dettool -tonormalizedexp -simple
   end
 
@@ -344,5 +331,5 @@
       #$EXP_TYPE = $word:5
       #$IMFILES  = $word:6
-      queuepush DetrendNormalizeExp -uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $CAMERA"
+      queuepush DetrendNormExp -uniq -key 1:2 "NEW $DET_ID $ITER $DET_TYPE $CAMERA"
     end
 
@@ -354,14 +341,10 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE) 
-      echo       "detrend.norm: failure"
-    end
-  end
-
-  # operation times out?
-  task.exit    timeout
-    if ($VERBOSE) 
-      echo       "detrend.norm: timeout"
-    end
+    showcommand failure
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
   end
 end
@@ -425,18 +408,14 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo "failure detrend_norm_exp.pl $options:0"
-    end
+    showcommand failure
     queuepush DetrendNormExp -replace -key 1:2 "FAIL $options:0"
-   $DetrendNormExpFail ++
-  end
-
-  # operation times out?
-  task.exit    timeout
-    if ($VERBOSE)
-      echo "failure detrend_norm_exp.pl $options:0"
-    end
+    $DetrendNormExpFail ++
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
     queuepush DetrendNormExp -replace -key 1:2 "TIMEOUT $options:0"
-   $DetrendNormExpFail ++
-  end
-end
+    $DetrendNormExpFail ++
+  end
+end
Index: /trunk/ippTasks/detrend.process.pro
===================================================================
--- /trunk/ippTasks/detrend.process.pro	(revision 10722)
+++ /trunk/ippTasks/detrend.process.pro	(revision 10723)
@@ -57,5 +57,7 @@
 
   task.exec
-    command dettool -toprocessedimfile -simple -limit {$DetrendProcessImfileFail + 20}
+    # XXX dettool needs -limit command
+    # command dettool -toprocessedimfile -simple -limit {$DetrendProcessImfileFail + 20}
+    command dettool -toprocessedimfile -simple
   end
 
@@ -91,14 +93,10 @@
   # error
   task.exit    default
-    if ($VERBOSE) 
-      echo       "detrend.process: failure"
-    end
+    showcommand failure
   end
 
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE) 
-      echo       "detrend.process: timeout"
-    end
+    showcommand
   end
 end
@@ -166,7 +164,5 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo "failure detrend_process_imfile.pl $options:0"
-    end
+    showcommand failure
     queuepush DetrendProcessImfiles -replace -key 1:3:5 "FAIL $options:0"
     $DetrendProcessImfileFail ++
@@ -175,7 +171,5 @@
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE)
-      echo "timeout detrend_process_imfile.pl $options:0"
-    end
+    showcommand timeout
     queuepush DetrendProcessImfiles -replace -key 1:3:5 "TIMEOUT $options:0" 
     $DetrendProcessImfileFail ++
@@ -197,5 +191,6 @@
 
   task.exec
-    command dettool -toprocessedexp -simple -limit {$DetrendProcessExpFail + 20}
+    # command dettool -toprocessedexp -simple -limit {$DetrendProcessExpFail + 20}
+    command dettool -toprocessedexp -simple
   end
 
@@ -229,14 +224,10 @@
   # error
   task.exit    default
-    if ($VERBOSE)
-      echo       "detrend.process: failure"
-    end
+    showcommand failure
   end
 
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE)
-      echo       "detrend.process: timeout"
-    end
+    showcommand timeout
   end
 end
@@ -300,7 +291,5 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo "failure for detrend_process_exp.pl: $options:0"
-    end
+    showcommand failure
     queuepush DetrendProcessExposures -replace -key 1:2:4 "FAIL $options:0"
     $DetrendProcessExpFail ++
@@ -309,7 +298,5 @@
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE)
-      echo "failure for detrend_process_exp.pl: $options:0"
-    end
+    showcommand timeout
     queuepush DetrendProcessExposures -replace -key 1:2:4 "TIMEOUT $options:0"
     $DetrendProcessExpFail ++
Index: /trunk/ippTasks/detrend.reject.pro
===================================================================
--- /trunk/ippTasks/detrend.reject.pro	(revision 10722)
+++ /trunk/ippTasks/detrend.reject.pro	(revision 10723)
@@ -53,5 +53,6 @@
 
   task.exec
-    command dettool -residdetrun -simple -limit {$DetrendRejectExpFail + 20}
+    # command dettool -residdetrun -simple -limit {$DetrendRejectExpFail + 20}
+    command dettool -residdetrun -simple
   end
 
@@ -83,14 +84,10 @@
   # locked list
   task.exit    default
-    if ($VERBOSE) 
-      echo       "detrend.reject: failure"
-    end
+    showcommand failure
   end
 
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE) 
-      echo       "detrend.reject: timeout"
-    end
+    showcommand failure
   end
 end
@@ -123,5 +120,6 @@
     $ITER     = $word:1
     $DET_TYPE = $word:2
-    $CAMERA   = $word:3
+    $MODE     = $word:3
+    $CAMERA   = $word:4
 
     # I'd like to add CAMERA to the log file...
@@ -151,7 +149,5 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo "failure detrend_reject_exp.pl $options:0"
-    end
+    showcommand failure
     queuepush DetrendRejectExp -replace -key 1:2 "FAIL $options:0"
     $DetrendRejectExpFail ++
@@ -160,7 +156,5 @@
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE)
-      echo "failure detrend_reject_exp.pl $options:0"
-    end
+    showcommand failure
     queuepush DetrendRejectExp -replace -key 1:2 "TIMEOUT $options:0"
    $DetrendRejectExpFail ++
Index: /trunk/ippTasks/detrend.resid.pro
===================================================================
--- /trunk/ippTasks/detrend.resid.pro	(revision 10722)
+++ /trunk/ippTasks/detrend.resid.pro	(revision 10723)
@@ -58,5 +58,6 @@
 
   task.exec
-    command dettool -toresidimfile -simple -limit {$DetrendResidImfileFail + 20}
+    # command dettool -toresidimfile -simple -limit {$DetrendResidImfileFail + 20}
+    command dettool -toresidimfile -simple
   end
 
@@ -97,14 +98,10 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE) 
-      echo       "detrend.resid: failure"
-    end
+    showcommand failure
   end
 
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE) 
-      echo       "detrend.resid: timeout"
-    end
+    showcommand timeout
   end
 end
@@ -173,7 +170,5 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo "failure detrend_resid.pl $options:0"
-    end
+    showcommand failure
     queuepush DetrendResidImfiles -replace -key 1:2:5:6 "FAIL $options:0"
     $DetrendResidImfileFail ++
@@ -182,7 +177,5 @@
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE)
-      echo "failure detrend_resid.pl $options:0"
-    end
+    showcommand timeout
     queuepush DetrendResidImfiles -replace -key 1:2:6:6 "TIMEOUT $options:0"
     $DetrendResidImfileFail ++
@@ -204,5 +197,6 @@
 
   task.exec
-  command      dettool -toresidexp -simple -limit {$DetrendResidExpFail + 20}
+  # command      dettool -toresidexp -simple -limit {$DetrendResidExpFail + 20}
+  command      dettool -toresidexp -simple
   end
 
@@ -239,14 +233,10 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo       "detrend.residexp: failure"
-    end
+    showcommand failure
   end
 
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE)
-      echo       "detrend.residexp: timeout"
-    end
+    showcommand timeout
   end
 end
@@ -315,7 +305,5 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo "failure for detrend_reject_imfile.pl: $options:0"
-    end
+    showcommand failure
     queuepush DetrendResidExposures -replace -key 1:2:5 "FAIL $options:0"
     $DetrendResidExpFail ++
@@ -324,7 +312,5 @@
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE)
-      echo "failure for detrend_reject_imfile.pl: $options:0"
-    end
+    showcommand timeout
     queuepush DetrendResidExposures -replace -key 1:2:5 "TIMEOUT $options:0"
     $DetrendResidExpFail ++
Index: /trunk/ippTasks/detrend.stack.pro
===================================================================
--- /trunk/ippTasks/detrend.stack.pro	(revision 10722)
+++ /trunk/ippTasks/detrend.stack.pro	(revision 10723)
@@ -53,5 +53,6 @@
 
   task.exec
-    command dettool -tostacked -simple -limit {$DetrendStackClassFail + 20}
+    # command dettool -tostacked -simple -limit {$DetrendStackClassFail + 20}
+    command dettool -tostacked -simple
   end
 
@@ -83,14 +84,10 @@
   # locked list
   task.exit    default
-    if ($VERBOSE) 
-      echo       "detrend.stack: failure"
-    end
+    showcommand failure
   end
 
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE) 
-      echo       "detrend.stack: timeout"
-    end
+    showcommand timeout
   end
 end
@@ -153,7 +150,5 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo "failure detrend_stack.pl $options:0"
-    end
+    showcommand failure
    queuepush DetrendStackClass -replace -key 1:2:4 "FAIL $options:0"
    $DetrendStackClassFail ++
@@ -162,7 +157,5 @@
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE)
-      echo "failure detrend_stack.pl $options:0"
-    end
+    showcommand timeout
     queuepush DetrendStackClass -replace -key 1:2:4 "TIMEOUT $options:0"
     $DetrendStackClassFail ++
Index: /trunk/ippTasks/pantasks.pro
===================================================================
--- /trunk/ippTasks/pantasks.pro	(revision 10722)
+++ /trunk/ippTasks/pantasks.pro	(revision 10723)
@@ -7,5 +7,7 @@
 # $scripts = $HOME/src/pantasks/ipp/ippTasks
 $scripts = .
-$LOGDIR = `ipp_datapath.pl path://ESSENCE`
+# $LOGDIR = `ipp_datapath.pl path://ESSENCE`
+$LOGDIR = `ipp_datapath.pl path://SIMTEST`
+
 $LOGDIR = $LOGDIR/logs
 exec mkdir -p $LOGDIR
@@ -19,9 +21,10 @@
   if ($parallel) 
     controller exit true
-    controller host add sn2
-    controller host add sn3
-    controller host add sn4
-    controller host add sn5
-#   controller host add sn6
+    controller host add alala
+#    controller host add sn2
+#    controller host add sn3
+#    controller host add sn4
+#    controller host add sn5
+#    controller host add sn6
 # sn7 serves the disk
   end
@@ -31,12 +34,12 @@
 
 macro load.tasks
-  input $scripts/phase0.pro
+#  input $scripts/phase0.pro
 #  input $scripts/phase2.pro
 #  input $scripts/phase3.pro
-#  input $scripts/detrend.process.pro
-#  input $scripts/detrend.stack.pro
-#  input $scripts/detrend.norm.pro
-#  input $scripts/detrend.resid.pro
-#  input $scripts/detrend.reject.pro
+  input $scripts/detrend.process.pro
+  input $scripts/detrend.stack.pro
+  input $scripts/detrend.norm.pro
+  input $scripts/detrend.resid.pro
+  input $scripts/detrend.reject.pro
 end
 
@@ -108,2 +111,18 @@
   exec rm -f ../object/*.p3.*.jpg
 end
+
+macro showcommand
+  local n 
+
+  if ($VERBOSE)
+    $command = $taskarg:0
+    for n 1 $taskarg:n
+      $command = $command $taskarg:$n
+    end
+    if ($0 == 2)
+      echo "$1 for: $command"
+    else
+      echo "command: $command"
+    end    
+  end
+end
Index: /trunk/ippTasks/phase0.pro
===================================================================
--- /trunk/ippTasks/phase0.pro	(revision 10722)
+++ /trunk/ippTasks/phase0.pro	(revision 10723)
@@ -79,14 +79,10 @@
   # locked list
   task.exit    default
-    if ($VERBOSE) 
-      echo "phase0 pending imfiles: failure"
-    end
-  end
-
-  # operation times out?
-  task.exit    timeout
-    if ($VERBOSE)
-      echo "phase0 pending imfiles: timeout"
-    end
+    showcommand
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand
   end
 end
@@ -153,7 +149,5 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo "failure for phase0imfile.pl: $options:0"
-    end
+    showcommand
     queuepush Phase0Imfiles -replace -key 1 "FAIL $options:0"
     $Phase0ImfileFail ++
@@ -162,7 +156,5 @@
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE)
-      echo "timeout for phase0imfile.pl: $options:0"
-    end
+    showcommand
     queuepush Phase0Imfiles -replace -key 1 "TIMEOUT $options:0"
     $Phase0ImfileFail ++
@@ -222,14 +214,10 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo       "phase0 pending exp: failure"
-    end
-  end
-
-  # operation times out?
-  task.exit    timeout
-    if ($VERBOSE)
-      echo       "phase0 pending exp: timeout"
-    end
+    showcommand
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand
   end
 end
@@ -293,7 +281,5 @@
   # default exit status
   task.exit    default
-    if ($VERBOSE)
-      echo "failure for phase0exp.pl: $options:0"
-    end
+    showcommand
     queuepush Phase0Exposures -replace -key 1 "FAIL $options:0"
     $Phase0ExpFail
@@ -302,7 +288,5 @@
   # operation times out?
   task.exit    timeout
-    if ($VERBOSE)
-      echo "failure for phase0exp.pl: $options:0"
-    end
+    showcommand
     queuepush Phase0Exposures -replace -key 1 "TIMEOUT $options:0"
     $Phase0ExpFail
Index: /trunk/ippTasks/testscript.pro
===================================================================
--- /trunk/ippTasks/testscript.pro	(revision 10722)
+++ /trunk/ippTasks/testscript.pro	(revision 10723)
@@ -7,8 +7,5 @@
 
   status
-  host add sn2
-  host add sn3
-  host add sn4
-  host add sn5
+  host add alala
 
   status
Index: /trunk/ippconfig/ipprc.config
===================================================================
--- /trunk/ippconfig/ipprc.config	(revision 10722)
+++ /trunk/ippconfig/ipprc.config	(revision 10723)
@@ -8,4 +8,6 @@
 	PAP_MC	STR	/data/alala/price/megacam/
 	ESSENCE	STR	/data/sn7/ipp/
+	ISPTEST	STR	/data/alala/eugene/swtests/pantasks/isp
+	SIMTEST	STR	/data/alala/eugene/swtests/pantasks/sim
 END
 
@@ -58,3 +60,2 @@
 	PPSTATS_PHASE0	STR		recipes/ppStats_phase0.config	# Image statistics for Phase 0
 END
-
Index: /trunk/ippconfig/isp/format.config
===================================================================
--- /trunk/ippconfig/isp/format.config	(revision 10722)
+++ /trunk/ippconfig/isp/format.config	(revision 10723)
@@ -33,4 +33,6 @@
 # How to translate PS concepts into FITS headers
 TRANSLATION	METADATA
+	FPA.TELESCOPE	STR	TELESCOP
+	FPA.INSTRUMENT	STR	INSTRUME
 	FPA.OBSTYPE	STR	OBSTYPE
 	FPA.OBJECT	STR	OBSTYPE
Index: /trunk/ippconfig/megacam_detrended/psphot.config
===================================================================
--- /trunk/ippconfig/megacam_detrended/psphot.config	(revision 10722)
+++ /trunk/ippconfig/megacam_detrended/psphot.config	(revision 10723)
@@ -3,12 +3,8 @@
 #SAVE.BACKGND	BOOL 	TRUE
 #SAVE.BACKSUB	BOOL 	TRUE
-#SAVE.RESID	BOOL 	TRUE
+SAVE.RESID	BOOL 	TRUE
 #SAVE.PSF	BOOL 	TRUE
 #LOAD.PSF	BOOL 	FALSE
-
-# image noise parameters
-RDNOISE             STR  HD:RDNOISE      # read-noise in electrons
-GAIN                STR  HD:GAIN         # electrons / DN
-ZERO_POINT          F32  25.000          # zero point used by DVO
+SAVE.PLOTS      BOOL    TRUE
 
 # background model : 
@@ -17,17 +13,16 @@
 
 # masking parameters
-XMIN                F32   +50        	 # minimum valid x-coord
-XMAX                F32   -50        	 # maximum valid x-coord
-YMIN                F32   +50        	 # minimum valid y-coord
-YMAX                F32   -50        	 # maximum valid y-coord
+XMIN                F32   +0        	 # minimum valid x-coord
+XMAX                F32   -0        	 # maximum valid x-coord
+YMIN                F32   +0        	 # minimum valid y-coord
+YMAX                F32   -0        	 # maximum valid y-coord
 SATURATION          F32  50000     	 # saturation level on this chip
-MIN_VALID_PIXEL     F32      1     	 # saturation level on this chip
 
 # image statistics parameters
-IMSTATS_NPIX        S32  1000    	 # number of pixels to use for sky estimate boxes:
+IMSTATS_NPIX        S32  10000    	 # number of pixels to use for sky estimate boxes:
+SKY_HISTOGRAM_BINS  F32  1
+SKY_STAT            STR  FITTED_MEAN_V2  # statistic used to measure background
 
 # peak finding 
-PEAKS_SMOOTH_SIGMA  F32  1.0       	 # smoothing kernel sigma in pixels
-PEAKS_SMOOTH_NSIGMA F32  3.0   	   	 # smoothing kernel width in sigmas
 PEAKS_NSIGMA_LIMIT  F32  25.0 	   	 # peak significance threshold
 
@@ -39,17 +34,6 @@
 PSF_MAX_NSTARS      S32  300             # limit number of stars used for PSF model
 
-# PSF model parameters : choose the PSF model
-# list as many PSF_MODEL options as desired
-# PSF_MODEL           MULTI
+# PSF model options
 PSF_MODEL           STR  PS_MODEL_QGAUSS
-# PSF_MODEL           STR  PS_MODEL_GAUSS
-# PSF_MODEL           STR  PS_MODEL_PGAUSS
-# PSF_MODEL           STR  PS_MODEL_TGAUSS  ## not well tested, not very successful
-
-MOMENTS_SCALE       F32   0.1
-MOMENTS_SN_MIN      F32   30.0
-MOMENTS_SX_MAX      F32   3.0
-MOMENTS_SY_MAX      F32   3.0
-MOMENTS_AR_MAX      F32   1.5		 # maximum axial ratio: 1 / AR < (sx / sy) < AR
 
 PSF_FIT_RADIUS      F32  15.0	         # fitting radius for test PSF model
@@ -58,5 +42,5 @@
 # PSF-like source model parameters
 PSF_FIT_NSIGMA       F32  1.0		 # significance for pixel included in fit
-PSF_FIT_PADDING      F32  5.0            # extra annulus to use for fit 
+PSF_FIT_PADDING      F32  2.0            # extra annulus to use for fit 
 PSF_SHAPE_NSIGMA     F32  3.0		 # max significance for shape variation
 PSF_MIN_SN           F32  2.0		 # reject objects below this significance
@@ -74,17 +58,6 @@
 DEBLEND_SKY_NSIGMA      F32 10.0
 
-# APTREND 	     STR CONSTANT
-APTREND 	     STR  ALL
-# APTREND 	     STR  SKYSAT_XY_LIN
-# APTREND 	     STR  SKYSAT
-# APTREND 	     STR  SKYBIAS
+APTREND 	     STR CONSTANT
 FULL_FIT_SN_LIM      F32  200.0
 AP_MIN_SN            F32  50.0
 
-# test options
-# BREAK_POINT         STR  PEAKS
-# PEAKS_OUTPUT_FILE   STR  peaks.dat
-# MOMENTS_OUTPUT_FILE STR  moments.dat
-# ANALYSIS_REGION     STR  [100:2000,100:4500]
-# POISSON_ERRORS      BOOL TRUE
-# SKY_BIAS            F32  0.0
Index: /trunk/ippconfig/recipes/psphot.config
===================================================================
--- /trunk/ippconfig/recipes/psphot.config	(revision 10722)
+++ /trunk/ippconfig/recipes/psphot.config	(revision 10723)
@@ -26,9 +26,9 @@
 
 # masking parameters (XXX EAM : rework this to use psRegion like ANALYSIS_REGION)
-XMIN                F32   2        	 # minimum valid x-coord
-XMAX                F32   -2        	 # maximum valid x-coord
-YMIN                F32   2        	 # minimum valid y-coord
-YMAX                F32   -2        	 # maximum valid y-coord
-SATURATION          F32  50000     	 # saturation level on this chip
+XMIN                F32   0        	 # minimum valid x-coord
+XMAX                F32   0        	 # maximum valid x-coord
+YMIN                F32   0        	 # minimum valid y-coord
+YMAX                F32   0        	 # maximum valid y-coord
+SATURATION          F32   64000     	 # saturation level on this chip
 
 # peak finding 
Index: /trunk/ippconfig/simple/camera.config
===================================================================
--- /trunk/ippconfig/simple/camera.config	(revision 10722)
+++ /trunk/ippconfig/simple/camera.config	(revision 10723)
@@ -6,5 +6,4 @@
 END
  
- 
 # Description of camera --- all the chips and the cells that comprise them
 FPA     METADATA
@@ -12,12 +11,47 @@
 END
 
+# move this elsewhere?  we need a lookup table to go from filter ID to abstract name
+FILTER.ID       METADATA
+   Test.V STR V
+   Test.B STR B
+END
+
 # Recipe options
 RECIPES		METADATA
-#	PHASE2		STR	simple/phase2.config		# Phase 2 recipe details
-	PSPHOT		STR	simple/psphot.config		# psphot details
-	PSPHOT_ALT	STR	simple/psphot_alt.config	# psphot details
-#	PSASTRO		STR	simple/psastro.config		# psastro details
+        PPIMAGE         STR     simple/ppImage.config   # Default: all (normal) options on
+	PSPHOT		STR	simple/psphot.config	# psphot details
 END
 
+# Rejection levels for detrend creation
+REJECTION	METADATA
+	TYPE	LIMITS	FILTER	EXPECTED	IMFILE.MEAN	IMFILE.STDEV	EXP.MEAN	EXP.STDEV	EXP.MEANSTDEV	ENSEMBLE.MEAN	ENSEMBLE.STDEV	ENSEMBLE.MEANSTDEV	IMFILE.SN	EXP.SN	IMFILE.MEANSTDEV
+	FLAT	MULTI
+
+	BIAS	LIMITS	*	0		1		4		0.5		4		0		3		4		0			0		0	0.5
+	DARK	LIMITS	*	0		1		4		0.5		4		0		3		4		0			0		0	0.5
+	FLAT	LIMITS	*	0		0		0		0		0		0		0		0		3			0		0	0
+#	FLAT	LIMITS	u	0		0		0		0		0		0		0		0		3			0		0	0
+#	FLAT	LIMITS	g	0		0		0		0		0		0		0		0		3			0		0	0
+#	FLAT	LIMITS	r	0		0		0		0		0		0		0		0		3			0		0	0
+#	FLAT	LIMITS	i	0		0		0		0		0		0		0		0		3			0		0	0
+#	FLAT	LIMITS	z	0		0		0		0		0		0		0		0		3			0		0	0
+	FRINGE	LIMITS	*	0		0		0		0		0		0		0		0		0			0		0	0
+
+# FILTER is an additional qualifier, and may be "*" (or absent!), in which case it matches everything
+# EXPECTED is the expected mean value
+# IMFILE.MEAN is the maximum permitted mean value for an imfile, relative to the standard deviation
+# IMFILE.STDEV is the maximum permitted standard deviation for an imfile
+# EXP.MEAN is the maximum permitted mean value for an exposure, relative to the standard deviation
+# EXP.STDEV is the maximum permitted standard deviation for an exposure
+# EXP.MEANSTDEV is the maximum permitted mean standard deviation for an exposure relative to the mean
+# ENSEMBLE.MEAN is the maximum permitted mean for an ensemble of exposures
+# ENSEMBLE.STDEV is the maximum permitted standard deviation for an ensemble of exposures
+# ENSEMBLE.MEANSTDEV is the maximum permitted mean standard deviation for an ensemble of exposures
+# IMFILE.SN is the minimum permitted signal-to-noise for an imfile
+# EXP.SN is the minimum permitted signal-to-noise for an exposure
+# These values (all except FILTER) may be zero, in which case no clipping is applied.
+
+END
+		
 FILERULES METADATA
    PSASTRO.INPUT      STR PSASTRO.INPUT.CMP
@@ -29,8 +63,8 @@
    PPIMAGE.INPUT      INPUT    none.fits                     NONE          NONE         NONE         IMAGE     FPA        
 
-   PPIMAGE.BIAS       INPUT    bias.fits                     NONE          NONE         NONE         IMAGE     CHIP       
-   PPIMAGE.DARK       INPUT    dark.fits                     NONE          NONE         NONE         IMAGE     CHIP       
-   PPIMAGE.FLAT       INPUT    flat.fits                     NONE          NONE         NONE         IMAGE     CHIP       
-   PPIMAGE.MASK       INPUT    mask.fits                     NONE          NONE         NONE         IMAGE     CHIP       
+   PPIMAGE.BIAS       INPUT    @DETDB                        NONE         fpa           NONE         IMAGE     CHIP       
+   PPIMAGE.DARK       INPUT    @DETDB                        NONE         fpa           NONE         IMAGE     CHIP       
+   PPIMAGE.FLAT       INPUT    @DETDB                        NONE         fpa           NONE         IMAGE     CHIP       
+   PPIMAGE.MASK       INPUT    @DETDB                        NONE         fpa           NONE         IMAGE     CHIP       
 
    PSPHOT.INPUT       INPUT    none.fits                     NONE          NONE         NONE         IMAGE     CHIP       
@@ -38,17 +72,19 @@
    PSASTRO.INPUT.CMP  INPUT    none.fits                     NONE          NONE         PHU          CMP       CHIP       
    PSASTRO.INPUT.CMF  INPUT    none.fits                     NONE          SMPDATA      PHU          CMF       CHIP       
-   PSPHOT.PSF.LOAD    INPUT   {OUTPUT}.psf       NONE          NONE         NONE         PSF       FPA        FPA        TRUE      NONE
+   PSPHOT.PSF.LOAD    INPUT   {OUTPUT}.psf                   NONE          NONE         NONE         PSF       CHIP
 
    ### output file definitions
    TYPE                OUTPUT   FILENAME.RULE      FILENAME.XTRA EXTNAME.RULE EXTNAME.XTRA FILE.TYPE FILE.LEVEL DATA.LEVEL FILE.SAVE FILE.FORMAT
    PPIMAGE.OUTPUT      OUTPUT   {OUTPUT}.fit       NONE   	 NONE         NONE         IMAGE     FPA        FPA        TRUE      NONE
+   PPIMAGE.OUTPUT.MASK OUTPUT   {OUTPUT}.mask.fits NONE          NONE         NONE         MASK      FPA        FPA        FALSE     NONE
+   PPIMAGE.OUTPUT.WEIGHT OUTPUT {OUTPUT}.wt.fits   NONE          NONE         NONE         WEIGHT    FPA        FPA        FALSE     NONE
    PPIMAGE.OUTPUT.CHIP OUTPUT 	{OUTPUT}.ch.fit    NONE   	 NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
    PPIMAGE.OUTPUT.FPA1 OUTPUT 	{OUTPUT}.b1.fit    NONE   	 NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
    PPIMAGE.OUTPUT.FPA2 OUTPUT 	{OUTPUT}.b2.fit    NONE   	 NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
 
-   PPIMAGE.BIN1        OUTPUT   {OUTPUT}.B1.fit    NONE          NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
-   PPIMAGE.BIN2        OUTPUT   {OUTPUT}.B2.fit    NONE          NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
    PPIMAGE.JPEG1       OUTPUT   {OUTPUT}.b1.jpg    -greyscale    RANGE        -5:20        JPEG      FPA        FPA        TRUE      SIMPLE
    PPIMAGE.JPEG2       OUTPUT   {OUTPUT}.b2.jpg    -greyscale    FRACTION     0.50:2.00    JPEG      FPA        FPA        TRUE      SIMPLE
+   PPIMAGE.BIN1        OUTPUT   {OUTPUT}.b1.fit    NONE          NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
+   PPIMAGE.BIN2        OUTPUT   {OUTPUT}.b2.fit    NONE          NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
 
    PSPHOT.RESID        OUTPUT   {OUTPUT}.res.fits  NONE          NONE         NONE         IMAGE     FPA        FPA        TRUE      SIMPLE
Index: /trunk/ippconfig/simple/format.config
===================================================================
--- /trunk/ippconfig/simple/format.config	(revision 10722)
+++ /trunk/ippconfig/simple/format.config	(revision 10723)
@@ -20,8 +20,9 @@
 CELLS	METADATA
 	amplifier	METADATA
+		CELL.TRIMSEC.SOURCE	STR	VALUE
+		CELL.TRIMSEC		STR	[0:0,0:0]
+		# alternatives for getting these from the headers
 		# CELL.TRIMSEC.SOURCE	STR	HEADER
-		CELL.TRIMSEC.SOURCE	STR	VALUE
 		# CELL.BIASSEC.SOURCE	STR	VALUE
-		CELL.TRIMSEC		STR	[0:0,0:0]
 		# CELL.TRIMSEC		STR	DATASEC
 		# CELL.BIASSEC		STR	BIASSEC
@@ -31,9 +32,15 @@
 # How to translate PS concepts into FITS headers
 TRANSLATION	METADATA
+	FPA.TELESCOPE	STR	TELESCOP
+	FPA.INSTRUMENT	STR	INSTRUME
+	FPA.OBSTYPE	STR	OBSTYPE
 	FPA.AIRMASS	STR	AIRMASS
 	FPA.FILTER	STR	FILTER
-	FPA.POSANGLE	STR	POSANG
-	FPA.RA		STR	OBJ-RA
-	FPA.DEC		STR	OBJ-DEC
+	FPA.POSANGLE	STR	POSANGLE
+	FPA.RA		STR	RA
+	FPA.DEC		STR	DEC
+	FPA.OBJECT	STR	OBJECT
+	FPA.TIMESYS	STR	UTC
+	FPA.TIME	STR	DATE-OBS UTC-OBS	# Date and time
 	CELL.EXPOSURE	STR	EXPTIME
 	CELL.DARKTIME	STR	DARKTIME
@@ -46,4 +53,5 @@
 # Default PS concepts that may be specified by value
 DEFAULTS	METADATA
+	FPA.TIMESYS	STR	UTC
 	FPA.RADECSYS	STR	ICRS
 	CELL.GAIN	F32	1.0
@@ -62,3 +70,4 @@
 	FPA.RA		STR	HOURS
 	FPA.DEC		STR	DEGREES
+	FPA.TIME	STR	YEAR.FIRST
 END
Index: /trunk/ippconfig/simple/psphot.config
===================================================================
--- /trunk/ippconfig/simple/psphot.config	(revision 10722)
+++ /trunk/ippconfig/simple/psphot.config	(revision 10723)
@@ -3,5 +3,6 @@
 SAVE.BACKGND	BOOL 	TRUE
 SAVE.BACKSUB	BOOL 	TRUE
-SAVE.RESID	BOOL 	FALSE
+SAVE.PLOTS      BOOL    TRUE
+SAVE.RESID	BOOL 	TRUE
 SAVE.PSF	BOOL 	FALSE
 LOAD.PSF	BOOL 	FALSE
