- Timestamp:
- Oct 2, 2009, 5:10:19 PM (17 years ago)
- Location:
- branches/eam_branches/20090820
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/stack_skycell.pl (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090820
- Property svn:mergeinfo changed
-
branches/eam_branches/20090820/ippScripts/scripts/stack_skycell.pl
r23745 r25766 65 65 66 66 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $stack_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 67 $| = 1; 68 print "I've set up: $stack_id\n"; 67 69 68 70 # XXX camera is not known here; cannot use filerules... … … 107 109 &my_die("Stack list contains less than two elements", $stack_id, $PS_EXIT_SYS_ERROR) unless 108 110 scalar @$files >= 2; 111 112 print "I've loaded my inputs: $stack_id\n"; 109 113 110 114 # Parse the list of input files to get the tesselation, skycell identifiers and camera … … 137 141 $ipprc->define_camera($camera); 138 142 143 print "I've configured everything: $stack_id\n"; 144 139 145 # Recipes to use based on reduction class 140 146 $reduction = 'DEFAULT' unless defined $reduction; … … 146 152 } 147 153 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 168 148 169 # Generate MDC file with the inputs 149 170 my $tess_base = basename($tess_id); … … 160 181 my $mask = $ipprc->filename( "PSWARP.OUTPUT.MASK", $file->{path_base} ); # Mask name 161 182 my $weight = $ipprc->filename( "PSWARP.OUTPUT.VARIANCE", $file->{path_base} ); # Weight name 162 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 163 184 my $sources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $file->{path_base}); # Sources name 164 185 … … 166 187 &my_die("Mask $mask does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $mask ); 167 188 &my_die("Weight $weight does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $weight ); 168 &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 )); 169 190 &my_die("Sources $sources does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $sources ); 170 191 … … 172 193 print $listFile "\tMASK\tSTR\t" . $mask . "\n"; 173 194 print $listFile "\tVARIANCE\tSTR\t" . $weight . "\n"; 174 print $listFile "\tPSF\tSTR\t" . $psf . "\n" ;195 print $listFile "\tPSF\tSTR\t" . $psf . "\n" if $convolve; 175 196 print $listFile "\tSOURCES\tSTR\t" . $sources . "\n"; 176 197 177 ### XXX NEED TO UPDATE THESE appropriately178 print $listFile "\tWEIGHTING\tF32\t" . 1.0 . "\n";179 180 198 print $listFile "END\n\n"; 181 199 } 200 201 print "I've checked everything: $stack_id\n"; 182 202 183 203 # Get the output filenames … … 200 220 201 221 my $cmdflags; 222 202 223 203 224 # Perform stacking … … 266 287 } 267 288 289 print "I've stacked $listName: $stack_id\n"; 268 290 } 269 291 … … 298 320 } 299 321 322 print "I've updated teh database: $stack_id\n"; 323 300 324 301 325 my $my_die_called = 0; … … 340 364 341 365 print "Ensuring temporary images are deleted.\n"; 342 my $command = "$ppConfigDump -camera $camera -recipe PPSTACK $recipe_ppStack -dump-recipe PPSTACK -"; 343 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 344 run(command => $command, verbose => $verbose); 345 unless ($success) { 346 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 347 &my_die("Unable to perform ppConfigDump: $error_code", $stack_id, $error_code); 348 } 349 my $md = $mdcParser->parse(join "", @$stdout_buf) or 350 &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR); 351 352 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? 353 368 if ($temp_delete) { 354 my $temp_dir = metadataLookupStr($ md, 'TEMP.DIR'); # Directory with temporary files355 my $temp_image = metadataLookupStr($ md, 'TEMP.IMAGE'); # Suffix for image356 my $temp_mask = metadataLookupStr($ md, 'TEMP.MASK'); # Suffix for mask357 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 358 373 my $temp_root = basename($outroot); # Root name for temporary files 359 374 … … 372 387 } 373 388 389 print "I've reached the end of processing with a code of $?: $stack_id\n"; 374 390 375 391 END {
Note:
See TracChangeset
for help on using the changeset viewer.
