Index: branches/czw_branch/20100427/ippTasks/camera.pro
===================================================================
--- branches/czw_branch/20100427/ippTasks/camera.pro	(revision 27784)
+++ branches/czw_branch/20100427/ippTasks/camera.pro	(revision 28017)
@@ -154,4 +154,5 @@
     book getword camPendingExp $pageName cam_id -var CAM_ID
     book getword camPendingExp $pageName workdir -var WORKDIR_TEMPLATE
+    book getword camPendingExp $pageName path_base -var PATH_BASE
     book getword camPendingExp $pageName dvodb  -var DVODB
     book getword camPendingExp $pageName dbname -var DBNAME
@@ -173,6 +174,10 @@
     # neb:///ipp004-vol0/gpc1/20080130
 
-    ## generate outroot specific to this exposure (& chip)
-    sprintf outroot "%s/%s/%s.cm.%s" $WORKDIR $EXP_TAG $EXP_TAG $CAM_ID
+    if ("$PATH_BASE" == "NULL") 
+        ## generate outroot specific to this exposure (& chip)
+        sprintf outroot "%s/%s/%s.cm.%s" $WORKDIR $EXP_TAG $EXP_TAG $CAM_ID
+    else
+        $outroot = $PATH_BASE
+    end
 
     stdout $LOGDIR/camera.exp.log
Index: branches/czw_branch/20100427/ippTasks/chip.pro
===================================================================
--- branches/czw_branch/20100427/ippTasks/chip.pro	(revision 27784)
+++ branches/czw_branch/20100427/ippTasks/chip.pro	(revision 28017)
@@ -153,4 +153,5 @@
     book getword chipPendingImfile $pageName reduction -var REDUCTION
     book getword chipPendingImfile $pageName state -var RUN_STATE
+    book getword chipPendingImfile $pageName path_base -var PATH_BASE
 
     if ($RAW_MAGICKED > 0)
@@ -174,6 +175,10 @@
     # neb:///ipp004-vol0/gpc1/20080130
 
-    ## generate outroot specific to this exposure (& chip)
-    sprintf outroot "%s/%s/%s.ch.%s" $WORKDIR $EXP_TAG $EXP_TAG $CHIP_ID
+    if ("$PATH_BASE" == "NULL") 
+        ## generate outroot specific to this exposure (& chip)
+        sprintf outroot "%s/%s/%s.ch.%s" $WORKDIR $EXP_TAG $EXP_TAG $CHIP_ID
+    else
+        $outroot = $PATH_BASE
+    end
 
     stdout $LOGDIR/chip.imfile.log
Index: branches/czw_branch/20100427/ippTasks/destreak.pro
===================================================================
--- branches/czw_branch/20100427/ippTasks/destreak.pro	(revision 27784)
+++ branches/czw_branch/20100427/ippTasks/destreak.pro	(revision 28017)
@@ -37,4 +37,6 @@
     echo magicDSToRevert
     book listbook magicDSToRevert
+    echo magicDSToCleanup
+    book listbook magicDSToCleanup
 end
 
@@ -212,4 +214,5 @@
     book getword magicToDS $pageName recoveryroot -var RECROOT
     book getword magicToDS $pageName re_place -var REPLACE
+    book getword magicToDS $pageName magicked -var MAGICKED
     book getword magicToDS $pageName dbname -var DBNAME
 
@@ -226,5 +229,5 @@
     # TODO: do not add recoveryroot or replace if they are null or zero
 
-    $run = magic_destreak.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --exp_id $EXP_ID --streaks $STREAKS --inv_streaks $INV_STREAKS --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --uri $URI --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $OUTROOT --logfile $logfile --recoveryroot $RECROOT --replace $REPLACE
+    $run = magic_destreak.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --exp_id $EXP_ID --streaks $STREAKS --inv_streaks $INV_STREAKS --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --uri $URI --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $OUTROOT --logfile $logfile --recoveryroot $RECROOT --replace $REPLACE --magicked $MAGICKED
 
     add_standard_args run
