Changeset 25712 for trunk/pstamp
- Timestamp:
- Oct 1, 2009, 10:07:51 AM (17 years ago)
- Location:
- trunk/pstamp/scripts
- Files:
-
- 3 edited
-
pstamp_finish.pl (modified) (2 diffs)
-
pstamp_job_run.pl (modified) (4 diffs)
-
pstampparse.pl (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstamp_finish.pl
r25540 r25712 81 81 my $fileset = $req_name; 82 82 83 84 # Here we invoke the assumption that the output for the request is placed in the85 # fileset directory directly86 # my $out_dir = "$outputDataStoreRoot/$product/$fileset";87 88 # now we are assuming that the output directory is the dirname of the request file89 # XXX: put this in the database90 91 83 print STDERR "product: $product REQ_NAME: $req_name $out_dir\n" if $verbose; 92 84 … … 216 208 217 209 # ra_deg and dec_deg are the coordinates of center of the stamp 218 # XXX: parse the stamp header to find it 219 print $tdf "0.0|0.0|"; 210 # XXX do this more cleanly 211 my (undef, $ra_deg, $dec_deg) = split " ", `echo $out_dir/$img_name | fields RA_DEG DEC_DEG`; 212 $ra_deg = 0.0 if (!$ra_deg); 213 $dec_deg = 0.0 if (!$dec_deg); 214 print $tdf "$ra_deg|$dec_deg|"; 220 215 221 216 print $tdf "$exp_info|"; -
trunk/pstamp/scripts/pstamp_job_run.pl
r25369 r25712 16 16 use PS::IPP::PStamp::RequestFile qw( :standard ); 17 17 use IPC::Cmd 0.36 qw( can_run run ); 18 use POSIX; 18 19 19 20 use PS::IPP::Metadata::Config; … … 93 94 run(command => $command, verbose => $verbose); 94 95 95 if ($success) { 96 my $exitStatus; 97 if (WIFEXITED($error_code)) { 98 $exitStatus = WEXITSTATUS($error_code); 99 } else { 100 print STDERR "ppstamp failed error_code: $error_code\n"; 101 $exitStatus = $PS_EXIT_SYS_ERROR; 102 } 103 104 if ($exitStatus == 0) { 96 105 my $dir = dirname($outputBase); 97 106 … … 133 142 close F; 134 143 $jobStatus = $PS_EXIT_SUCCESS; 135 } else { 136 $jobStatus = $error_code >> 8; 137 my_die( "ppstamp failed with error code: $jobStatus", $job_id, $jobStatus); 144 } elsif ($exitStatus == $PSTAMP_NO_OVERLAP) { 145 $jobStatus = $PSTAMP_NO_OVERLAP 146 } else { 147 my_die( "ppstamp failed with error code: $exitStatus", $job_id, $exitStatus); 138 148 } 139 149 } elsif ($jobType eq "get_image") { … … 162 172 { 163 173 my $command = "$pstamptool -updatejob -job_id $job_id -state stop"; 174 $command .= " -fault $jobStatus" if $jobStatus; 164 175 $command .= " -dbname $dbname" if $dbname; 165 176 $command .= " -dbserver $dbserver" if $dbserver; -
trunk/pstamp/scripts/pstampparse.pl
r25540 r25712 16 16 use File::Basename qw(basename); 17 17 use Carp; 18 use POSIX qw( strftime );18 use POSIX; 19 19 20 20 my $verbose; … … 72 72 } 73 73 74 # list_job is a deugging mode 74 75 $no_update = 1 if $mode eq "list_job"; 75 76 … … 185 186 } 186 187 my $req_type = $row->{REQ_TYPE}; 187 $stage = $row->{IMG_TYPE};188 my $id = $row->{ID};188 $stage = $row->{IMG_TYPE}; 189 my $id = $row->{ID}; 189 190 my $component = $row->{COMPONENT}; 190 191 my $filter = $row->{REQFILT}; 191 my $tess_id = $row->{TESS_ID}; 192 193 my $filter = $row->{REQFILT}; 192 194 my $mjd_min = $row->{MJD_MIN}; 193 195 my $mjd_max = $row->{MJD_MAX}; 196 my $label = $row->{LABEL}; 194 197 195 198 my $option_mask= $row->{OPTION_MASK}; … … 222 225 my_die("job_type is list_uri but mode is $mode", $PS_EXIT_PROG_ERROR) if ($job_type eq "list_uri") and ($mode ne "list_uri"); 223 226 224 225 227 my $image_db = $proj_hash->{dbname}; 226 228 my $camera = $proj_hash->{camera}; … … 228 230 229 231 # Temporary hack so that MOPS can get at non-magicked data 230 if ($product eq "mops-pstamp-results") {232 if ($product and ($product eq "mops-pstamp-results")) { 231 233 $need_magic = 0; 232 234 } … … 269 271 my ($x, $y); 270 272 271 $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $ search_component,272 $inverse, $ skycenter, $x, $y, $mjd_min, $mjd_max, $filter, $verbose);273 $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $tess_id, $search_component, 274 $inverse, $need_magic, $x, $y, $mjd_min, $mjd_max, $filter, $label, $verbose); 273 275 274 276 if (!$imageList or !@$imageList) { … … 305 307 my $num_jobs = 0; 306 308 my $rownum = $row->{ROWNUM}; 309 my $option_mask = $row->{OPTION_MASK}; 307 310 my $components = $row->{components}; 308 311 … … 346 349 if (($stage ne "stack") and ($need_magic and !$image->{magicked})) { 347 350 # XXX: should we add a faulted job so the client can know what happened if no images come back? 351 # This test is made in locate_images now so this code never runs. This leads to no feedback 352 # to users, but speeds up processing significatnly 348 353 print STDERR "skipping non-magicked image $imagefile\n" if $verbose; 349 354 … … 369 374 $args .= " -file $imagefile"; 370 375 371 if (($ row->{OPTION_MASK}& $PSTAMP_SELECT_MASK) && $image->{mask} ) {376 if (($option_mask & $PSTAMP_SELECT_MASK) && $image->{mask} ) { 372 377 $args .= " -mask $image->{mask}"; 373 378 } 374 if (($ row->{OPTION_MASK}& $PSTAMP_SELECT_WEIGHT) and $image->{weight} ) {379 if (($option_mask & $PSTAMP_SELECT_WEIGHT) and $image->{weight} ) { 375 380 $args .= " -variance $image->{weight}"; 376 381 } … … 407 412 $num_jobs++; 408 413 my $command = "$pstamptool -addjob -req_id $req_id -job_type $row->{JOB_TYPE}" 409 . " -outputBase $output_base -rownum $rownum -state $newState ";414 . " -outputBase $output_base -rownum $rownum -state $newState -options $option_mask"; 410 415 $command .= " -fault $fault" if $fault; 411 416 $command .= " -exp_id $exp_id" if $exp_id; … … 542 547 run(command => $command, verbose => $verbose); 543 548 unless ($success) { 544 print STDERR @$stderr_buf; 545 my $rc = $error_code >> 8; 546 my_die( "dvoImagesAtCoords failed: $rc", $PS_EXIT_UNKNOWN_ERROR); 549 # don't fail if the program exited normally and exit status was PSTAMP_NO_OVERLAP 550 # That just means that the coordinate didn't match any image/skycell 551 if (!WIFEXITED($error_code) || (WEXITSTATUS($error_code) ne $PSTAMP_NO_OVERLAP)) { 552 print STDERR @$stderr_buf; 553 my $rc = WIFEXITED($error_code) ? WEXITSTATUS($error_code) : $PS_EXIT_SYS_ERROR; 554 my_die( "dvoImagesAtCoords failed: $rc", $rc); 555 } 547 556 } 548 557 # now we have a list of row numbers and components
Note:
See TracChangeset
for help on using the changeset viewer.
