Changeset 27901
- Timestamp:
- May 10, 2010, 10:59:19 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r27852 r27901 17 17 resolve_project 18 18 getCamRunByCamID 19 parse_md_fast 19 20 ); 20 21 our %EXPORT_TAGS = (standard => [@EXPORT_OK]); … … 27 28 use PS::IPP::Config qw( :standard ); 28 29 use Carp; 29 use DateTime;30 30 use File::Temp qw(tempfile); 31 31 use File::Basename; 32 32 use POSIX; 33 use Time::HiRes qw(gettimeofday); 33 34 34 35 my $dvo_verbose = 0; … … 703 704 next if !$astrom_resolved; 704 705 705 my $start_dvo = DateTime->now->mjd;706 my $start_dvo = gettimeofday(); 706 707 my $command = "$dvoImagesAtCoords -astrom $astrom_resolved $ra $dec"; 707 708 # run the tool and parse the output 708 709 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 709 710 run(command => $command, verbose => $dvo_verbose); 710 my $dtime_dvo = (DateTime->now->mjd - $start_dvo)* 86400.;711 my $dtime_dvo = gettimeofday() - $start_dvo; 711 712 # print "Time to run dvoImagesAtCoords: $dtime_dvo\n"; 712 713 unless ($success) { … … 731 732 my $n = scalar @lines; 732 733 if ($n != 1) { 733 print STDERR "unexpected number of lines returned by dvoImagesAtCoords: $n\n";734 735 734 # XXX: There is a bug in dvo where each component is listed twice 736 735 # 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 } 739 744 } 740 745 … … 1232 1237 1233 1238 print "Running $command\n" if !$verbose; 1234 my $start_tool = DateTime->now->mjd;1239 my $start_tool = gettimeofday(); 1235 1240 # run the command and parse the output 1236 1241 … … 1243 1248 } 1244 1249 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; 1247 1252 print "Time to run $program: $dtime_tool\n"; 1248 1253 … … 1252 1257 } 1253 1258 1254 my $start_parse = DateTime->now->mjd;1259 my $start_parse = gettimeofday(); 1255 1260 1256 1261 my $mdcParser = PS::IPP::Metadata::Config->new; … … 1258 1263 or die ("Unable to parse metadata config doc"); 1259 1264 1260 my $dtime_parse = (DateTime->now->mjd - $start_parse) * 86400.;1265 my $dtime_parse = gettimeofday() - $start_parse; 1261 1266 print "Time to parse results from $program: $dtime_parse\n"; 1262 1267
Note:
See TracChangeset
for help on using the changeset viewer.