@@ -412,4 +415,5 @@
     book getword magicDSToRevert $pageName re_place -var REPLACE
     book getword magicDSToRevert $pageName bothways -var BOTHWAYS
+    book getword magicDSToRevert $pageName magicked -var MAGICKED
     book getword magicDSToRevert $pageName dbname -var DBNAME
 
@@ -424,5 +428,5 @@
     end
 
-    $run = magic_destreak_revert.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $OUTROOT --logfile $logfile --replace $REPLACE --bothways $BOTHWAYS
+    $run = magic_destreak_revert.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $OUTROOT --logfile $logfile --replace $REPLACE --bothways $BOTHWAYS --magicked $MAGICKED
 
     add_standard_args run
Index: branches/czw_branch/20100427/ippTasks/diff.pro
===================================================================
--- branches/czw_branch/20100427/ippTasks/diff.pro	(revision 27784)
+++ branches/czw_branch/20100427/ippTasks/diff.pro	(revision 28017)
@@ -184,4 +184,5 @@
     book getword diffSkyfile $pageName reduction -var REDUCTION
     book getword diffSkyfile $pageName diff_mode -var DIFF_MODE
+    book getword diffSkyfile $pageName path_base -var PATH_BASE
 
     # set the host and workdir based on the skycell hash
@@ -207,5 +208,10 @@
 
     basename $TESS_DIR -var TESS_ID
-    sprintf outroot "%s/%s/%s/%s.%s.%sdif.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $DIFF_TAG $DIFF_ID
+
+    if ("$PATH_BASE" == "NULL")
+        sprintf outroot "%s/%s/%s/%s.%s.%sdif.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $DIFF_TAG $DIFF_ID
+    else
+        $outroot = $PATH_BASE
+    end
 
     stdout $LOGDIR/diff.skycell.log
Index: branches/czw_branch/20100427/ippTasks/nightly_stacks.pro
===================================================================
--- branches/czw_branch/20100427/ippTasks/nightly_stacks.pro	(revision 27784)
+++ branches/czw_branch/20100427/ippTasks/nightly_stacks.pro	(revision 28017)
@@ -164,10 +164,12 @@
 
   task.exec
+    stdout $LOGDIR/ns.initday.log
+    stderr $LOGDIR/ns.initday.log
     $today = `date +%Y-%m-%d`
     book newpage nsData $today
     book setword nsData $today nsState NEW
 
-    command echo $today
-#   command automate_stacks.pl --clean_old --date $today
+#    command echo $today
+   command automate_stacks.pl --clean_old --date $today
   end
 
Index: branches/czw_branch/20100427/ippTasks/pstamp.pro
===================================================================
--- branches/czw_branch/20100427/ippTasks/pstamp.pro	(revision 27784)
+++ branches/czw_branch/20100427/ippTasks/pstamp.pro	(revision 28017)
@@ -14,4 +14,5 @@
 $pstampRev_DB = 0
 $pstampDep_DB = 0
+$pstampCleanup_DB = 0
 
 # set PS_DBSERVER if postage stamp database host is not the same as the value for DBSERVER in site.config
@@ -30,4 +31,5 @@
     book init pstampFinish
     book init pstampDependent
+    book init pstampCleanup
 end
 
@@ -58,7 +60,4 @@
         active true
     end
-    task pstamp.job.revert
-        active true
-    end
     task pstamp.dependent.load
         active true
@@ -94,5 +93,8 @@
     end
     task pstamp.dependent.load
-        active true
+        active false
+    end
+    task pstamp.dependent.run
+        active false
     end
 end
@@ -105,4 +107,20 @@
 macro pstamp.revert.off
     task pstamp.job.revert
+        active false
+    end
+end
+macro pstamp.cleanup.on
+    task pstamp.cleanup.load
+        active true
+    end
+    task pstamp.cleanup.run
+        active true
+    end
+end
+macro pstamp.cleanup.off
+    task pstamp.cleanup.run
+        active false
+    end
+    task pstamp.cleanup.run
         active false
     end
@@ -157,5 +175,5 @@
 
     task.exec
