Changeset 21240
- Timestamp:
- Jan 30, 2009, 2:21:39 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/PStamp/lib/PStamp/Job.pm (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PStamp/lib/PStamp/Job.pm
r21193 r21240 25 25 use PS::IPP::Config qw( :standard ); 26 26 27 ### my @images = locate_images($image_db, $req_type, $img_type, $id, $ lookup_class_id,27 ### my @images = locate_images($image_db, $req_type, $img_type, $id, $component, 28 28 ### $mjd_min, $mjd_max, $filter); 29 29 … … 34 34 my $img_type = shift; # required 35 35 my $id = shift; # required unless req_type eq bycoord 36 my $c lass_id = shift;36 my $component= shift; # class_id or skycell_id 37 37 my $x = shift; 38 38 my $y = shift; … … 66 66 $req_type = "byid"; 67 67 $id = $results->{warp_id}; 68 $component = $results->{skycell_id}; 68 69 return undef if !$id; 69 70 # fall through and lookup by warp_id … … 93 94 } 94 95 95 my $results = lookup($ipprc, $image_db, $req_type, $img_type, $id, $c lass_id, $verbose);96 my $results = lookup($ipprc, $image_db, $req_type, $img_type, $id, $component, $verbose); 96 97 97 98 return $results; … … 104 105 my $img_type = shift; 105 106 my $id = shift; 106 my $c lass_id= shift;107 my $verbose = shift;107 my $component= shift; 108 my $verbose = shift; 108 109 109 110 my $missing_tools; … … 124 125 my $want_astrom; 125 126 my $set_class_id; 127 my $class_id; 128 my $skycell_id; 126 129 127 130 # special class_id value "null" means ignore 128 if ($c lass_ideq "null") {129 $c lass_id= undef;131 if ($component eq "null") { 132 $component = undef; 130 133 } 131 134 132 135 if ($img_type eq "raw") { 136 $class_id = $component; 133 137 $command = "$regtool -processedimfile -dbname $image_db"; 134 138 $id_opt = "-exp_id"; 135 $command .= " -class_id $class_id" if $c lass_id;139 $command .= " -class_id $class_id" if $component; 136 140 $want_astrom = 1; 137 141 $set_class_id = 1; 138 142 } elsif ($img_type eq "chip") { 143 $class_id = $component; 139 144 $command = "$chiptool -processedimfile -dbname $image_db"; 140 145 $command .= " -class_id $class_id" if $class_id; … … 146 151 $set_class_id = 1; 147 152 } elsif ($img_type eq "warp") { 153 $skycell_id = $component; 148 154 $command = "$warptool -warped -dbname $image_db"; 155 $command .= " -skycell_id $skycell_id" if $skycell_id; 149 156 $id_opt = "-warp_id"; 150 157 $mask_name = "PSWARP.OUTPUT.MASK"; … … 152 159 $base_name = "path_base"; # name of the field for the warptool output 153 160 } elsif ($img_type eq "diff") { 161 $skycell_id = $component; 154 162 $command = "$difftool -diffskyfile -dbname $image_db"; 163 $command .= " -skycell_id $skycell_id" if $skycell_id; 155 164 $id_opt = "-diff_id"; 156 165 $mask_name = "PPSUB.OUTPUT.MASK"; … … 281 290 my $image = $images->[0]; 282 291 292 my $skycell_id = $image->{skycell_id}; 293 294 if ($image->{fault}) { 295 print STDERR "selected difference image $id $image->{diff_id} $skycell_id has fault: $image->{fault}\n"; 296 return undef; 297 } 298 283 299 # The standard way to do a diff is warp - stack 284 300 # so we interpret the requested image in that way 285 301 286 # XXX the query currently returns max long long for null 302 my $stack_id = $image->{stack2}; 303 # XXX difftool currently returns max long long for null 287 304 # this line is ready if we switch the code to return zero for null 288 my $stack_id = $image->{stack_id_temp_1};289 305 if ($stack_id and ($stack_id != 9223372036854775807)) { 290 306 $image->{stack_id} = $stack_id; 291 307 } 292 308 293 # XXX the query currently returns max long long for null 309 my $warp_id = $image->{warp1}; 310 # XXX difftool currently returns max long long for null 294 311 # this line is ready if we switch the code to return zero for null 295 my $warp_id = $image->{warp_id_temp_0};296 312 if ($warp_id and ($warp_id != 9223372036854775807)) { 297 313 $image->{warp_id} = $warp_id; 298 314 299 315 ## now use the warp and go get the exposure information 300 $command = "warptool -warped -warp_id $warp_id - dbname $image_db -limit 1";316 $command = "warptool -warped -warp_id $warp_id -skycell_id $skycell_id -dbname $image_db -limit 1"; 301 317 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 302 318 run(command => $command, verbose => $verbose);
Note:
See TracChangeset
for help on using the changeset viewer.
