Changeset 24968
- Timestamp:
- Jul 31, 2009, 3:41:03 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r24921 r24968 232 232 } 233 233 my $out = $image; 234 234 235 # if uri is nil this will get overridded below 236 # (this is for raw stage) 235 237 $out->{image} = $image->{uri}; 236 # $out->{exp_id} = $image->{exp_id}; 237 # $out->{exp_name} = $image->{exp_name}; 238 # $out->{state} = $image->{state}; # state is undef for rawExp, but that's ok 239 # if ($set_class_id) { 240 # $class_id = $image->{class_id}; 241 # $out->{class_id} = $class_id; 242 # } 238 if ($set_class_id) { 239 $class_id = $image->{class_id}; 240 $out->{component} = $class_id; 241 } 243 242 244 243 # find the mask and weight images … … 248 247 $out->{weight} = $ipprc->filename($weight_name, $base, $class_id) if $weight_name; 249 248 } 250 # $out->{camera} = $camera;251 252 249 $out->{astrom} = find_astrometry($ipprc, $image_db, $image, $verbose) if $want_astrom; 253 250 … … 441 438 } 442 439 440 # cache of results of ppConfigDump 441 my %astromSources; 442 my $last_exp_id = 0; 443 my $lastAstromFile; 444 443 445 # find the astrometry file for a given exposure 444 446 # return undef if no completed camRun exists … … 449 451 my $verbose = shift; 450 452 453 my $exp_id = $image->{exp_id}; 454 if (($exp_id eq $last_exp_id) and $lastAstromFile) { 455 # running camtool 60 times is really expensive when the answer is the same 456 return $lastAstromFile; 457 } 458 $last_exp_id = 0; 459 $lastAstromFile = undef; 460 451 461 my $missing_tools; 452 462 my $camtool = can_run("camtool") or (warn "Can't find camtool" and $missing_tools = 1); … … 457 467 } 458 468 459 my $command = "$camtool -dbname $image_db -processedexp -exp_id $ image->{exp_id}";469 my $command = "$camtool -dbname $image_db -processedexp -exp_id $exp_id"; 460 470 # run the tool and parse the output 461 471 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 487 497 my $camRoot = $camdata->{path_base}; 488 498 my $camera = $image->{camera}; 489 my $astromSource ;490 {499 my $astromSource = $astromSources{$camera}; 500 if (!$astromSource) { 491 501 my $command = "$ppConfigDump -camera $camera -dump-recipe PSWARP -"; 492 502 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 499 509 die("Unable to parse metadata config doc"); 500 510 $astromSource = metadataLookupStr($metadata, 'ASTROM.SOURCE'); 511 $astromSources{$camera} = $astromSource; 501 512 } 502 513 503 514 my $astromFile = $ipprc->filename($astromSource, $camRoot); 515 if ($astromFile) { 516 $lastAstromFile = $astromFile; 517 $last_exp_id = $exp_id; 518 } 504 519 505 520 return $astromFile;
Note:
See TracChangeset
for help on using the changeset viewer.
