- Timestamp:
- Sep 27, 2009, 11:34:07 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/ippScripts/scripts/stack_skycell.pl
r25406 r25624 141 141 $ipprc->define_camera($camera); 142 142 143 print "I've configured everything: $stack_id\n"; 144 143 145 # Recipes to use based on reduction class 144 146 $reduction = 'DEFAULT' unless defined $reduction; … … 150 152 } 151 153 152 print "I've configured everything: $stack_id\n"; 154 my $recipe; 155 { 156 my $command = "$ppConfigDump -camera $camera -recipe PPSTACK $recipe_ppStack -dump-recipe PPSTACK -"; 157 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 158 run(command => $command, verbose => $verbose); 159 unless ($success) { 160 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 161 &my_die("Unable to perform ppConfigDump: $error_code", $stack_id, $error_code); 162 } 163 $recipe = $mdcParser->parse(join "", @$stdout_buf) or 164 &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR); 165 } 166 my $convolve = metadataLookupBool($recipe, 'CONVOLVE'); # Convolve inputs? 167 153 168 154 169 # Generate MDC file with the inputs … … 166 181 my $mask = $ipprc->filename( "PSWARP.OUTPUT.MASK", $file->{path_base} ); # Mask name 167 182 my $weight = $ipprc->filename( "PSWARP.OUTPUT.VARIANCE", $file->{path_base} ); # Weight name 168 my $psf = $ ipprc->filename( "PSPHOT.PSF.SKY.SAVE", $file->{path_base} ); # PSF name183 my $psf = $convolve ? $ipprc->filename( "PSPHOT.PSF.SKY.SAVE", $file->{path_base} ) : undef; # PSF name 169 184 my $sources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $file->{path_base}); # Sources name 170 185 … … 172 187 &my_die("Mask $mask does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $mask ); 173 188 &my_die("Weight $weight does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $weight ); 174 &my_die("PSF $psf does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $psf);189 &my_die("PSF $psf does not exist", $stack_id, $PS_EXIT_SYS_ERROR) if ($convolve and not $ipprc->file_exists( $psf )); 175 190 &my_die("Sources $sources does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $sources ); 176 191 … … 178 193 print $listFile "\tMASK\tSTR\t" . $mask . "\n"; 179 194 print $listFile "\tVARIANCE\tSTR\t" . $weight . "\n"; 180 print $listFile "\tPSF\tSTR\t" . $psf . "\n" ;195 print $listFile "\tPSF\tSTR\t" . $psf . "\n" if $convolve; 181 196 print $listFile "\tSOURCES\tSTR\t" . $sources . "\n"; 182 183 ### XXX NEED TO UPDATE THESE appropriately184 print $listFile "\tWEIGHTING\tF32\t" . 1.0 . "\n";185 197 186 198 print $listFile "END\n\n"; … … 274 286 # &my_die("Couldn't find expected output file: $bin2Name", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name); 275 287 } 276 288 277 289 print "I've stacked $listName: $stack_id\n"; 278 290 } … … 352 364 353 365 print "Ensuring temporary images are deleted.\n"; 354 my $command = "$ppConfigDump -camera $camera -recipe PPSTACK $recipe_ppStack -dump-recipe PPSTACK -"; 355 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 356 run(command => $command, verbose => $verbose); 357 unless ($success) { 358 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 359 &my_die("Unable to perform ppConfigDump: $error_code", $stack_id, $error_code); 360 } 361 my $md = $mdcParser->parse(join "", @$stdout_buf) or 362 &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR); 363 364 my $temp_delete = metadataLookupBool($md, 'TEMP.DELETE'); # Delete temporary files? 366 367 my $temp_delete = defined($recipe) and metadataLookupBool($recipe, 'TEMP.DELETE'); # Delete temp files? 365 368 if ($temp_delete) { 366 my $temp_dir = metadataLookupStr($ md, 'TEMP.DIR'); # Directory with temporary files367 my $temp_image = metadataLookupStr($ md, 'TEMP.IMAGE'); # Suffix for image368 my $temp_mask = metadataLookupStr($ md, 'TEMP.MASK'); # Suffix for mask369 my $temp_weight = metadataLookupStr($ md, 'TEMP.VARIANCE'); # Suffix for weight369 my $temp_dir = metadataLookupStr($recipe, 'TEMP.DIR'); # Directory with temporary files 370 my $temp_image = metadataLookupStr($recipe, 'TEMP.IMAGE'); # Suffix for image 371 my $temp_mask = metadataLookupStr($recipe, 'TEMP.MASK'); # Suffix for mask 372 my $temp_weight = metadataLookupStr($recipe, 'TEMP.VARIANCE'); # Suffix for weight 370 373 my $temp_root = basename($outroot); # Root name for temporary files 371 374
Note:
See TracChangeset
for help on using the changeset viewer.
