Index: trunk/ippScripts/scripts/camera_exp.pl
===================================================================
--- trunk/ippScripts/scripts/camera_exp.pl	(revision 19818)
+++ trunk/ippScripts/scripts/camera_exp.pl	(revision 19932)
@@ -10,4 +10,7 @@
 print "\n\n";
 print "Starting script $0 on $host\n\n";
+
+use DateTime;
+my $mjd_start = DateTime->now->mjd;   # MJD of starting script
 
 use vars qw( $VERSION );
@@ -353,4 +356,5 @@
     $fpaCommand .= $camStats->cmdflags();
     $fpaCommand .= " -hostname $host" if defined $host;
+    $fpaCommand .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
 } else {
     $fpaCommand .= " -updaterun -state full";
@@ -387,4 +391,5 @@
             $command .= " -path_base $outroot";
             $command .= " -path_base $outroot" if defined $outroot;
+            $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
         } else {
             $command .= " -updateprocessedexp";
Index: trunk/ippScripts/scripts/chip_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/chip_imfile.pl	(revision 19818)
+++ trunk/ippScripts/scripts/chip_imfile.pl	(revision 19932)
@@ -11,4 +11,7 @@
 print "Starting script $0 on $host\n\n";
 
+use DateTime;
+my $mjd_start = DateTime->now->mjd;   # MJD of starting script
+
 use vars qw( $VERSION );
 $VERSION = '0.01';
@@ -28,17 +31,17 @@
      $no_update, $no_op, $redirect );
 GetOptions(
-    'exp_id=s'      	=> \$exp_id,    # Exposure identifier
-    'chip_id=s'     	=> \$chip_id,   # Chiptool identifier
-    'class_id=s'    	=> \$class_id,  # Class identifier
-    'uri|u=s'       	=> \$uri,       # Input FITS file
-    'camera|c=s'    	=> \$camera,    # Camera
-    'outroot|w=s'   	=> \$outroot,   # output file base name
-    'dbname|d=s'    	=> \$dbname,    # Database name
-    'reduction=s'   	=> \$reduction, # Reduction class
+    'exp_id=s'          => \$exp_id,    # Exposure identifier
+    'chip_id=s'         => \$chip_id,   # Chiptool identifier
+    'class_id=s'        => \$class_id,  # Class identifier
+    'uri|u=s'           => \$uri,       # Input FITS file
+    'camera|c=s'        => \$camera,    # Camera
+    'outroot|w=s'       => \$outroot,   # output file base name
+    'dbname|d=s'        => \$dbname,    # Database name
+    'reduction=s'       => \$reduction, # Reduction class
     'run-state=s'       => \$run_state, # current state of the run (new, update)
-    'threads=s'       	=> \$threads,   # Number of threads to use for ppImage
-    'verbose'       	=> \$verbose,   # Print to stdout
-    'no-update'     	=> \$no_update, # Don't update the database?
-    'no-op'         	=> \$no_op,     # Don't do any operations?
+    'threads=s'         => \$threads,   # Number of threads to use for ppImage
+    'verbose'           => \$verbose,   # Print to stdout
+    'no-update'         => \$no_update, # Don't update the database?
+    'no-op'             => \$no_op,     # Don't do any operations?
     'redirect-output'   => \$redirect,
     ) or pod2usage( 2 );
@@ -73,6 +76,4 @@
 # values to extract from output metadata and the stats to calculate
 # XXX commented-out entries are not yet defined in the output files