-        stdout $LOGSUBDIR/pstamp.request.load.log
+        stdout NULL
         stderr $LOGSUBDIR/pstamp.request.load.log
         $run = pstamptool -pendingreq
@@ -202,5 +220,5 @@
 
     task.exec
-        stdout $LOGSUBDIR/pstamp.request.run.log
+        stdout NULL
         stderr $LOGSUBDIR/pstamp.request.run.log
         book npages pstampRequest -var N
@@ -215,9 +233,10 @@
         book getword pstampRequest $pageName uri -var URI
         book getword pstampRequest $pageName ds_outProduct -var PRODUCT
+        book getword pstampRequest $pageName outdir -var OUTDIR
         book getword pstampRequest $pageName label -var LABEL
 
         host anyhost
 
-        $run = pstamp_parser_run.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --label $LABEL --redirect-output
+        $run = pstamp_parser_run.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --outdir $OUTDIR --label $LABEL --redirect-output
 
         add_standard_args run
@@ -260,5 +279,5 @@
 
     task.exec
-        stdout $LOGSUBDIR/pstamp.finish.load.log
+        stdout NULL
         stderr $LOGSUBDIR/pstamp.finish.load.log
         $run = pstamptool  -completedreq
@@ -305,5 +324,5 @@
 
     task.exec
-        stdout $LOGSUBDIR/request.finish.run.log
+        stdout NULL
         stderr $LOGSUBDIR/request.finish.run.log
         book npages pstampFinish -var N
@@ -320,6 +339,7 @@
         book getword pstampFinish $pageName name -var REQ_NAME
         book getword pstampFinish $pageName outProduct -var PRODUCT
-
-        $run = request_finish.pl --req_id $REQ_ID --req_type $REQ_TYPE --req_file $URI --req_name $REQ_NAME --product $PRODUCT --redirect-output
+        book getword pstampFinish $pageName outdir -var OUTDIR
+
+        $run = request_finish.pl --req_id $REQ_ID --req_type $REQ_TYPE --req_file $URI --req_name $REQ_NAME --product $PRODUCT --outdir $OUTDIR --redirect-output
 
         add_standard_args run
@@ -362,5 +382,5 @@
 
     task.exec
-        stdout $LOGSUBDIR/pstamp.job.load.log
+        stdout NULL
         stderr $LOGSUBDIR/pstamp.job.load.log
         $run = pstamptool -pendingjob
@@ -410,5 +430,5 @@
 
     task.exec
-        stdout $LOGSUBDIR/pstamp.job.run.log
+        stdout NULL
         stderr $LOGSUBDIR/pstamp.job.run.log
         book npages pstampJob -var N
@@ -488,5 +508,5 @@
 
     task.exec
-        stdout $LOGSUBDIR/pstamp.job.revert.log
+        stdout NULL
         stderr $LOGSUBDIR/pstamp.job.revert.log
         $run = pstamptool -revertjob -all
@@ -524,12 +544,12 @@
 
     periods     -poll $LOADPOLL
-    # XXX: create a macro for this
-    periods     -exec 30
+    # XXX: create a macro for this time
+    periods     -exec 10
 #    periods     -exec $LOADEXEC
-    periods     -timeout 30
+    periods     -timeout 300
     npending    1
 
     task.exec
-        stdout $LOGSUBDIR/pstamp.dependent.load.log
+        stdout NULL
         stderr $LOGSUBDIR/pstamp.dependent.load.log
         $run = pstamptool -pendingdependent
@@ -579,6 +599,4 @@
 
     task.exec
-#        stdout $LOGSUBDIR/pstamp.dependent.run.log
-#        stderr $LOGSUBDIR/pstamp.dependent.run.log
         book npages pstampDependent -var N
         if ($N == 0) 
@@ -590,6 +608,4 @@
         book getpage pstampDependent 0 -var pageName -key pantaskState INIT
         if ("$pageName" == "NULL") break
-
-        #echo pageName: $pageName
 
         book setword pstampDependent $pageName pantaskState RUN
