IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27901


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

Don't fail if dvoImagesAtCoords returns more than one line it apparently can happen.
Just skip the exposure.
Use Time::HiRes gettimeofday() for timing instead of DateTime

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm

    r27852 r27901  
    1717                    resolve_project
    1818                    getCamRunByCamID
     19                    parse_md_fast
    1920                    );
    2021our %EXPORT_TAGS = (standard => [@EXPORT_OK]);
     
    2728use PS::IPP::Config qw( :standard );
    2829use Carp;
    29 use DateTime;
    3030use File::Temp qw(tempfile);
    3131use File::Basename;
    3232use POSIX;
     33use Time::HiRes qw(gettimeofday);
    3334
    3435my $dvo_verbose = 0;
     
    703704        next if !$astrom_resolved;
    704705
    705         my $start_dvo = DateTime->now->mjd;
     706        my $start_dvo = gettimeofday();
    706707        my $command = "$dvoImagesAtCoords -astrom $astrom_resolved $ra $dec";
    707708        # run the tool and parse the output
    708709        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    709710                    run(command => $command, verbose => $dvo_verbose);
    710         my $dtime_dvo = (DateTime->now->mjd - $start_dvo)* 86400.;
     711        my $dtime_dvo = gettimeofday() - $start_dvo;
    711712#        print "Time to run dvoImagesAtCoords: $dtime_dvo\n";
    712713        unless ($success) {
     
    731732        my $n = scalar @lines;
    732733        if ($n != 1) {
    733             print STDERR "unexpected number of lines returned by dvoImagesAtCoords: $n\n";
    734 
    735734            # XXX: There is a bug in dvo where each component is listed twice
    736735            # When that gets fixed remove the conditional and just die
    737             die "unexpected number lines returned by dvoImagesAtCoords: $n"
    738                 if ($n != 2) or ($lines[0] ne $lines[1]);
     736            if ($n ne 2 or $lines[0] ne $lines[1]) {
     737                print STDERR "unexpected number of lines returned by dvoImagesAtCoords: $n\n";
     738                print STDERR "OUTPUT:\n$output\n";
     739                # actually this seems to happen sometimes. Probably due to a problem with
     740                # astrometry. Just skip this camRun
     741                print STDERR "skipping: $astrom\n";
     742                next;
     743            }
    739744        }
    740745
     
    12321237
    12331238    print "Running $command\n" if !$verbose;
    1234     my $start_tool = DateTime->now->mjd;
     1239    my $start_tool = gettimeofday();
    12351240    # run the command and parse the output
    12361241
     
    12431248    }
    12441249
    1245     my $now = DateTime->now->mjd;
    1246     my $dtime_tool = (DateTime->now->mjd - $start_tool) * 86400.;
     1250    my $now = gettimeofday();
     1251    my $dtime_tool = $now - $start_tool;
    12471252    print "Time to run $program: $dtime_tool\n";
    12481253
     
    12521257    }
    12531258
    1254     my $start_parse = DateTime->now->mjd;
     1259    my $start_parse = gettimeofday();
    12551260
    12561261    my $mdcParser = PS::IPP::Metadata::Config->new;
     
    12581263        or die ("Unable to parse metadata config doc");
    12591264
    1260     my $dtime_parse = (DateTime->now->mjd - $start_parse) * 86400.;
     1265    my $dtime_parse = gettimeofday() - $start_parse;
    12611266    print "Time to parse results from $program: $dtime_parse\n";
    12621267
Note: See TracChangeset for help on using the changeset viewer.