-# XXX EAM : we are removing the astrometry analysis from chip, so we
-# do not bother to calculate those stats.
 my $STATS =
    [
@@ -86,19 +87,14 @@
        { name => "FRINGE_RESID_0", type => "rms",   flag => "-fringe_1",       dtype => "float" },
        { name => "FRINGE_ERR_0",   type => "rms",   flag => "-fringe_2",       dtype => "float" },
-#      { name => "CERROR",         type => "rms",   flag => "-sigma_ra",       dtype => "float" },
-#      { name => "CERROR",         type => "rms",   flag => "-sigma_dec",      dtype => "float" },
        { name => "APMIFIT",        type => "mean",  flag => "-ap_resid",       dtype => "float" },
        { name => "DAPMIFIT",       type => "rms",   flag => "-ap_resid_stdev", dtype => "float" },
-#      { name => "ZP??",           type => "mean",  flag => "-zp_mean",        dtype => "float" },
-#      { name => "ZP??",           type => "rms",   flag => "-zp_stdev",       dtype => "float" },
        { name => "FWHM_X",         type => "mean",  flag => "-fwhm_major",     dtype => "float" },
        { name => "FWHM_Y",         type => "mean",  flag => "-fwhm_minor",     dtype => "float" },
        { name => "DT_DET",         type => "sum",   flag => "-dtime_detrend",  dtype => "float" },
        { name => "DT_PHOT",        type => "sum",   flag => "-dtime_photom",   dtype => "float" },
-#       { name => "DT_ASTR",        type => "sum",   flag => "-dtime_astrom",   dtype => "float" },
+       { name => "DT_TOTAL",       type => "sum",   flag => "-dtime_total",    dtype => "float" },
        { name => "NSTARS",         type => "sum",   flag => "-n_stars",        dtype => "int"   },
 #      { name => "?",              type => "sum",   flag => "-n_extended",     dtype => "int"   },
 #      { name => "?",              type => "sum",   flag => "-n_cr",           dtype => "int"   },
-#      { name => "NASTRO",         type => "sum",   flag => "-n_astrom",       dtype => "int"   },
    ];
 my $stats = PS::IPP::Metadata::Stats->new($STATS); # Stats parser
@@ -149,22 +145,22 @@
 
     if ($run_state eq "new") {
-	$command  = "$ppImage -file $uri $outroot";
-	$command .= " -recipe PPIMAGE $recipe";
-	$command .= " -threads $threads" if defined $threads;
-	$command .= " -dbname $dbname" if defined $dbname;
+        $command  = "$ppImage -file $uri $outroot";
+        $command .= " -recipe PPIMAGE $recipe";
+        $command .= " -threads $threads" if defined $threads;
+        $command .= " -dbname $dbname" if defined $dbname;
         $command .= " -dumpconfig $configuration";
-	$command .= " -tracedest $traceDest -log $logDest";
+        $command .= " -tracedest $traceDest -log $logDest";
         $do_stats = 1;
     } else {
-	$command  = "$ppImage -file $uri $outroot";
-	$command .= " -ipprc $configuration";
-	$command .= " -threads $threads" if defined $threads;
-	$command .= " -dbname $dbname" if defined $dbname;
-	$command .= " -tracedest $traceDest -log $logDest";
-	$command .= " -Db PPIMAGE:PHOTOM FALSE";
+        $command  = "$ppImage -file $uri $outroot";
+        $command .= " -ipprc $configuration";
+        $command .= " -threads $threads" if defined $threads;
+        $command .= " -dbname $dbname" if defined $dbname;
+        $command .= " -tracedest $traceDest -log $logDest";
+        $command .= " -Db PPIMAGE:PHOTOM FALSE";
     }
     if ($do_stats) {
-	$command .= " -recipe PPSTATS CHIPSTATS";
-	$command .= " -stats $outputStats";
+        $command .= " -recipe PPSTATS CHIPSTATS";
+        $command .= " -stats $outputStats";
     }
 
@@ -241,4 +237,5 @@
     $command .= " -dbname $dbname" if defined $dbname;
     $command .= $stats->cmdflags();