@@ -601,5 +617,5 @@
         book getword pstampDependent $pageName imagedb    -var IMAGEDB
         book getword pstampDependent $pageName rlabel     -var RLABEL
-#        book getword pstampDependent $pageName output_base -var OUTPUT_BASE
+        book getword pstampDependent $pageName outdir     -var OUTDIR
         book getword pstampDependent $pageName need_magic -var NEED_MAGIC
         book getword pstampDependent $pageName dbname     -var DBNAME
@@ -617,11 +633,10 @@
         end
 
-        # XXX: use OUTPUT_BASE for this
-        $LOGFILE = /data/ipp053.0/home/bills/pstamp/logs/pstampdep.$DEP_ID.log
-#        echo logfile is $LOGFILE
-#        stdout $LOGFILE
-#        stderr $LOGFILE
+        $MYLOGFILE = $OUTDIR/checkdep.$DEP_ID.log
+        stdout $MYLOGFILE
+        stderr $MYLOGFILE
 
         $run = pstamp_checkdependent.pl --dep_id $DEP_ID --stage_id $STAGE_ID --stage $STAGE --component $COMPONENT --imagedb $IMAGEDB --rlabel $RLABEL $NEED_MAGIC
+
         add_standard_args run
 
@@ -664,2 +679,118 @@
 end
 
