- Timestamp:
- Oct 18, 2009, 10:23:28 AM (17 years ago)
- Location:
- branches/eam_branches/20090820
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090820
-
branches/eam_branches/20090820/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r25766 r25870 108 108 } elsif ($req_type eq "bycoord") { 109 109 110 # run 111 # regtool -dbname $image_db -processedimfile -time_begin $mjd_min -time_end = $mjd_max -filter $filter 112 # 113 my $results = lookup_bycoord($ipprc, $image_db, $x, $y, $dateobs_begin, $dateobs_end, $filter, $verbose); 114 115 # now take the results and lookup byexp 116 # XXX: This needs work. What stops results from returning multiple images???? 117 # We should loop over the set of images returned building up the full results array 118 $req_type = "byexp"; 119 $id = $results->{exp_name}; 110 if ($img_type eq "stack") { 111 print STDERR "Error bycoord lookup not implemented for stage stack yet\n"; 112 return undef; 113 } 120 114 } elsif ($req_type eq "byskycell") { 121 115 if (($img_type eq "raw") or ($img_type eq "chip")) { … … 129 123 } 130 124 131 my $results = lookup($ipprc, $image_db, $req_type, $img_type, $id, $tess_id, $component, $need_magic, $ dateobs_begin, $dateobs_end, $filter, $label, $verbose);125 my $results = lookup($ipprc, $image_db, $req_type, $img_type, $id, $tess_id, $component, $need_magic, $x, $y, $dateobs_begin, $dateobs_end, $filter, $label, $verbose); 132 126 133 127 return $results; 134 128 } 135 129 136 sub lookup { 130 sub lookup 131 { 137 132 my $ipprc = shift; 138 133 my $image_db = shift; … … 143 138 my $component= shift; 144 139 my $need_magic = shift; 140 my $x = shift; 141 my $y = shift; 145 142 my $dateobs_begin = shift; 146 143 my $dateobs_end = shift; … … 175 172 176 173 my $magic_arg = $need_magic ? " -destreaked" : ""; 174 my $component_args; 177 175 if ($img_type eq "raw") { 178 176 $class_id = $component; 179 177 $command = "$regtool -processedimfile -dbname $image_db"; 178 # XXX: for now restrict lookups to type object 179 # are stamps of detrend exposures interesting? 180 $command .= " -exp_type object"; 180 181 $id_opt = "-exp_id"; 181 $com mand .= " -class_id $class_id" if $component;182 $component_args = " -class_id $class_id" if $component; 182 183 $want_astrom = 1; 183 184 $set_class_id = 1; … … 185 186 $class_id = $component; 186 187 $command = "$chiptool -processedimfile -dbname $image_db"; 187 $com mand .= " -class_id $class_id" if $class_id;188 $component_args = " -class_id $class_id" if $class_id; 188 189 $id_opt = "-chip_id"; 189 190 $image_name = "PPIMAGE.CHIP"; … … 196 197 $skycell_id = $component; 197 198 $command = "$warptool -warped -dbname $image_db"; 198 $com mand .= " -skycell_id $skycell_id" if $skycell_id;199 $component_args = " -skycell_id $skycell_id" if $skycell_id; 199 200 $id_opt = "-warp_id"; 200 201 $image_name = "PSWARP.OUTPUT"; … … 205 206 $skycell_id = $component; 206 207 $command = "$difftool -diffskyfile -dbname $image_db"; 207 $com mand .= " -skycell_id $skycell_id" if $skycell_id;208 $component_args = " -skycell_id $skycell_id" if $skycell_id; 208 209 $id_opt = "-diff_id"; 209 210 $image_name = "PPSUB.OUTPUT"; … … 212 213 $base_name = "path_base"; 213 214 } elsif ($img_type eq "stack") { 215 $skycell_id = $component; 214 216 $command = "$stacktool -sumskyfile -dbname $image_db"; 215 217 $id_opt = "-stack_id"; 218 $component_args = " -skycell_id $skycell_id" if $skycell_id; 216 219 217 220 $image_name = "PPSTACK.OUTPUT"; … … 225 228 if ($req_type eq "byid") { 226 229 $command .= " $id_opt $id"; 230 $command .= $component_args if $component_args; 227 231 } elsif ($req_type eq "byexp") { 228 232 $command .= " -exp_name $id"; 233 $command .= $component_args if $component_args; 229 234 } elsif ($req_type eq "byskycell") { 235 die "tess_id and component are required for byskycell" if !$tess_id or ! $skycell_id; 230 236 $command .= " -tess_id $tess_id -skycell_id $skycell_id"; 237 } elsif ($req_type eq "bycoord") { 238 $command .= " -radius 3.0 -ra $x -decl $y"; 231 239 } else { 232 240 die "Unknown req_type supplied: $req_type"; … … 289 297 290 298 # if uri is nil this will get overridded below 291 # ( this isfor raw stage)299 # (we do this here for raw stage) 292 300 $out->{image} = $image->{uri}; 293 301 if ($set_class_id) { … … 295 303 $out->{component} = $class_id; 296 304 } 305 my $stage_id; 306 if ($img_type eq "raw") { 307 $stage_id = $image->{exp_id}; 308 } elsif ($img_type eq "chip") { 309 $stage_id = $image->{chip}; 310 } elsif ($img_type eq "warp") { 311 $stage_id = $image->{warp_id}; 312 } elsif ($img_type eq "diff") { 313 $stage_id = $image->{diff_id}; 314 } elsif ($img_type eq "stack") { 315 $stage_id = $image->{stack_id}; 316 } 317 $image->{stage_id} = $stage_id; 318 $image->{stage} = $img_type; 319 $image->{image_db} = $image_db; 297 320 298 321 # find the mask and weight images 299 322 if ($base) { 300 $out->{image} = $ipprc->filename($image_name, $base, $class_id) if $image_name;323 $out->{image} = $ipprc->filename($image_name, $base, $class_id) if $image_name; 301 324 $out->{mask} = $ipprc->filename($mask_name, $base, $class_id) if $mask_name; 302 325 $out->{weight} = $ipprc->filename($weight_name, $base, $class_id) if $weight_name;
Note:
See TracChangeset
for help on using the changeset viewer.