+    $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
 } else {
     $command = "$chiptool -tofullimfile";
@@ -279,4 +276,5 @@
             $command .= " -path_base $outroot";
             $command .= " -hostname $host" if defined $host;
+            $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
         } else {
             $command .= "$chiptool -updateprocessedimfile";
Index: trunk/ippScripts/scripts/diff_skycell.pl
===================================================================
--- trunk/ippScripts/scripts/diff_skycell.pl	(revision 19818)
+++ trunk/ippScripts/scripts/diff_skycell.pl	(revision 19932)
@@ -9,4 +9,7 @@
 print "\n\n";
 print "Starting script $0 on $host\n\n";
+
+use DateTime;
+my $mjd_start = DateTime->now->mjd;   # MJD of starting script
 
 use vars qw( $VERSION );
@@ -241,4 +244,5 @@
         my $command = "$difftool -adddiffskyfile -diff_id $diff_id -uri $outputName -path_base $outroot";
         $command .= $stats->cmdflags();
+        $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
         $command .= " -hostname $host" if defined $host;
         $command .= " -dbname $dbname" if defined $dbname;
@@ -263,4 +267,5 @@
     if (defined $diff_id and not $no_update) {
         my $command = "$difftool -adddiffskyfile -diff_id $diff_id -code $exit_code";
+        $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
         $command .= " -hostname $host" if defined $host;
         $command .= " -dbname $dbname" if defined $dbname;
Index: trunk/ippScripts/scripts/fake_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/fake_imfile.pl	(revision 19818)
+++ trunk/ippScripts/scripts/fake_imfile.pl	(revision 19932)
@@ -2,5 +2,5 @@
 
 ## this script is run on every imfile to perform the fake source
-## analysis and the forced photometry analysis.  
+## analysis and the forced photometry analysis.
 
 ## For the fake source analysis, we load the image, inject a number of
@@ -12,5 +12,5 @@
 
 ## For the forced photometry, we need to use the measured astrometry
-## to select the desired locations in pixel coord.  
+## to select the desired locations in pixel coord.
 
 # XXX : seeing needs to be determined from the input PSF (not currently done in ppSim)
@@ -27,4 +27,7 @@
 print "Starting script $0 on $host\n\n";
 
+use DateTime;
+my $mjd_start = DateTime->now->mjd;   # MJD of starting script
+
 use vars qw( $VERSION );
 $VERSION = '0.01';
@@ -41,19 +44,19 @@
 
 # Parse the command-line arguments
-my ( $exp_id, $fake_id, $class_id, $chiproot, $camroot, $camera, $outroot, 
+my ( $exp_id, $fake_id, $class_id, $chiproot, $camroot, $camera, $outroot,
      $dbname, $reduction, $verbose, $no_update, $no_op, $redirect  );
 GetOptions(
-    'exp_id=s'      	=> \$exp_id,    # Exposure identifier
-    'fake_id=s'     	=> \$fake_id,   # Chiptool identifier
-    'class_id=s'    	=> \$class_id,  # Class identifier
-    'chiproot=s'    	=> \$chiproot,  # Input Chip files (root)
-    'camroot=s'     	=> \$camroot,   # Input Camera files (root)
-    'camera|c=s'    	=> \$camera,	   # Camera
-    'outroot|w=s'   	=> \$outroot,   # output file base name
-    'dbname|d=s'    	=> \$dbname,    # Database name
-    'reduction=s'   	=> \$reduction, # Reduction class
-    'verbose'       	=> \$verbose,   # Print to stdout
-    'no-update'     	=> \$no_update, # Don't update the database?
-    'no-op'         	=> \$no_op,	   # Don't do any operations?
+    'exp_id=s'          => \$exp_id,    # Exposure identifier
+    'fake_id=s'         => \$fake_id,   # Chiptool identifier
+    'class_id=s'        => \$class_id,  # Class identifier
+    'chiproot=s'        => \$chiproot,  # Input Chip files (root)
+    'camroot=s'         => \$camroot,   # Input Camera files (root)
+    'camera|c=s'        => \$camera,       # Camera
+    'outroot|w=s'       => \$outroot,   # output file base name
+    'dbname|d=s'        => \$dbname,    # Database name
+    'reduction=s'       => \$reduction, # Reduction class
+    'verbose'           => \$verbose,   # Print to stdout
+    'no-update'         => \$no_update, # Don't update the database?
+    'no-op'             => \$no_op,        # Don't do any operations?
     'redirect-output'   => \$redirect,
     ) or pod2usage( 2 );
@@ -61,5 +64,5 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage( -msg => "Required options: --exp_id --fake_id --class_id --chiproot --camroot --camera --outroot",
-	   -exitval => 3) unless
+           -exitval => 3) unless
     defined $exp_id and
     defined $fake_id and
@@ -104,5 +107,5 @@
 }
 
-my $mdcParser = PS::IPP::Metadata::Config->new;	# Parser for metadata config files
+my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
 
 # outroot examples (HOST components must be set)
@@ -120,5 +123,5 @@
 my $chipPSF       = $ipprc->filename("PSPHOT.PSF.SAVE",     $chiproot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR);
 my $cameraObjects = $ipprc->filename("PSASTRO.OUTPUT",      $camroot)             or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR);