+task pstamp.cleanup.load
+    host        local
+
+    periods     -poll $LOADPOLL
+    periods     -exec $LOADEXEC
+    periods     -timeout 300
+    npending    1
+
+    task.exec
+        stdout NULL
+        stderr $LOGSUBDIR/pstamp.cleanup.load.log
+        $run = pstamptool -pendingcleanup
+        if ($DB:n == 0)
+            option DEFAULT
+        else 
+            option $DB:$pstampCleanup_DB
+            $run = $run $PS_DBSERVER -dbname $DB:$pstampCleanup_DB
+            $pstampCleanup_DB ++
+            if ($pstampCleanup_DB >= $DB:n) set pstampCleanup_DB = 0
+        end
+        add_poll_args run
+        add_poll_labels run
+        command $run
+    end
+
+    task.exit $EXIT_SUCCESS
+        ipptool2book stdout pstampCleanup -key req_id -uniq -setword dbname $options:0 -setword pantaskState INIT
+        if ($VERBOSE > 2)
+            echo starting request
+            book listbook pstampCleanup
+        end
+
+        process_cleanup pstampCleanup
+    end
+
+    task.exit   default
+        showcommand failure
+    end
+
+    task.exit   crash
+        showcommand crash
+    end
+
+    task.exit   timeout
+        showcommand timeout
+    end
+end
+
+task pstamp.cleanup.run
+    periods     -poll $RUNPOLL
+    periods     -exec $RUNEXEC
+    periods     -timeout 300
+    # since everything is on one file system keep npending low to avoid
+    # overloading nfs
+
+    npending    10
+
+    task.exec
+        book npages pstampCleanup -var N
+        if ($N == 0) 
+            periods -exec $RUNEXEC
+            break
+        end
+        periods -exec 0.05
+        
+        book getpage pstampCleanup 0 -var pageName -key pantaskState INIT
+        if ("$pageName" == "NULL") break
+
+        book setword pstampCleanup $pageName pantaskState RUN
+        book getword pstampCleanup $pageName req_id -var REQ_ID
+        book getword pstampCleanup $pageName dbname -var DBNAME
+        book getword pstampCleanup $pageName name -var NAME
+        book getword pstampCleanup $pageName outdir -var OUTDIR
+        book getword pstampCleanup $pageName uri -var URI
+        book getword pstampCleanup $pageName reqType -var REQTYPE
+        book getword pstampCleanup $pageName outProduct -var PRODUCT
+
+        # XXX: have the script set this up this
+        $MYLOGFILE=/data/ippdb02.0/pstamp/work/logs/cleanup.$REQ_ID
+        stdout $MYLOGFILE
+        stderr $MYLOGFILE
+
+        host anyhost
+
+        $run = pstamp_cleanup.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --name $NAME --outdir $OUTDIR --reqType $REQTYPE
+
+        add_standard_args run
+        options $pageName
+
+        if ($VERBOSE > 1) 
+            echo command $run
+        end
+        command $run
+    end
+
+
+    task.exit $EXIT_SUCCESS
+        process_exit pstampCleanup $options:0 $JOB_STATUS
+    end
+
+    task.exit default
+        showcommand failure
+        process_exit pstampCleanup $options:0 $JOB_STATUS
+    end
+
+    task.exit crash
+        showcommand crash
+        book setword pstampCleanup $options:0 pantaskState CRASH
+    end
+
+    task.exit timeout
+        showcommand timeout
+        book setword pstampCleanup $options:0 pantaskState TIMEOUT
+    end
+end
+
Index: branches/czw_branch/20100427/ippTasks/simtest.simmosaic.config
===================================================================
--- branches/czw_branch/20100427/ippTasks/simtest.simmosaic.config	(revision 28017)
+++ branches/czw_branch/20100427/ippTasks/simtest.simmosaic.config	(revision 28017)
@@ -0,0 +1,114 @@
+
+CAMERA     STR SIMMOSAIC
+
+FILERULE MULTI
+FILERULE STR    Chip00.fits
+FILERULE STR    Chip01.fits
+FILERULE STR    Chip10.fits
+FILERULE STR    Chip11.fits
+
+# define the simulated data to be generated
+SEQUENCE MULTI
+
+SEQUENCE METADATA
+  OBSTYPE    STR BIAS
+  NIMAGES    S32  20
+END
+
+SEQUENCE METADATA
+  OBSTYPE    STR DARK
+  @EXPTIMES  F32  30.0, 300.0
+  @NIMAGES   S32  10,   10
+END
+
+SEQUENCE METADATA
+  OBSTYPE    STR FLAT
+
+  FILTERS    STR r,r,i
+  @EXPTIMES  F32 0.1,20.0,20.0
+
+  NSETUP     S32 5
+END
+
+SEQUENCE METADATA
+  OBSTYPE    STR FLAT
+
+  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 OBJECT
+
+### Carina
+  CENTER.RA  F32 270.75
+  CENTER.DEC F32 -23.7
+### COSMOS field
+#  CENTER.RA  F32 150.119167 
+#  CENTER.DEC F32   2.205833
+
+  OFFSET.RA  F32 3600.0 # linear offset in arcsec (do not include cos(DEC) correction)
+  OFFSET.DEC F32 3600.0 # linear offset in arcsec (do not include cos(DEC) correction)
+  OFFSET.NR  S32 1
+  OFFSET.ND  S32 1
+
+  DITHER.RA  F32 60.0   # linear offset in arcsec (do not include cos(DEC) correction)
+  DITHER.DEC F32 60.0   # linear offset in arcsec (do not include cos(DEC) correction)
+  DITHER.NR  S32 3
+  DITHER.ND  S32 2
+
+  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
+
+  # XXX use a more realistic IQ distribution...
+  IQ_MIN     F32 0.55
+  IQ_MAX     F32 1.25
+  
+  # rotation sequence
+  POS_MIN    F32 0.0
+  POS_MAX    F32 0.0
+  POS_DELTA  F32 1.0
+
+END
+
+
+SEQUENCE METADATA
+  OBSTYPE    STR OBJECT
+
+### Carina
+  CENTER.RA  F32 270.75
+  CENTER.DEC F32 -23.7
+### COSMOS field
+#  CENTER.RA  F32 150.119167 
+#  CENTER.DEC F32   2.205833
+
+  OFFSET.RA  F32 3600.0 # linear offset in arcsec (do not include cos(DEC) correction)
+  OFFSET.DEC F32 3600.0 # linear offset in arcsec (do not include cos(DEC) correction)
+  OFFSET.NR  S32 1
+  OFFSET.ND  S32 1
+
+  DITHER.RA  F32 30.0   # linear offset in arcsec (do not include cos(DEC) correction)
+  DITHER.DEC F32 30.0   # linear offset in arcsec (do not include cos(DEC) correction)
+  DITHER.NR  S32 1
+  DITHER.ND  S32 1
+
+  DVODB      STR /data/alala.0/ipp/ippRefs/catdir.synth.simtest 
+  FILTERS    STR r,r,i,i
+  @EXPTIMES  F32 5.0, 240.0, 5.0, 240.0
+  @SKYMAGS   F32 20.86,20.86,20.15,20.15
+
+  # XXX use a more realistic IQ distribution...
+  IQ_MIN     F32 0.55
+  IQ_MAX     F32 1.25
+  
+  # rotation sequence
+  POS_MIN    F32 0.0
+  POS_MAX    F32 0.0
+  POS_DELTA  F32 1.0
+
+END
+
Index: branches/czw_branch/20100427/ippTasks/stack.pro
===================================================================
--- branches/czw_branch/20100427/ippTasks/stack.pro	(revision 27784)
+++ branches/czw_branch/20100427/ippTasks/stack.pro	(revision 28017)
@@ -116,5 +116,5 @@
     end
     add_poll_args run
