- Timestamp:
- Mar 5, 2012, 5:19:48 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
pstamp/scripts (modified) (1 prop)
-
pstamp/scripts/pstamp_job_run.pl (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/pstamp/scripts
- Property svn:mergeinfo set to
-
branches/meh_branches/ppstack_test/pstamp/scripts/pstamp_job_run.pl
r31508 r33415 59 59 $options = 1 if !$options; 60 60 61 # We don't need to muggle anymore. Ignore those options 62 $options &= ~($PSTAMP_REQUEST_UNCENSORED | $PSTAMP_REQUIRE_UNCENSORED); 61 63 62 64 my $ipprc = PS::IPP::Config->new(); # IPP Configuration … … 77 79 my $ppstamp = can_run('ppstamp') or (warn "Can't find ppstamp" and $missing_tools = 1); 78 80 my $pstamp_get_image_job = can_run('pstamp_get_image_job.pl') or (warn "Can't find pstamp_get_image_job.pl" and $missing_tools = 1); 79 my $dquery parse = can_run('dqueryparse.pl') or (warn "Can't find dqueryparse.pl" and $missing_tools = 1);81 my $dquery_job_run = can_run('dquery_job_run.pl') or (warn "Can't find dquery_job_run.pl" and $missing_tools = 1); 80 82 my $streaksreplace = can_run('streaksreplace') or (warn "Can't find streaksreplace" and $missing_tools = 1); 81 83 my $magicdstool = can_run('magicdstool') or (warn "Can't find magicdstool" and $missing_tools = 1); … … 87 89 88 90 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 91 89 92 90 93 my $jobStatus; … … 107 110 $nan_masked = 0; 108 111 $muggle = 1; 112 } 113 114 if ($stage eq "raw") { 115 $options &= ~($PSTAMP_SELECT_MASK | $PSTAMP_SELECT_VARIANCE); 109 116 } 110 117 … … 214 221 } 215 222 223 # MAGIC IS DEAD 224 $nan_masked = 0; 225 216 226 my $command = "$ppstamp $outputBase $argString $fileArgs"; 227 $command .= " -write_jpeg" if ($options & $PSTAMP_SELECT_JPEG); 217 228 $command .= " -dbname $dbname" if $dbname; 218 229 $command .= " -dbserver $dbserver" if $dbserver; … … 239 250 240 251 # Note: we are assuming the contents of the PSTAMP filerules here. 241 my %extensions = ( $PSTAMP_SELECT_IMAGE => "fits", 242 $PSTAMP_SELECT_MASK => "mk.fits", 243 $PSTAMP_SELECT_VARIANCE => "wt.fits"); 244 245 my $output_mask = $options & ($PSTAMP_SELECT_IMAGE | $PSTAMP_SELECT_MASK | $PSTAMP_SELECT_VARIANCE); 252 my %extensions = ( $PSTAMP_SELECT_IMAGE => "fits", 253 $PSTAMP_SELECT_MASK => "mk.fits", 254 $PSTAMP_SELECT_VARIANCE => "wt.fits", 255 $PSTAMP_SELECT_JPEG => "jpg"); 256 257 my $output_mask = $options & ($PSTAMP_SELECT_IMAGE | $PSTAMP_SELECT_MASK | $PSTAMP_SELECT_VARIANCE | $PSTAMP_SELECT_JPEG); 246 258 247 259 foreach my $key (keys (%extensions)) { … … 272 284 } elsif ($jobType eq "get_image") { 273 285 274 my $uri = ""; 286 my $pstamp_bundle_root = metadataLookupStr($ipprc->{_siteConfig}, "PSTAMP_BUNDLE_ROOT"); 287 288 my $params = read_params_file($outputBase); 289 my $imagedb = $params->{imagedb}; 290 275 291 my $command = "$pstamp_get_image_job --job_id $job_id --output_base $outputBase --rownum $rownum"; 292 $command .= " --bundleroot $pstamp_bundle_root" if $pstamp_bundle_root; 293 $command .= " --imagedb $imagedb" if $imagedb; 276 294 $command .= " --dbname $dbname" if $dbname; 277 295 $command .= " --dbserver $dbserver" if $dbserver; … … 287 305 } 288 306 } elsif ($jobType eq "detect_query") { 289 # detect_query jobs are basically holders to note that we need a file updated before we can continue. 290 # Load the argument list that dqueryparse should have created the first time it ran, so we know how to 291 # run it again the same way. 292 my $argslist = "$outputBase/parse.args"; 293 open ARGSLIST, "<$argslist" or my_die("failed to open argslist file $argslist", $job_id, $PS_EXIT_UNKNOWN_ERROR); 294 my $argString = <ARGSLIST>; 295 close ARGSLIST; 296 chomp $argString; 307 # my $outdir = dirname($outputBase); 308 # my $argslist = "$outdir/parse.args"; 309 # open ARGSLIST, "<$argslist" or my_die("failed to open argslist file $argslist", $job_id, $PS_EXIT_UNKNOWN_ERROR); 310 # my $argString = <ARGSLIST>; 311 # close ARGSLIST; 312 # chomp $argString; 297 313 298 314 # XXX: should we do any other sanity checking? 299 my_die("arglist file $argslist is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString;300 301 my $command = "$dquery parse --job_id $job_id $argString";315 # my_die("arglist file $argslist is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString; 316 317 my $command = "$dquery_job_run --job_id $job_id --output_base $outputBase"; 302 318 $command .= " --dbname $dbname" if $dbname; 303 319 $command .= " --dbserver $dbserver" if $dbserver; 304 320 $command .= " --verbose" if $verbose; 321 $command .= " --save-temps" if $save_temps; 305 322 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 306 323 run(command => $command, verbose => $verbose); … … 311 328 } else { 312 329 $jobStatus = $error_code >> 8; 313 my_die("dqueryparse.pl failed with error code: $jobStatus", $job_id, $jobStatus); 314 } 330 my_die("dquery_job_run.pl failed with error code: $jobStatus", $job_id, $jobStatus); 331 } 332 } elsif ($jobType eq "child") { 333 # the only thing jobs of jobType child is to finish 334 $jobStatus = 0; 315 335 } else { 316 336 my_die("unknown jobType $jobType found", $job_id, $PS_EXIT_PROG_ERROR); … … 597 617 598 618 $exit_code = $PS_EXIT_PROG_ERROR unless $exit_code; 619 if ($exit_code > 100) { 620 carp ("invalid exit code: $exit_code changing to $PS_EXIT_UNKNOWN_ERROR"); 621 $exit_code = $PS_EXIT_UNKNOWN_ERROR; 622 } 599 623 $job_state = 'run' unless $job_state; 600 624
Note:
See TracChangeset
for help on using the changeset viewer.