-my $traceDest     = $ipprc->filename("TRACE.IMFILE", 	    $outroot, $class_id)  or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR);
+my $traceDest     = $ipprc->filename("TRACE.IMFILE",        $outroot, $class_id)  or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR);
 
 # XXX check for existence of input data
@@ -128,11 +131,11 @@
 my $command = "$ppConfigDump -camera $camera -dump-recipe PPSIM -recipe PPSIM $recipe -";
 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-	run(command => $command, verbose => $verbose);
+        run(command => $command, verbose => $verbose);
 unless ($success) {
-	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	&my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $fake_id, $class_id, $PS_EXIT_SYS_ERROR);
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $fake_id, $class_id, $PS_EXIT_SYS_ERROR);
 }
 my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
-	&my_die("Unable to parse metadata config doc", $exp_id, $fake_id, $class_id, $PS_EXIT_SYS_ERROR);
+        &my_die("Unable to parse metadata config doc", $exp_id, $fake_id, $class_id, $PS_EXIT_SYS_ERROR);
 
 ## allow the output images to be optional, depending on the recipe / reduction class
@@ -156,8 +159,8 @@
 
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-	run(command => $command, verbose => $verbose);
+        run(command => $command, verbose => $verbose);
     unless ($success) {
-	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	&my_die("Unable to perform ppSim: $error_code", $exp_id, $fake_id, $class_id, $error_code);
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform ppSim: $error_code", $exp_id, $fake_id, $class_id, $error_code);
     }
 
@@ -167,19 +170,19 @@
     # XXX use this to parse the output metadata : eg, detection limits, Nfakes, Nforced
     # Get the statistics on the processed image
-    # my $statsFile;		# File handle
+    # my $statsFile;            # File handle
     # open $statsFile, $ipprc->file_resolve($outputStats) or &my_die("Can't open statistics file $outputStats: $!", $exp_id, $fake_id, $class_id, $PS_EXIT_SYS_ERROR);
     # my @contents = <$statsFile>; # Contents of file
     # close $statsFile;
-    # 
+    #
     # # parse the statistics MDC file
-    # my $mdcParser = PS::IPP::Metadata::Config->new();	# Parser for metadata config files
+    # my $mdcParser = PS::IPP::Metadata::Config->new(); # Parser for metadata config files
     # my $metadata = $mdcParser->parse(join "", @contents);
     # unless ($metadata) {
-    # 	&my_die("Unable to parse metadata config doc", $exp_id, $fake_id, $class_id, $PS_EXIT_PROG_ERROR);
+    #   &my_die("Unable to parse metadata config doc", $exp_id, $fake_id, $class_id, $PS_EXIT_PROG_ERROR);
     # }
-    # 
+    #
     # # extract the stats from the metadata
     # unless ($stats->parse($metadata)) {
