Changeset 24962 for trunk/pstamp/scripts/pstampparse.pl
- Timestamp:
- Jul 31, 2009, 3:35:30 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstampparse.pl
r24944 r24962 146 146 $stage = $row->{IMG_TYPE}; 147 147 my $id = $row->{ID}; 148 my $class_id = $row->{CLASS_ID};149 148 my $component = $row->{COMPONENT}; 150 149 … … 159 158 160 159 my $skycenter = $row->{skycenter} = ! ($row->{COORD_MASK} & $PSTAMP_CENTER_IN_PIXELS); 161 $class_id = "" if (defined($class_id) and ($class_id eq "null" or $class_id eq "all"));162 160 $component = "" if (defined($component) and ($component eq "null" or $component eq "all")); 163 161 … … 178 176 if (@rowList) { 179 177 my $firstRow = $rowList[0]; 180 # the collecting might work with !$skycenter but I need to think about it178 # XXX: the collecting might work with !$skycenter but I need to think about it 181 179 if ($skycenter and same_images_of_interest($row, $firstRow)) { 182 180 push @rowList, $row; … … 185 183 } else { 186 184 # queue the jobs for this set of rows 187 $num_jobs += queueJobs($mode, $stage, $need_magic,\@rowList, $imageList);185 $num_jobs += queueJobs($mode, \@rowList, $imageList); 188 186 @rowList = (); 189 187 } … … 198 196 # request specification. An array reference is returned 199 197 my ($x, $y); 200 $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $c lass_id, $skycenter,198 $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $component, $skycenter, 201 199 $x, $y, $mjd_min, $mjd_max, $filter, $verbose); 202 200 } … … 206 204 next; 207 205 } 206 $row->{need_magic} = $need_magic; 208 207 push @rowList, $row; 209 208 } 210 209 211 210 if (@rowList) { 212 $num_jobs += queueJobs($mode, $stage, $need_magic,\@rowList, $imageList);211 $num_jobs += queueJobs($mode, \@rowList, $imageList); 213 212 } 214 213 … … 229 228 { 230 229 my $row = shift; 230 my $stage = shift; 231 231 my $imageList = shift; 232 232 my $have_skycells = shift; … … 237 237 foreach my $image (@$imageList) { 238 238 my $component; 239 my $class_id; # get rid of this use componet240 239 if ($have_skycells) { 241 240 $component = $image->{skycell_id}; 242 241 } else { 243 242 $component = $image->{class_id}; 244 $class_id = $component;245 243 } 246 244 … … 252 250 my $roi_string; 253 251 254 # XXX we're depending on other code to insure valid values for roi components 255 # this is checked in and ppstamp but I should check here so that we don't get that far, 256 # but not today 252 # note values were insured to be numbers in validROI() 257 253 my $x = $row->{CENTER_X}; 258 254 my $y = $row->{CENTER_Y}; … … 282 278 283 279 my $args = $roi_string ? $roi_string : ""; 284 $args .= " -class_id $class_id" if $class_id; 280 if ($stage eq "raw" or $stage eq "chip") { 281 $args .= " -class_id $component" if $component; 282 } 285 283 286 284 $job_num++; 287 288 my $output_base = "$out_dir/${rownum}_${job_num}";289 my $argslist = "${output_base}.argslist";290 285 291 286 # add astrometry file for raw and chip images if one is available … … 300 295 } 301 296 if (($row->{OPTION_MASK} & $PSTAMP_SELECT_WEIGHT) and $image->{weight} ) { 302 $args .= " -weight $image->{weight}"; 303 } 297 $args .= " -variance $image->{weight}"; 298 } 299 300 my $output_base = "$out_dir/${rownum}_${job_num}"; 301 my $argslist = "${output_base}.args"; 304 302 305 303 # copy the argument list to a file … … 314 312 315 313 $num_jobs++; 316 my $command = "$pstamptool -addjob -req_id $req_id -job_type $row->{JOB_TYPE}" 317 . " -uri $argslist -outputBase $output_base -rownum $rownum" 318 . " -state $newState"; 319 # $command .= " -args '$args'" if $args; 314 my $command = "$pstamptool -addjob -req_id $req_id -job_type $row->{JOB_TYPE}" 315 . " -outputBase $output_base -rownum $rownum -state $newState"; 320 316 $command .= " -exp_id $exp_id" if $exp_id; 321 317 $command .= " -dbname $dbname" if $dbname; … … 326 322 # this is sort of like the mode -noupdate that some other tools support 327 323 print "$command\n"; 328 } els e{324 } elsif (!$no_update) { 329 325 # mode eq "queue_job" 330 326 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 337 333 die "failed to queue job for request $req_id"; 338 334 } 335 } else { 336 print "skipping command: $command\n"; 339 337 } 340 338 } … … 345 343 { 346 344 my $mode = shift; 347 my $stage = shift;348 my $need_magic = shift;349 345 my $rowList = shift; 350 346 my $imageList = shift; 351 347 352 348 my $firstRow = $rowList[0]; 349 my $stage = $firstRow->{IMG_TYPE}; 353 350 my $job_type = $firstRow->{JOB_TYPE}; 351 my $need_magic = $firstRow->{need_magic}; 354 352 355 353 my $num_jobs = 0; … … 394 392 my $astrom = $thisRun->[0]->{astrom}; 395 393 die "no astrometry file found" if !$astrom; 396 $command .= " -astrom $astrom"; 394 my $astrom_resolved = $ipprc->file_resolve($astrom); 395 $command .= " -astrom $astrom_resolved"; 397 396 } 398 397 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 418 417 419 418 foreach my $row (@$rowList) { 420 $num_jobs += queueJobsForRow($row, $ thisRun, $have_skycells, $need_magic);419 $num_jobs += queueJobsForRow($row, $stage, $thisRun, $have_skycells, $need_magic); 421 420 } 422 421 } … … 461 460 462 461 my $image = shift @$imageList; 462 $image->{stage} = $stage; 463 463 push @runList, $image; 464 464 $last_run_id = $run_id;
Note:
See TracChangeset
for help on using the changeset viewer.
