Changeset 25776
- Timestamp:
- Oct 5, 2009, 2:17:58 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm (modified) (9 diffs)
-
pstamp/scripts/pstampparse.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r25712 r25776 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; … … 143 137 my $component= shift; 144 138 my $need_magic = shift; 139 my $x = shift; 140 my $y = shift; 145 141 my $dateobs_begin = shift; 146 142 my $dateobs_end = shift; … … 175 171 176 172 my $magic_arg = $need_magic ? " -destreaked" : ""; 173 my $component_args; 177 174 if ($img_type eq "raw") { 178 175 $class_id = $component; 179 176 $command = "$regtool -processedimfile -dbname $image_db"; 177 # XXX: for now restrict lookups to type object 178 # are stamps of detrend exposures interesting? 179 $command .= " -exp_type object"; 180 180 $id_opt = "-exp_id"; 181 $com mand .= " -class_id $class_id" if $component;181 $component_args = " -class_id $class_id" if $component; 182 182 $want_astrom = 1; 183 183 $set_class_id = 1; … … 185 185 $class_id = $component; 186 186 $command = "$chiptool -processedimfile -dbname $image_db"; 187 $com mand .= " -class_id $class_id" if $class_id;187 $component_args = " -class_id $class_id" if $class_id; 188 188 $id_opt = "-chip_id"; 189 189 $image_name = "PPIMAGE.CHIP"; … … 196 196 $skycell_id = $component; 197 197 $command = "$warptool -warped -dbname $image_db"; 198 $com mand .= " -skycell_id $skycell_id" if $skycell_id;198 $component_args = " -skycell_id $skycell_id" if $skycell_id; 199 199 $id_opt = "-warp_id"; 200 200 $image_name = "PSWARP.OUTPUT"; … … 205 205 $skycell_id = $component; 206 206 $command = "$difftool -diffskyfile -dbname $image_db"; 207 $com mand .= " -skycell_id $skycell_id" if $skycell_id;207 $component_args = " -skycell_id $skycell_id" if $skycell_id; 208 208 $id_opt = "-diff_id"; 209 209 $image_name = "PPSUB.OUTPUT"; … … 212 212 $base_name = "path_base"; 213 213 } elsif ($img_type eq "stack") { 214 $skycell_id = $component; 214 215 $command = "$stacktool -sumskyfile -dbname $image_db"; 215 216 $id_opt = "-stack_id"; 217 $component_args = " -skycell_id $skycell_id" if $skycell_id; 216 218 217 219 $image_name = "PPSTACK.OUTPUT"; … … 225 227 if ($req_type eq "byid") { 226 228 $command .= " $id_opt $id"; 229 $command .= $component_args if $component_args; 227 230 } elsif ($req_type eq "byexp") { 228 231 $command .= " -exp_name $id"; 232 $command .= $component_args if $component_args; 229 233 } elsif ($req_type eq "byskycell") { 234 die "tess_id and component are required for byskycell" if !$tess_id or ! $skycell_id; 230 235 $command .= " -tess_id $tess_id -skycell_id $skycell_id"; 236 } elsif ($req_type eq "bycoord") { 237 $command .= " -radius 3.0 -ra $x -decl $y"; 231 238 } else { 232 239 die "Unknown req_type supplied: $req_type"; -
trunk/pstamp/scripts/pstampparse.pl
r25739 r25776 195 195 my $mjd_max = $row->{MJD_MAX}; 196 196 my $label = $row->{LABEL}; 197 my $x = $row->{CENTER_X}; 198 my $y = $row->{CENTER_Y}; 197 199 198 200 my $option_mask= $row->{OPTION_MASK}; … … 205 207 206 208 if (!$skycenter and !$search_component) { 207 print STDERR "COMPONENT must be specified for pixel coordinate ROI \n" if $verbose;209 print STDERR "COMPONENT must be specified for pixel coordinate ROI center\n" if $verbose; 208 210 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 209 211 $num_jobs++; … … 213 215 $search_component = "" if $search_component eq "all"; 214 216 215 if (( $job_type eq "stamp") and ! validROI($row)) {217 if ((($job_type eq "stamp") or ($req_type eq "bycoord")) and ! validROI($row)) { 216 218 print STDERR "invalid ROI for row $rownum\n" if $verbose; 217 219 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); … … 262 264 next; 263 265 } 264 print STDERR "lookup bycoord is not yet implemented" if $verbose;265 insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED);266 $num_jobs++;267 next;268 } else {269 # Call PS::IPP::PStamp::Job locate_images subroutine to get the images for this270 # request specification. An array reference is returned.271 my ($x, $y);272 273 $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $tess_id, $search_component,266 if ($stage eq "stack") { 267 print STDERR "lookup bycoord is not yet implemented for stage stack" if $verbose; 268 insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED); 269 $num_jobs++; 270 next; 271 } 272 } 273 # Call PS::IPP::PStamp::Job locate_images subroutine to get the images for this 274 # request specification. An array reference is returned. 275 $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $tess_id, $search_component, 274 276 $inverse, $need_magic, $x, $y, $mjd_min, $mjd_max, $filter, $label, $verbose); 275 277 276 if (!$imageList or !@$imageList) { 277 print STDERR "no matching images found for row $rownum\n" if $verbose; 278 # note in this case queueJobs inserts the fake job for these rows 279 } 280 $row->{need_magic} = $need_magic; 281 push @rowList, $row; 282 } 278 if (!$imageList or !@$imageList) { 279 print STDERR "no matching images found for row $rownum\n" if $verbose; 280 # note in this case queueJobs inserts the fake job for these rows 281 } 282 $row->{need_magic} = $need_magic; 283 push @rowList, $row; 283 284 } 284 285
Note:
See TracChangeset
for help on using the changeset viewer.
