- Timestamp:
- Nov 24, 2021, 5:04:01 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20211108/ippScripts/scripts/stack_skycell.pl
r37833 r41938 66 66 and defined $run_state; 67 67 68 # lists of file rules which we expect to produce output output68 # lists of file rules which we expect to produce output when convolving 69 69 my @outputList = qw( 70 70 PPSTACK.OUTPUT … … 74 74 PPSTACK.OUTPUT.EXPNUM 75 75 PPSTACK.OUTPUT.EXPWT 76 PPSTACK.OUTPUT.JPEG1 77 PPSTACK.OUTPUT.JPEG2 78 PPSTACK.CONFIG 76 PPSTACK.TARGET.PSF 79 77 ); 78 80 79 # produced if we run photometry 81 80 my @outputListPhotom = qw( 82 81 PSPHOT.OUT.CMF.MEF 83 82 ); 84 # extra outputs when convolving 83 84 # list of file rules produced if convolution is false 85 85 my @outputListUnconv = qw( 86 PPSTACK.TARGET.PSF87 86 PPSTACK.UNCONV 88 87 PPSTACK.UNCONV.MASK … … 91 90 PPSTACK.UNCONV.EXPNUM 92 91 PPSTACK.UNCONV.EXPWT 92 PPSTACK.OUTPUT.JPEG1 93 PPSTACK.OUTPUT.JPEG2 94 PPSTACK.CONFIG 93 95 ); 94 96 … … 208 210 my $output_logflux = metadataLookupBool($recipe, 'OUTPUT.LOGFLUX'); # change filerules to produce logflux compressed output images. 209 211 my $replicate_outputs = (defined($neb) and metadataLookupBool($recipe, 'OUTPUT.REPLICATE')); # replicate output images 212 my $skip_missing_inputs = metadataLookupBool($recipe, 'SKIP.MISSING.INPUTS'); # ignore missing inputs 210 213 if ($output_nocomp and $output_logflux) { 211 214 &my_die("Unable to not compress and logflux compress simultaneously. Check config.",$stack_id, $PS_EXIT_CONFIG_ERROR); … … 225 228 $num++; 226 229 227 # my $image = $file->{uri}; # Image name 228 my $image = $ipprc->filename("PSWARP.OUTPUT", $file->{path_base} ); # Image name 229 my $mask = $ipprc->filename( "PSWARP.OUTPUT.MASK", $file->{path_base} ); # Mask name 230 my $weight = $ipprc->filename( "PSWARP.OUTPUT.VARIANCE", $file->{path_base} ); # Weight name 231 my $psf = $convolve ? $ipprc->filename( "PSPHOT.PSF.SKY.SAVE", $file->{path_base} ) : undef; # PSF name 232 my $sources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $file->{path_base}); # Sources name 233 230 # select the input files 231 my $image = $ipprc->filename("PSWARP.OUTPUT", $file->{path_base} ); # Image name 232 my $mask = $ipprc->filename( "PSWARP.OUTPUT.MASK", $file->{path_base} ); # Mask name 233 my $weight = $ipprc->filename( "PSWARP.OUTPUT.VARIANCE", $file->{path_base} ); # Weight name 234 my $psf = $convolve ? $ipprc->filename( "PSPHOT.PSF.SKY.SAVE", $file->{path_base} ) : undef; # PSF name 235 my $sources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $file->{path_base}); # Sources name 234 236 my $bkgmodel = $ipprc->filename("PSWARP.OUTPUT.BKGMODEL", $file->{path_base}); 235 237 236 &my_die("Image $image does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $image ); 237 &my_die("Mask $mask does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $mask ); 238 &my_die("Weight $weight does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $weight ); 239 &my_die("PSF $psf does not exist", $stack_id, $PS_EXIT_SYS_ERROR) if ($convolve and not $ipprc->file_exists( $psf )); 240 &my_die("Sources $sources does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $sources ); 241 242 print $listFile "\tIMAGE\tSTR\t" . $image . "\n"; 243 print $listFile "\tMASK\tSTR\t" . $mask . "\n"; 244 print $listFile "\tVARIANCE\tSTR\t" . $weight . "\n"; 245 print $listFile "\tPSF\tSTR\t" . $psf . "\n" if $convolve; 246 print $listFile "\tSOURCES\tSTR\t" . $sources . "\n"; 238 my $have_image = $ipprc->file_exists( $image ); 239 my $have_mask = $ipprc->file_exists( $mask ); 240 my $have_weight = $ipprc->file_exists( $weight ); 241 my $have_sources = $ipprc->file_exists( $sources ); 242 my $have_psf = $convolve and $ipprc->file_exists( $psf ); 243 244 if ($skip_missing_inputs) { 245 my $missing_inputs = false; 246 unless ($have_image) { print "WARNING: MISSING INPUT $input \n"; $missing_inputs = true; } 247 unless ($have_mask) { print "WARNING: MISSING INPUT $mask \n"; $missing_inputs = true; } 248 unless ($have_weight) { print "WARNING: MISSING INPUT $weight \n"; $missing_inputs = true; } 249 unless ($have_sources){ print "WARNING: MISSING INPUT $sources\n"; $missing_inputs = true; } 250 if ($convolve) { unless ($have_psf) { print "WARNING: MISSING INPUT $psf\n"; $missing_inputs = true;}} 251 if ($missing_input) { next; } 252 } else { 253 &my_die("Image $image does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_image; 254 &my_die("Mask $mask does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_mask; 255 &my_die("Weight $weight does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_weight; 256 &my_die("Sources $sources does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_sources; 257 &my_die("PSF $psf does not exist", $stack_id, $PS_EXIT_SYS_ERROR) if ($convolve and not $have_psf); 258 } 259 260 print $listFile "\tIMAGE\tSTR\t" . $image . "\n"; 261 print $listFile "\tMASK\tSTR\t" . $mask . "\n"; 262 print $listFile "\tVARIANCE\tSTR\t" . $weight . "\n"; 263 print $listFile "\tPSF\tSTR\t" . $psf . "\n" if $convolve; 264 print $listFile "\tSOURCES\tSTR\t" . $sources . "\n"; 247 265 print $listFile "\tBKGMODEL\tSTR\t" . $bkgmodel . "\n" if $ipprc->file_exists( $bkgmodel ); 248 266 … … 255 273 # Prepare the output files 256 274 my @outputFiles; 257 prepare_outputs(\@outputFiles, \@outputList, $outroot);275 prepare_outputs(\@outputFiles, \@outputList, $outroot) if $convolve; 258 276 prepare_outputs(\@outputFiles, \@outputListPhotom, $outroot) if $photometry; 259 prepare_outputs(\@outputFiles, \@outputListUnconv, $outroot) if $convolve;277 prepare_outputs(\@outputFiles, \@outputListUnconv, $outroot); # unconvolved output always go here 260 278 261 279 # we need the output image name for the database
Note:
See TracChangeset
for help on using the changeset viewer.