-    # 	&my_die("Failure extracting metadata from the statistics output file.\n", $exp_id, $fake_id, $class_id, $PS_EXIT_PROG_ERROR);
+    #   &my_die("Failure extracting metadata from the statistics output file.\n", $exp_id, $fake_id, $class_id, $PS_EXIT_PROG_ERROR);
     # }
 } else {
@@ -194,4 +197,5 @@
 $command .= " -path_base $outroot";
 $command .= " -dbname $dbname" if defined $dbname;
+$command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
 # XXX add this after defined
 # $command .= $stats->cmdflags();
@@ -200,9 +204,9 @@
 unless ($no_update) {
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-	run(command => $command, verbose => $verbose);
+        run(command => $command, verbose => $verbose);
     unless ($success) {
-	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	warn("Unable to perform faketool -addprocessedimfile: $error_code\n");
-	exit($error_code);
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        warn("Unable to perform faketool -addprocessedimfile: $error_code\n");
+        exit($error_code);
     }
 } else {
@@ -220,11 +224,12 @@
     carp($msg);
     if (defined $exp_id and defined $fake_id and defined $class_id and not $no_update) {
-	my $command = "$faketool -addprocessedimfile";
-	$command .= " -fake_id $fake_id";
-	$command .= " -exp_id $exp_id";
-	$command .= " -class_id $class_id";
-	$command .= " -path_base $outroot";
-	$command .= " -code $exit_code";
-	$command .= " -dbname $dbname" if defined $dbname;
+        my $command = "$faketool -addprocessedimfile";
+        $command .= " -fake_id $fake_id";
+        $command .= " -exp_id $exp_id";
+        $command .= " -class_id $class_id";
+        $command .= " -path_base $outroot";
+        $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
+        $command .= " -code $exit_code";
+        $command .= " -dbname $dbname" if defined $dbname;
         system ($command);
     }
Index: trunk/ippScripts/scripts/stack_skycell.pl
===================================================================
--- trunk/ippScripts/scripts/stack_skycell.pl	(revision 19818)
+++ trunk/ippScripts/scripts/stack_skycell.pl	(revision 19932)
@@ -10,4 +10,7 @@
 print "\n\n";
 print "Starting script $0 on $host\n\n";
+
+use DateTime;
+my $mjd_start = DateTime->now->mjd;   # MJD of starting script
 
 use vars qw( $VERSION );
@@ -264,4 +267,5 @@
             $command .= " -uri $outputName -path_base $outroot";
             $command .= " -hostname $host" if defined $host;
+            $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
         } else {
             $mode = "-updaterun -state full";
@@ -294,4 +298,5 @@
             $command .= " -addsumskyfile";
             $command .= " -hostname $host" if defined $host;
+            $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
         } else {
             $command .= " -updatesumskyfile";
Index: trunk/ippScripts/scripts/warp_skycell.pl
===================================================================
--- trunk/ippScripts/scripts/warp_skycell.pl	(revision 19818)
+++ trunk/ippScripts/scripts/warp_skycell.pl	(revision 19932)
@@ -9,4 +9,7 @@
 print "\n\n";
 print "Starting script $0 on $host\n\n";
+
+use DateTime;
+my $mjd_start = DateTime->now->mjd;   # MJD of starting script
 
 use vars qw( $VERSION );
@@ -252,4 +255,5 @@
             $command .= " -ignore"           if not $accept; # Completed succesfully, but can't produce product
             $command .= " -uri $outputImage" if $accept;
+            $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
             $command .= $stats->cmdflags()   if $accept;
             $command .= " -hostname $host"   if defined $host;
@@ -305,4 +309,5 @@
         $command .= " -warp_id $warp_id";
         $command .= " -skycell_id $skycell_id";
+        $command .= (" -dtime_script " . (($mjd_start - DateTime->now->mjd) * 86400));
         $command .= " -code $exit_code";
         $command .= " -dbname $dbname" if defined $dbname;
