Index: trunk/pstamp/scripts/pstampparse.pl
===================================================================
--- trunk/pstamp/scripts/pstampparse.pl	(revision 27898)
+++ trunk/pstamp/scripts/pstampparse.pl	(revision 27899)
@@ -17,5 +17,5 @@
 use Carp;
 use POSIX;
-use DateTime;
+use Time::HiRes qw(gettimeofday);
 
 my $verbose;
@@ -34,5 +34,5 @@
     'file=s'    =>  \$request_file_name,
     'req_id=s'  =>  \$req_id,
-    'outdir=s' =>  \$outdir,
+    'outdir=s'  =>  \$outdir,
     'product=s' =>  \$product,
     'label=s'   =>  \$label,
@@ -147,4 +147,5 @@
 my $rows;
 {
+    my $start_request_file = gettimeofday();
     my $command = "$pstampdump $request_file_name";
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -154,8 +155,8 @@
     }
     if (@$stdout_buf) {
-        my $table =  $mdcParser->parse(join "", @$stdout_buf) or
-            my_die("Unable to parse metdata config doc", $PS_EXIT_UNKNOWN_ERROR);
-        $rows = parse_md_list($table);
-    }
+        $rows = parse_md_fast($mdcParser, join "", @$stdout_buf);
+    }
+    my $dtime_request_file = gettimeofday() - $start_request_file;
+    print "Time to read and parse request file: $dtime_request_file\n";
 
 }
@@ -388,12 +389,9 @@
     my $numRows = scalar @$rowList;
 
-#    $tess_id = "" if !defined $tess_id;
-#    $component = "" if !defined $component;
-
     print "Collected $numRows rows beginning with row $rownum. $req_type $stage $id $tess_id $component\n";
     
     # Call PS::IPP::PStamp::Job locate_images subroutine to get the images for this
     # request specification. An array reference is returned.
-    my $start_locate = DateTime->now->mjd;
+    my $start_locate = gettimeofday();
 
     # XXX: perhaps we should get rid of most of this argument list.
@@ -404,6 +402,5 @@
                 $option_mask, $need_magic, $mjd_min, $mjd_max, $filter, $data_group, $verbose);
 
-    # XXX: why use mjd? It doesn't have great precision.
-    my $dtime_locate = (DateTime->now->mjd - $start_locate) * 86400.;
+    my $dtime_locate = gettimeofday() - $start_locate;
     print "Time to locate_images for row $rownum $dtime_locate\n";
 
@@ -504,16 +501,4 @@
     $image->{job_args} = $args;
 
-    # XXX: we can get rid of the following everything that we need is
-    # in the params file
-
-    $args .= " -file $imagefile";
-
-    if (($option_mask & $PSTAMP_SELECT_MASK) &&  $image->{mask} ) {
-        $args .= " -mask $image->{mask}";
-    }
-    if (($option_mask & $PSTAMP_SELECT_WEIGHT) and $image->{weight} ) {
-        $args .= " -variance $image->{weight}";
-    }
-
     my $base = basename($image->{image});
     if (! $base =~ /.fits$/ ) {
@@ -523,11 +508,4 @@
             
     my $output_base = "$outdir/${rownum}_${job_num}_${base}";
-    my $argslist = "${output_base}.args";
-
-    # copy the argument list to a file
-    open ARGSLIST, ">$argslist" or my_die("failed to open $argslist", $PS_EXIT_UNKNOWN_ERROR);
-    print ARGSLIST "$args\n";
-    close ARGSLIST or my_die("failed to close $argslist", $PS_EXIT_UNKNOWN_ERROR);
-
     write_params($output_base, $image);
 
@@ -664,5 +642,4 @@
 }
 
-#        $num_jobs = queueGetImageJobs($firstRow, $imageList, $stage, $need_magic, $mode);
 sub queueGetImageJobs
 {