-    # add_poll_labels run
+    add_poll_labels run
     command $run
   end
@@ -172,4 +172,5 @@
     book getword stackSumSkyfile $pageName skycell_id -var SKYCELL_ID
     book getword stackSumSkyfile $pageName workdir -var WORKDIR_TEMPLATE
+    book getword stackSumSkyfile $pageName path_base -var PATH_BASE
     book getword stackSumSkyfile $pageName reduction -var REDUCTION
     book getword stackSumSkyfile $pageName dbname -var DBNAME
@@ -185,5 +186,9 @@
 
     basename $TESS_DIR -var TESS_ID
-    sprintf outroot "%s/%s/%s/%s.%s.stk.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $STACK_ID
+    if ("$PATH_BASE" == "NULL")
+        sprintf outroot "%s/%s/%s/%s.%s.stk.%s" $WORKDIR $TESS_ID $SKYCELL_ID $TESS_ID $SKYCELL_ID $STACK_ID
+    else
+        $outroot = $PATH_BASE
+    end
 
     stdout $LOGDIR/stack.skycell.log
Index: branches/czw_branch/20100427/ippTasks/summit.copy.pro
===================================================================
--- branches/czw_branch/20100427/ippTasks/summit.copy.pro	(revision 27784)
+++ branches/czw_branch/20100427/ippTasks/summit.copy.pro	(revision 28017)
@@ -107,6 +107,9 @@
     periods      -timeout   20
     npending     1
-    # trange       16:00 23:59
-    # trange       00:00 04:00
+
+    # only active in the day (06:00 to 19:00 HST, times are UT):
+    trange        -reset
+    # trange        16:00 23:59
+    # trange        00:00 05:00
 
     task.exec
@@ -153,11 +156,15 @@
 # and inserting these into a db table on the local cluster (pzDownloadExp)
 task pzgetexp
+  host         local
+
   periods      -exec     30
   periods      -poll     1
   periods      -timeout  700
-  # trage       16:00 23:59
-  # trage       00:00 04:00
   npending      1
-  host         local
+
+  # only active in the day (06:00 to 19:00 HST, times are UT):
+  trange        -reset
+  # trange        16:00 23:59
+  # trange        00:00 05:00
 
   task.exec
@@ -213,7 +220,10 @@
     periods      -poll     1
     periods      -timeout  20
-    # trange       16:00 23:59
-    # trange       00:00 04:00
     npending     1
+
+    # only active in the day (06:00 to 19:00 HST, times are UT):
+    trange        -reset
+    # trange        16:00 23:59
+    # trange        00:00 05:00
 
     task.exec
@@ -224,5 +234,5 @@
         # save the DB name for the exit tasks
         option $DB:$pztoolPendingExp_DB
