- Timestamp:
- Jun 19, 2012, 5:24:19 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/staticsky.pl (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/ippScripts/scripts/staticsky.pl
r31662 r34041 81 81 -msg => "Required options: --sky_id --outroot --camera", 82 82 -exitval => 3, 83 ) unless 83 ) unless 84 84 defined $sky_id and 85 85 defined $outroot and … … 89 89 90 90 my $logDest = $ipprc->filename("LOG.EXP", $outroot); 91 $ipprc->redirect_ output($logDest) or my_die( "Unable to redirect output", $sky_id, $PS_EXIT_SYS_ERROR ) if $redirect;91 $ipprc->redirect_to_logfile($logDest) or my_die( "Unable to redirect output", $sky_id, $PS_EXIT_SYS_ERROR ) if $redirect; 92 92 93 93 my $traceDest = $ipprc->filename("TRACE.EXP", $outroot); … … 120 120 121 121 122 # generate the input 122 # generate the input 123 123 print $listFile "INPUT MULTI\n"; 124 124 my $nInputs = @$files; … … 144 144 my $path_base = $file->{path_base}; 145 145 print "input: $path_base\n"; 146 my $stack_id = $file->{stack_id}; 146 147 147 148 my $imageCnv = $ipprc->filename("PPSTACK.OUTPUT", $path_base ); # Image name 148 149 my $maskCnv = $ipprc->filename("PPSTACK.OUTPUT.MASK", $path_base ); # Mask name 149 150 my $weightCnv = $ipprc->filename("PPSTACK.OUTPUT.VARIANCE", $path_base ); # Weight name 151 my $expnumCnv = $ipprc->filename("PPSTACK.OUTPUT.EXPNUM", $path_base ); # Expnum name 150 152 151 153 my $imageRaw = $ipprc->filename("PPSTACK.UNCONV", $path_base ); # Image name 152 154 my $maskRaw = $ipprc->filename("PPSTACK.UNCONV.MASK", $path_base ); # Mask name 153 155 my $weightRaw = $ipprc->filename("PPSTACK.UNCONV.VARIANCE", $path_base ); # Weight name 156 my $expnumRaw = $ipprc->filename("PPSTACK.UNCONV.EXPNUM", $path_base ); # Expnum name 154 157 155 158 my $sources = $ipprc->filename("PSPHOT.OUT.CMF.MEF", $path_base ); # Sources name … … 162 165 &my_die("Couldn't find input: $maskRaw", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$maskRaw"); 163 166 &my_die("Couldn't find input: $weightRaw", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$weightRaw"); 167 &my_die("Couldn't find input: $expnumRaw", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$expnumRaw"); 164 168 &my_die("Couldn't find input: $imageCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$imageCnv"); 165 169 &my_die("Couldn't find input: $maskCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$maskCnv"); 166 170 &my_die("Couldn't find input: $weightCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$weightCnv"); 171 &my_die("Couldn't find input: $expnumCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$expnumCnv"); 167 172 &my_die("Couldn't find input: $psfCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$psfCnv"); 168 173 &my_die("Couldn't find input: $sources", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$sources"); 169 174 175 print $listFile " STACK_ID S64 " . $stack_id . "\n"; 170 176 print $listFile " RAW:IMAGE STR " . $imageRaw . "\n"; 171 177 print $listFile " RAW:MASK STR " . $maskRaw . "\n"; 172 178 print $listFile " RAW:VARIANCE STR " . $weightRaw . "\n"; 179 print $listFile " RAW:EXPNUM STR " . $expnumRaw . "\n"; 173 180 174 181 print $listFile " CNV:IMAGE STR " . $imageCnv . "\n"; 175 182 print $listFile " CNV:MASK STR " . $maskCnv . "\n"; 176 183 print $listFile " CNV:VARIANCE STR " . $weightCnv . "\n"; 184 print $listFile " CNV:EXPNUM STR " . $expnumCnv . "\n"; 177 185 print $listFile " CNV:PSF STR " . $psfCnv . "\n"; 178 186 … … 227 235 # we have one set of output files per input file set 228 236 for (my $i = 0; $i < @$files; $i++) { 229 my $outputName = $ipprc->filename("PSPHOT.STACK.OUTPUT.IMAGE", $outroot, $i); 230 my $outputMask = $ipprc->filename("PSPHOT.STACK.OUTPUT.MASK", $outroot, $i); 231 my $outputVariance = $ipprc->filename("PSPHOT.STACK.OUTPUT.VARIANCE", $outroot, $i); 232 my $outputSources = $ipprc->filename("PSPHOT.STACK.OUTPUT", $outroot, $i); 237 my $stack_id = @$files[$i]->{stack_id}; 238 my $outputName = $ipprc->filename("PSPHOT.STACK.OUTPUT.IMAGE", $outroot, $stack_id); 239 my $outputMask = $ipprc->filename("PSPHOT.STACK.OUTPUT.MASK", $outroot, $stack_id); 240 my $outputVariance = $ipprc->filename("PSPHOT.STACK.OUTPUT.VARIANCE", $outroot, $stack_id); 241 my $outputSources = $ipprc->filename("PSPHOT.STACK.OUTPUT", $outroot, $stack_id); 233 242 234 243 # XXX these are optional and not generated by default … … 248 257 249 258 # XXX check the recipe -- should we expect these to exist? 250 # &my_die("Couldn't find expected output file: $chisqName", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqName);251 # &my_die("Couldn't find expected output file: $chisqMask", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqMask);259 # &my_die("Couldn't find expected output file: $chisqName", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqName); 260 # &my_die("Couldn't find expected output file: $chisqMask", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqMask); 252 261 # &my_die("Couldn't find expected output file: $chisqVariance", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqVariance); 253 262 } … … 288 297 my $use_raw = metadataLookupBool($recipeData, 'PSPHOT.STACK.USE.RAW'); 289 298 290 my ($image, $mask, $variance );299 my ($image, $mask, $variance, $expnum); 291 300 if ($use_raw) { 292 301 $image = $ipprc->filename("PPSTACK.UNCONV", $path_base ); # Image name … … 297 306 $mask = $ipprc->filename("PPSTACK.OUTPUT.MASK", $path_base ); # Mask name 298 307 $variance = $ipprc->filename("PPSTACK.OUTPUT.VARIANCE", $path_base ); # Weight name 308 $expnum = $ipprc->filename("PPSTACK.OUTPUT.EXPNUM", $path_base ); # Weight name 299 309 } 300 310 … … 306 316 &my_die("Couldn't find input: $mask", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$mask"); 307 317 &my_die("Couldn't find input: $variance", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$variance"); 318 &my_die("Couldn't find input: $expnum", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$expnum"); 308 319 309 320 # Perform stack photometry analysis … … 313 324 $command .= " -mask $mask"; 314 325 $command .= " -variance $variance"; 326 $command .= " -expnum $expnum"; 315 327 $command .= " -threads $threads" if defined $threads; 316 328 $command .= " -recipe PSPHOT $recipe_psphot"; … … 335 347 } 336 348 337 &my_die("Couldn't find expected output file: $configuration", $sky_id, $PS_EXIT_SYS_ERROR) 349 &my_die("Couldn't find expected output file: $configuration", $sky_id, $PS_EXIT_SYS_ERROR) 338 350 unless $ipprc->file_exists($configuration); 339 351 } else { … … 348 360 { 349 361 my $command = "$staticskytool -sky_id $sky_id"; 350 $command .= " -addresult -path_base $outroot";351 $command .= " -num_inputs $nInputs";352 # $command .= " $cmdflags";353 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));354 $command .= " -hostname $host" if defined $host;362 $command .= " -addresult -path_base $outroot"; 363 $command .= " -num_inputs $nInputs"; 364 # $command .= " $cmdflags"; 365 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); 366 $command .= " -hostname $host" if defined $host; 355 367 $command .= " -dbname $dbname" if defined $dbname; 356 368 … … 360 372 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 361 373 my $err_message = "Unable to perform staticskytool -addresult"; 362 warn($err_message);363 exit $error_code;374 warn($err_message); 375 exit $error_code; 364 376 } 365 377 } … … 378 390 if (defined $sky_id and not $no_update) { 379 391 my $command = "$staticskytool -sky_id $sky_id -fault $exit_code"; 380 $command .= " -addresult";381 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));382 $command .= " -hostname $host" if defined $host;383 $command .= " -path_base $outroot" if defined $outroot;384 $command .= " -dbname $dbname" if defined $dbname;392 $command .= " -addresult"; 393 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); 394 $command .= " -hostname $host" if defined $host; 395 $command .= " -path_base $outroot" if defined $outroot; 396 $command .= " -dbname $dbname" if defined $dbname; 385 397 run(command => $command, verbose => $verbose); 386 398 }
Note:
See TracChangeset
for help on using the changeset viewer.
