Index: trunk/ippTasks/chip.pro
===================================================================
--- trunk/ippTasks/chip.pro	(revision 16173)
+++ trunk/ippTasks/chip.pro	(revision 16195)
@@ -121,5 +121,5 @@
     book getword chipPendingImfile $pageName exp_tag -var EXP_TAG
     book getword chipPendingImfile $pageName chip_id -var CHIP_ID
-    book getword chipPendingImfile $pageName workdir -var WORKDIR
+    book getword chipPendingImfile $pageName workdir -var WORKDIR_TEMPLATE
     book getword chipPendingImfile $pageName class_id -var CLASS_ID
     book getword chipPendingImfile $pageName uri -var URI
@@ -130,25 +130,26 @@
     set.host.for.camera $camera $class_id
 
-    ## generate output log based on filerule
-    if ("$WORKDIR" == "NULL")
-      $outpath = `pwd`
-    else
-      $outpath = `ipp_datapath.pl $WORKDIR`
-    end
-    sprintf outpath "%s/%s" $outpath $EXP_TAG
-    sprintf outroot "%s/%s.ch.%s" $outpath $EXP_TAG $CHIP_ID
+    # raw workdir examples:
+    # file://data/@HOST@.0/gpc1/20080130
+    # neb:///@HOST@-vol0/gpc1/20080130 (need to supply volname?, or are we re-defining this each time?)
+    set.workdir.by.camera $CAMERA $CLASS_ID $WORKDIR_TEMPLATE $default_host WORKDIR
+    # out workdir examples:
+    # file://data/ipp004.0/gpc1/20080130
+    # 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
+
+    ## generate output log based on filerule (convert the URI to a PATH)
     $logfile = `ipp_filename.pl --filerule LOG.IMFILE --camera $CAMERA --class_id $CLASS_ID --basename $outroot`
     if ("$logfile" == "") 
-      sprintf logfile "%s.%s.log" $outroot $CLASS_ID
+      echo "WARNING: logfile not defined in chip.pro:152"
+      break
     end
 
     stdout $logfile
     stderr $logfile
-    exec mkdir -p $outpath
 
-    $run = chip_imfile.pl --exp_id $EXP_ID --chip_id $CHIP_ID --class_id $CLASS_ID --exp_tag $EXP_TAG --uri $URI --camera $CAMERA
-    if ("$WORKDIR" != "NULL")
-      $run = $run --workdir $WORKDIR
-    end
+    $run = chip_imfile.pl --exp_id $EXP_ID --chip_id $CHIP_ID --class_id $CLASS_ID --exp_tag $EXP_TAG --uri $URI --camera $CAMERA --outroot $outroot
     if ("$REDUCTION" != "NULL")
       $run = $run --reduction $REDUCTION
