Changeset 31271 for trunk/ippScripts/scripts/staticsky.pl
- Timestamp:
- Apr 11, 2011, 3:36:56 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/staticsky.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/staticsky.pl
r31247 r31271 100 100 # Recipes to use based on reduction class 101 101 $reduction = 'DEFAULT' unless defined $reduction; 102 my $recipe_psphot = $ipprc->reduction($reduction, 'STACKPHOT_PSPHOT'); # Recipe to use for psphot103 my $recipe_ppsub = $ipprc->reduction($reduction, 'STACKPHOT_PPSUB'); # Recipe to use for ppsub104 my $recipe_ppstack = $ipprc->reduction($reduction, 'STACKPHOT_PPSTACK'); # Recipe to use for ppstack105 unless ($recipe_psphot) {106 &my_die("Couldn't find selected reduction for STACKPHOT: $reduction\n", $sky_id, $PS_EXIT_CONFIG_ERROR);107 }108 109 print "reduction: $reduction\n";110 print "recipe_psphot: $recipe_psphot\n";111 print "recipe_ppsub: $recipe_ppsub\n";112 print "recipe_ppstack: $recipe_ppstack\n";113 102 114 103 … … 118 107 119 108 if ($nInputs > 1) { 109 my $recipe_psphot = $ipprc->reduction($reduction, 'STACKPHOT_PSPHOT'); # Recipe to use for psphot 110 my $recipe_ppsub = $ipprc->reduction($reduction, 'STACKPHOT_PPSUB'); # Recipe to use for ppsub 111 my $recipe_ppstack = $ipprc->reduction($reduction, 'STACKPHOT_PPSTACK'); # Recipe to use for ppstack 112 unless ($recipe_psphot) { 113 &my_die("Couldn't find selected reduction for STACKPHOT: $reduction\n", $sky_id, $PS_EXIT_CONFIG_ERROR); 114 } 115 116 print "reduction: $reduction\n"; 117 print "recipe_psphot: $recipe_psphot\n"; 118 print "recipe_ppsub: $recipe_ppsub\n"; 119 print "recipe_ppstack: $recipe_ppstack\n"; 120 120 my $configuration = $ipprc->filename("PSPHOT.STACK.CONFIG", $outroot); 121 121 … … 177 177 $command .= " -tracedest $traceDest -log $logDest"; 178 178 # $command .= " -dbname $dbname" if defined $dbname; 179 # $command .= " -image_id $diff_skyfile_id" if defined $diff_skyfile_id;180 # $command .= " -source_id $source_id" if defined $source_id;181 179 182 180 unless ($no_op) { … … 242 240 } else { 243 241 # single input. Run psphot 244 my $configuration = $ipprc->filename("PSPHOT.STACK.CONFIG", $outroot); 242 # find the recipe 243 my $recipe_psphot = $ipprc->reduction($reduction, 'STACKPHOT_SINGLE_PSPHOT'); # Recipe to use for psphot 244 unless ($recipe_psphot) { 245 &my_die("Couldn't find selected reduction for STACKPHOT: $reduction\n", $sky_id, $PS_EXIT_CONFIG_ERROR); 246 } 247 248 print "reduction: $reduction\n"; 249 print "recipe_psphot: $recipe_psphot\n"; 250 251 my $configuration = $ipprc->filename("PSPHOT.SKY.CONFIG", $outroot); 245 252 246 253 my $file = $files->[0]; … … 274 281 } 275 282 276 my $sources = $ipprc->filename("PSPHOT.OUT.CMF.MEF", $path_base ); # Sources name 277 278 # XXX is this the correct PSF file? 279 my $psfCnv = $ipprc->filename("PPSTACK.TARGET.PSF", $path_base ); # PSF name 283 my $output_sources_filerule = "PSPHOT.OUT.CMF.MEF"; 284 my $output_psf_filerule = "PSPHOT.PSF.SKY.SAVE"; 280 285 281 286 # XXX we could make some different choices if some inputs do not exist... … … 283 288 &my_die("Couldn't find input: $mask", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$mask"); 284 289 &my_die("Couldn't find input: $variance", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$variance"); 285 &my_die("Couldn't find input: $psfCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$psfCnv");286 &my_die("Couldn't find input: $sources", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$sources");287 288 # my $cmdflags;289 290 290 291 # Perform stack photometry analysis … … 298 299 $command .= " -dumpconfig $configuration" if $configuration; 299 300 $command .= " -tracedest $traceDest -log $logDest"; 301 $command .= " -F PSPHOT.OUTPUT $output_sources_filerule"; 302 $command .= " -F PSPHOT.PSF.SAVE $output_psf_filerule"; 300 303 301 304 unless ($no_op) { … … 303 306 unless ($success) { 304 307 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 305 &my_die("Unable to perform psphot Stack: $error_code", $sky_id, $error_code);308 &my_die("Unable to perform psphot: $error_code", $sky_id, $error_code); 306 309 } 307 310 308 # my $outputStatsReal = $ipprc->file_resolve($outputStats);309 # &my_die("Couldn't find expected output file: $outputStats", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStatsReal);310 311 # measure chip stats312 # $command = "$ppStatsFromMetadata $outputStatsReal - DIFF_SKYCELL";313 # ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =314 # run(command => $command, verbose => $verbose);315 # unless ($success) {316 # $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);317 # &my_die("Unable to perform ppStatsFromMetadata: $error_code", $sky_id, $error_code);318 # }319 # foreach my $line (@$stdout_buf) {320 # $cmdflags .= " $line";321 # }322 # chomp $cmdflags;323 324 # my ($quality) = $cmdflags =~ /-quality (\d+)/; # Quality flag325 326 311 my $quality = 0; 327 if (0 and !$quality) { 328 329 # Get the output filenames 330 # we have one set of output files per input file set 331 for (my $i = 0; $i < @$files; $i++) { 332 my $outputName = $ipprc->filename("PSPHOT.STACK.OUTPUT.IMAGE", $outroot, $i); 333 my $outputMask = $ipprc->filename("PSPHOT.STACK.OUTPUT.MASK", $outroot, $i); 334 my $outputVariance = $ipprc->filename("PSPHOT.STACK.OUTPUT.VARIANCE", $outroot, $i); 335 my $outputSources = $ipprc->filename("PSPHOT.STACK.OUTPUT", $outroot, $i); 336 337 # XXX these are optional and not generated by default 338 # &my_die("Couldn't find expected output file: $outputName", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputName); 339 # &my_die("Couldn't find expected output file: $outputMask", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask); 340 # &my_die("Couldn't find expected output file: $outputVariance", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputVariance); 341 &my_die("Couldn't find expected output file: $outputSources", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources); 342 } 343 344 #my $configuration = $ipprc->filename("PPSUB.CONFIG", $outroot); 345 #my $outputStats = $ipprc->filename("SKYCELL.STATS", $outroot); 346 #my $traceDest = $ipprc->filename("TRACE.EXP", $outroot); 347 348 my $chisqName = $ipprc->filename("PSPHOT.CHISQ.IMAGE", $outroot); 349 my $chisqMask = $ipprc->filename("PSPHOT.CHISQ.MASK", $outroot); 350 my $chisqVariance = $ipprc->filename("PSPHOT.CHISQ.VARIANCE", $outroot); 351 352 # XXX check the recipe -- should we expect these to exist? 353 # &my_die("Couldn't find expected output file: $chisqName", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqName); 354 # &my_die("Couldn't find expected output file: $chisqMask", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqMask); 355 # &my_die("Couldn't find expected output file: $chisqVariance", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqVariance); 312 if (!$quality) { 313 my $outputSources = $ipprc->filename($output_sources_filerule, $outroot); 314 &my_die("Couldn't find expected output file: $outputSources", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources); 315 my $outputPSF = $ipprc->filename($output_psf_filerule, $outroot); 316 &my_die("Couldn't find expected output file: $outputPSF", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputPSF); 356 317 } 318 319 &my_die("Couldn't find expected output file: $configuration", $sky_id, $PS_EXIT_SYS_ERROR) 320 unless $ipprc->file_exists($configuration); 357 321 } else { 358 322 print "Not executing: $command\n";
Note:
See TracChangeset
for help on using the changeset viewer.
