- Timestamp:
- Nov 20, 2009, 4:13:39 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091113/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r25793 r26236 84 84 85 85 my $image = $results->[0]; 86 if ( ($img_type eq "raw") or ($img_type eq "chip")) {87 $req_type = "by exp";88 $id = $image->{exp_ name};86 if ($img_type eq "raw") { 87 $req_type = "byid"; 88 $id = $image->{exp_id}; 89 89 return undef if !$id; 90 # fall through and lookup byexp 90 # fall through and lookup byid 91 } elsif ($img_type eq "chip") { 92 $req_type = "byid"; 93 $id = $image->{chip_id}; 94 return undef if !$id; 95 # fall through and lookup byid 91 96 } elsif ($img_type eq "warp") { 92 97 $req_type = "byid"; … … 171 176 } 172 177 178 # note $magic_arg may be cleared below depending on $req_type 173 179 my $magic_arg = $need_magic ? " -destreaked" : ""; 180 174 181 my $component_args; 175 182 if ($img_type eq "raw") { … … 229 236 $command .= " $id_opt $id"; 230 237 $command .= $component_args if $component_args; 238 # don't include -destreaked if lookup is byid. Let pstampparse check so that the 239 # error code returned to the client for a given component is 'not destreaked' 240 # instead of 'not found' 241 $magic_arg = ""; 231 242 } elsif ($req_type eq "byexp") { 232 243 $command .= " -exp_name $id"; 233 244 $command .= $component_args if $component_args; 245 # don't include -destreaked if lookup is byexp. Let pstampparse check so that the error code gives 246 # the reason as 'not destreaked' 247 $magic_arg = ""; 234 248 } elsif ($req_type eq "byskycell") { 235 249 die "tess_id and component are required for byskycell" if !$tess_id or ! $skycell_id; … … 237 251 } elsif ($req_type eq "bycoord") { 238 252 $command .= " -radius 3.0 -ra $x -decl $y"; 253 if ($img_type ne "raw") { 254 $command .= " -tess_id $tess_id" if $tess_id; 255 $command .= " -skycell_id $skycell_id" if $skycell_id; 256 } 239 257 } else { 240 258 die "Unknown req_type supplied: $req_type"; … … 299 317 # (we do this here for raw stage) 300 318 $out->{image} = $image->{uri}; 319 301 320 if ($set_class_id) { 302 321 $class_id = $image->{class_id}; 303 322 $out->{component} = $class_id; 323 } else { 324 $out->{component} = $image->{skycell_id}; 304 325 } 305 326 my $stage_id; … … 307 328 $stage_id = $image->{exp_id}; 308 329 } elsif ($img_type eq "chip") { 309 $stage_id = $image->{chip };330 $stage_id = $image->{chip_id}; 310 331 } elsif ($img_type eq "warp") { 311 332 $stage_id = $image->{warp_id}; … … 315 336 $stage_id = $image->{stack_id}; 316 337 } 317 $ image->{stage_id} = $stage_id;318 $ image->{stage} = $img_type;319 $ image->{image_db} = $image_db;338 $out->{stage_id} = $stage_id; 339 $out->{stage} = $img_type; 340 $out->{image_db} = $image_db; 320 341 321 342 # find the mask and weight images … … 402 423 } 403 424 404 my ($warp_id, $exp_id, $exp_name );425 my ($warp_id, $exp_id, $exp_name, $chip_id, $cam_id); 405 426 if ($inverse and !$image->{bothways}) { 406 427 print STDERR "Inverse images requested for diffRun that is not bothways. Ignoring.\n"; … … 411 432 $exp_id = $image->{exp_id_2}; 412 433 $exp_name = $image->{exp_name_2}; 434 $chip_id = $image->{chip_id_2}; 435 $cam_id = $image->{cam_id_2}; 413 436 } else { 414 437 $warp_id = $image->{warp1}; 415 438 $exp_id = $image->{exp_id_1}; 416 439 $exp_name = $image->{exp_name_1}; 440 $chip_id = $image->{chip_id_1}; 441 $cam_id = $image->{cam_id_1}; 417 442 } 418 443 # XXX difftool currently returns max long long for null … … 422 447 $image->{exp_id} = $exp_id; 423 448 $image->{exp_name} = $exp_name; 449 $image->{chip_id} = $chip_id; 450 $image->{cam_id} = $cam_id; 424 451 } else { 425 452 print STDERR "unexpected result warp_id not defined\n"; … … 561 588 } 562 589 563 # If there are multiple cam runs for this exposure, take the last one 564 # assuming that it has the best astrometry 565 my $camdata = pop @$camruns; 590 # If there are multiple cam runs for this exposure, take the last completed one 591 # on the assumption that it has the best astrometry. 592 my $camdata; 593 while ($camdata = pop @$camruns) { 594 last if (($camdata->{quality} eq 0) and ($camdata->{fault} eq 0)); 595 } 566 596 if (!$camdata) { 567 597 # no cam runs for this exposure id therefore best astrometry is whatever is in the header
Note:
See TracChangeset
for help on using the changeset viewer.
