Changeset 25129
- Timestamp:
- Aug 19, 2009, 1:06:23 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r25107 r25129 34 34 my $req_type = shift; # required 35 35 my $img_type = shift; # required 36 my $id = shift; # required unless req_type eq bycoord 36 my $id = shift; # required unless req_type eq bycoord or byskycell 37 37 my $component= shift; # class_id or skycell_id 38 38 my $inverse = shift; … … 63 63 return undef; 64 64 } 65 if ( ($img_type eq "warp") or ($img_type eq "diff")) {65 if ($img_type eq "diff") { 66 66 # lookup_diff has done all of the work 67 67 return $results; … … 74 74 return undef if !$id; 75 75 # fall through and lookup byexp 76 } elsif ($img_type eq "warp") { 77 $req_type = "byid"; 78 $id = $image->{warp_id}; 79 return undef if !$id; 80 # fall through and lookup by warp_id 76 81 } elsif ($img_type eq "stack") { 77 82 $req_type = "byid"; 78 83 $id = $image->{stack_id}; 79 84 return undef if !$id; 80 # fall though and lookup by stack id85 # fall though and lookup by stack_id 81 86 } else { 82 87 # shouldn't I check this elsewhere? … … 327 332 } 328 333 329 my $warp_id;334 my ($warp_id, $exp_id, $exp_name); 330 335 if ($inverse and !$image->{bothways}) { 331 print STDERR " inverse image requested for diffRun that is not bothways ignoring\n";336 print STDERR "Inverse images requested for diffRun that is not bothways. Ignoring.\n"; 332 337 $inverse = 0; 333 338 } 334 339 if ($inverse) { 335 340 $warp_id = $image->{warp2}; 341 $exp_id = $image->{exp_id_2}; 342 $exp_name = $image->{exp_name_2}; 336 343 } else { 337 344 $warp_id = $image->{warp1}; 345 $exp_id = $image->{exp_id_1}; 346 $exp_name = $image->{exp_name_1}; 338 347 } 339 348 # XXX difftool currently returns max long long for null … … 341 350 if ($warp_id and ($warp_id != 9223372036854775807)) { 342 351 $image->{warp_id} = $warp_id; 343 344 ## now use the warp and go get the exposure information 345 $command = "warptool -warped -warp_id $warp_id -skycell_id $skycell_id -dbname $image_db -limit 1"; 346 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 347 run(command => $command, verbose => $verbose); 348 unless ($success) { 349 # XXX: I'm not sure if we should die here 350 print STDERR @$stderr_buf; 351 return undef; 352 } 353 354 my $buf = join "", @$stdout_buf; 355 if (!$buf) { 356 next; 357 } 358 359 my $mdcParser = PS::IPP::Metadata::Config->new; 360 my $warps = parse_md_fast($mdcParser, $buf) 361 or die ("Unable to parse metadata config doc"); 362 my $warp = $warps->[0]; 363 364 if ($img_type eq "warp") { 365 $image = $warp; 366 } else { 367 $image->{exp_id} = $warp->{exp_id}; 368 $image->{exp_name} = $warp->{exp_name}; 369 $image->{camera} = $warp->{camera}; 370 } 352 $image->{exp_id} = $exp_id; 353 $image->{exp_name} = $exp_name; 371 354 } else { 372 355 print STDERR "unexpected result warp_id not defined\n"; 373 356 next; 374 357 } 375 376 if (($img_type eq "diff") or ($img_type eq "warp")) { 358 if ($img_type eq "diff") { 377 359 # the $image is going to be returned directly in this case so we need to duplicate 378 360 # some of processing that lookup does for other img_types 379 361 if ($image->{camera}) { 380 362 $ipprc->define_camera($image->{camera}); 381 if ($img_type eq "diff") { 382 my $filerule_base = $inverse ? "PPSUB.INVERSE" : "PPSUB.OUTPUT"; 383 $image->{image} = $ipprc->filename($filerule_base, $image->{path_base}); 384 $image->{mask} = $ipprc->filename($filerule_base . ".MASK", $image->{path_base}); 385 $image->{weight} = $ipprc->filename($filerule_base . ".VARIANCE", $image->{path_base}); 386 } else { 387 $image->{image} = $ipprc->filename("PSWARP.OUTPUT", $image->{path_base}); 388 $image->{mask} = $ipprc->filename("PSWARP.OUTPUT.MASK", $image->{path_base}); 389 $image->{weight} = $ipprc->filename("PSWARP.OUTPUT.VARIANCE", $image->{path_base}); 390 } 363 my $filerule_base = $inverse ? "PPSUB.INVERSE" : "PPSUB.OUTPUT"; 364 $image->{image} = $ipprc->filename($filerule_base, $image->{path_base}); 365 $image->{mask} = $ipprc->filename($filerule_base . ".MASK", $image->{path_base}); 366 $image->{weight} = $ipprc->filename($filerule_base . ".VARIANCE", $image->{path_base}); 391 367 } else { 392 368 # XXX this will only happen if the minuend is not a warp
Note:
See TracChangeset
for help on using the changeset viewer.
