IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 10, 2010, 10:53:01 AM (16 years ago)
Author:
bills
Message:

args file is no more. Use gettimeofday() for timing. DateTime->now->mjd had insufficient precision

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstampparse.pl

    r27874 r27899  
    1717use Carp;
    1818use POSIX;
    19 use DateTime;
     19use Time::HiRes qw(gettimeofday);
    2020
    2121my $verbose;
     
    3434    'file=s'    =>  \$request_file_name,
    3535    'req_id=s'  =>  \$req_id,
    36     'outdir=s' =>  \$outdir,
     36    'outdir=s'  =>  \$outdir,
    3737    'product=s' =>  \$product,
    3838    'label=s'   =>  \$label,
     
    147147my $rows;
    148148{
     149    my $start_request_file = gettimeofday();
    149150    my $command = "$pstampdump $request_file_name";
    150151    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    154155    }
    155156    if (@$stdout_buf) {
    156         my $table =  $mdcParser->parse(join "", @$stdout_buf) or
    157             my_die("Unable to parse metdata config doc", $PS_EXIT_UNKNOWN_ERROR);
    158         $rows = parse_md_list($table);
    159     }
     157        $rows = parse_md_fast($mdcParser, join "", @$stdout_buf);
     158    }
     159    my $dtime_request_file = gettimeofday() - $start_request_file;
     160    print "Time to read and parse request file: $dtime_request_file\n";
    160161
    161162}
     
    388389    my $numRows = scalar @$rowList;
    389390
    390 #    $tess_id = "" if !defined $tess_id;
    391 #    $component = "" if !defined $component;
    392 
    393391    print "Collected $numRows rows beginning with row $rownum. $req_type $stage $id $tess_id $component\n";
    394392   
    395393    # Call PS::IPP::PStamp::Job locate_images subroutine to get the images for this
    396394    # request specification. An array reference is returned.
    397     my $start_locate = DateTime->now->mjd;
     395    my $start_locate = gettimeofday();
    398396
    399397    # XXX: perhaps we should get rid of most of this argument list.
     
    404402                $option_mask, $need_magic, $mjd_min, $mjd_max, $filter, $data_group, $verbose);
    405403
    406     # XXX: why use mjd? It doesn't have great precision.
    407     my $dtime_locate = (DateTime->now->mjd - $start_locate) * 86400.;
     404    my $dtime_locate = gettimeofday() - $start_locate;
    408405    print "Time to locate_images for row $rownum $dtime_locate\n";
    409406
     
    504501    $image->{job_args} = $args;
    505502
    506     # XXX: we can get rid of the following everything that we need is
    507     # in the params file
    508 
    509     $args .= " -file $imagefile";
    510 
    511     if (($option_mask & $PSTAMP_SELECT_MASK) &&  $image->{mask} ) {
    512         $args .= " -mask $image->{mask}";
    513     }
    514     if (($option_mask & $PSTAMP_SELECT_WEIGHT) and $image->{weight} ) {
    515         $args .= " -variance $image->{weight}";
    516     }
    517 
    518503    my $base = basename($image->{image});
    519504    if (! $base =~ /.fits$/ ) {
     
    523508           
    524509    my $output_base = "$outdir/${rownum}_${job_num}_${base}";
    525     my $argslist = "${output_base}.args";
    526 
    527     # copy the argument list to a file
    528     open ARGSLIST, ">$argslist" or my_die("failed to open $argslist", $PS_EXIT_UNKNOWN_ERROR);
    529     print ARGSLIST "$args\n";
    530     close ARGSLIST or my_die("failed to close $argslist", $PS_EXIT_UNKNOWN_ERROR);
    531 
    532510    write_params($output_base, $image);
    533511
     
    664642}
    665643
    666 #        $num_jobs = queueGetImageJobs($firstRow, $imageList, $stage, $need_magic, $mode);
    667644sub queueGetImageJobs
    668645{
Note: See TracChangeset for help on using the changeset viewer.