Index: trunk/ippScripts/scripts/chip_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/chip_imfile.pl	(revision 23394)
+++ trunk/ippScripts/scripts/chip_imfile.pl	(revision 23395)
@@ -37,5 +37,5 @@
 # Parse the command-line arguments
 my ( $exp_id, $chip_id, $class_id, $chip_imfile_id, $uri, $camera, $outroot, $dbname, $run_state, $reduction, $threads, $verbose,
-     $no_update, $no_op, $redirect );
+     $no_update, $no_op, $redirect, $magicked );
 GetOptions(
     'exp_id=s'          => \$exp_id,    # Exposure identifier
@@ -49,4 +49,5 @@
     'reduction=s'       => \$reduction, # Reduction class
     'run-state=s'       => \$run_state, # current state of the run (new, update)
+    'magicked'          => \$magicked,  # magicked state of intput file
     'threads=s'         => \$threads,   # Number of threads to use for ppImage
     'verbose'           => \$verbose,   # Print to stdout
@@ -215,4 +216,5 @@
     $command .= " -uri $outputImage";
     $command .= " -path_base $outroot";
+    $command .= " -magicked" if $magicked;
     $command .= " -hostname $host" if defined $host;
     $command .= " -dbname $dbname" if defined $dbname;
Index: trunk/ippTasks/chip.pro
===================================================================
--- trunk/ippTasks/chip.pro	(revision 23394)
+++ trunk/ippTasks/chip.pro	(revision 23395)
@@ -142,4 +142,5 @@
     book getword chipPendingImfile $pageName exp_id -var EXP_ID
     book getword chipPendingImfile $pageName exp_tag -var EXP_TAG
+    book getword chipPendingImfile $pageName raw_magicked -var RAW_MAGICKED
     book getword chipPendingImfile $pageName chip_id -var CHIP_ID
     book getword chipPendingImfile $pageName chip_imfile_id -var CHIP_IMFILE_ID
@@ -151,4 +152,10 @@
     book getword chipPendingImfile $pageName state -var RUN_STATE
 
+    if ("$RAW_MAGICKED" == "T")
+        $MAGICKED_ARG = "-magicked"
+    else 
+        $MAGICKED_ARG = ""
+    end
+
     # specify choice of local or remote host based on camera and chip (class_id)
     set.host.for.camera $CAMERA $CLASS_ID
@@ -171,5 +178,5 @@
     stderr $LOGDIR/chip.imfile.log
 
-    $run = chip_imfile.pl --threads @MAX_THREADS@ --exp_id $EXP_ID --chip_id $CHIP_ID --chip_imfile_id $CHIP_IMFILE_ID --class_id $CLASS_ID --uri $URI --camera $CAMERA --run-state $RUN_STATE --outroot $outroot --redirect-output 
+    $run = chip_imfile.pl --threads @MAX_THREADS@ --exp_id $EXP_ID --chip_id $CHIP_ID --chip_imfile_id $CHIP_IMFILE_ID --class_id $CLASS_ID --uri $URI --camera $CAMERA --run-state $RUN_STATE $MAGICKED_ARG --outroot $outroot --redirect-output
     if ("$REDUCTION" != "NULL")
       $run = $run --reduction $REDUCTION