-        command pztool -pendingexp -limit 5 -dbname $DB:$pztoolPendingExp_DB
+        command pztool -pendingexp -limit 10 -dbname $DB:$pztoolPendingExp_DB
         $pztoolPendingExp_DB ++
         if ($pztoolPendingExp_DB >= $DB:n) set pztoolPendingExp_DB = 0
@@ -261,11 +271,15 @@
 # database table of imfiles
 task pzgetimfile 
+    host 	local
+
     periods      -exec     0.05
     periods      -poll     0.025
     periods      -timeout  700
-    # trage       16:00 23:59
-    # trage       00:00 04:00
-    host 	local
     npending 	10
+
+    # only active in the day (06:00 to 19:00 HST, times are UT):
+    trange        -reset
+    # trange        16:00 23:59
+    # trange        00:00 05:00
 
     task.exec
@@ -336,10 +350,13 @@
     host         local
 
-    periods      -exec     30
+    periods      -exec     10
     periods      -poll      1
     periods      -timeout  120
-    # trage       16:00 23:59
-    # trage       00:00 04:00
     npending     1
+
+    # only active in the day (06:00 to 19:00 HST, times are UT):
+    trange        -reset
+    # trange        16:00 23:59
+    # trange        00:00 05:00
 
     # select entries from the current DB; cycle to the next DB, if it exists
@@ -352,5 +369,5 @@
         # save the DB name for the exit tasks
         option $DB:$pztoolPendingImfile_DB
-        command pztool -pendingimfile -limit 60 -dbname $DB:$pztoolPendingImfile_DB
+        command pztool -pendingimfile -limit 240 -dbname $DB:$pztoolPendingImfile_DB
         $pztoolPendingImfile_DB ++
         if ($pztoolPendingImfile_DB >= $DB:n) set pztoolPendingImfile_DB = 0
@@ -384,10 +401,9 @@
     periods      -poll     0.05
     periods      -timeout  1150
+
+    # only active in the day (06:00 to 19:00 HST, times are UT):
     trange        -reset
-    # only active in the night (18:00 to 06:00 HST, times are UT):
-    # trange      04:00 16:00
-    # only active in the day (06:00 to 18:00 HST, times are UT):
     # trange        16:00 23:59
-    # trange        00:00 04:00
+    # trange        00:00 05:00
 
     task.exec
@@ -548,6 +564,4 @@
     periods      -poll      1
     periods      -timeout  120
-    # trage       16:00 23:59
-    # trage       00:00 04:00
     npending     1
 
@@ -592,6 +606,4 @@
     periods      -poll     0.05
     periods      -timeout  650
-    # trage       16:00 23:59
-    # trage       00:00 04:00
 
     task.exec
Index: branches/czw_branch/20100427/ippTasks/warp.pro
===================================================================
--- branches/czw_branch/20100427/ippTasks/warp.pro	(revision 27784)
+++ branches/czw_branch/20100427/ippTasks/warp.pro	(revision 28017)
@@ -314,4 +314,5 @@
     book getword warpPendingSkyCell $pageName camera -var CAMERA
     book getword warpPendingSkyCell $pageName workdir -var WORKDIR_TEMPLATE
+    book getword warpPendingSkyCell $pageName path-base -var PATH_BASE
     book getword warpPendingSkyCell $pageName dbname -var DBNAME
     # XXX change tess_id to tess_dir when schema is changed
@@ -331,6 +332,10 @@
     set.workdir.by.skycell $SKYCELL_ID $WORKDIR_TEMPLATE $default_host WORKDIR
 
-    ## generate outroot specific to this exposure
-    sprintf outroot "%s/%s/%s.wrp.%s.%s" $WORKDIR $EXP_TAG $EXP_TAG $WARP_ID $SKYCELL_ID
+    if ("$PATH_BASE" == "NULL") 
+        ## generate outroot specific to this exposure
+        sprintf outroot "%s/%s/%s.wrp.%s.%s" $WORKDIR $EXP_TAG $EXP_TAG $WARP_ID $SKYCELL_ID
+    else 
+        $outroot = $PATH_BASE
+    end
 
     stdout $LOGDIR/warp.skycell.log
