Changeset 42099 for trunk/ippScripts/scripts/stack_skycell.pl
- Timestamp:
- Feb 28, 2022, 4:35:35 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/stack_skycell.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/stack_skycell.pl
r37833 r42099 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 … … 207 209 my $output_nocomp = metadataLookupBool($recipe, 'OUTPUT.NOCOMP'); # change filerules to produced uncompressed output images 208 210 my $output_logflux = metadataLookupBool($recipe, 'OUTPUT.LOGFLUX'); # change filerules to produce logflux compressed output images. 211 my $output_deepexp = metadataLookupBool($recipe, 'OUTPUT.DEEPEXP'); # change filerules to produce exptime map with more depth 209 212 my $replicate_outputs = (defined($neb) and metadataLookupBool($recipe, 'OUTPUT.REPLICATE')); # replicate output images 213 my $skip_missing_inputs = metadataLookupBool($recipe, 'SKIP.MISSING.INPUTS'); # ignore missing inputs 210 214 if ($output_nocomp and $output_logflux) { 211 215 &my_die("Unable to not compress and logflux compress simultaneously. Check config.",$stack_id, $PS_EXIT_CONFIG_ERROR); 216 } 217 if ($output_nocomp and $output_deepexp) { 218 &my_die("Unable to not compress and use deepexp simultaneously. Check config.",$stack_id, $PS_EXIT_CONFIG_ERROR); 212 219 } 213 220 my $stack_type = metadataLookupStr($recipe, 'STACK.TYPE'); … … 222 229 if ($file->{ignored}) { next; } 223 230 231 # check for the input files 232 my $image = $ipprc->filename("PSWARP.OUTPUT", $file->{path_base} ); # Image name 233 my $mask = $ipprc->filename( "PSWARP.OUTPUT.MASK", $file->{path_base} ); # Mask name 234 my $weight = $ipprc->filename( "PSWARP.OUTPUT.VARIANCE", $file->{path_base} ); # Weight name 235 my $psf = $convolve ? $ipprc->filename( "PSPHOT.PSF.SKY.SAVE", $file->{path_base} ) : undef; # PSF name 236 my $sources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $file->{path_base}); # Sources name 237 my $bkgmodel = $ipprc->filename("PSWARP.OUTPUT.BKGMODEL", $file->{path_base}); 238 239 my $have_image = $ipprc->file_exists( $image ); 240 my $have_mask = $ipprc->file_exists( $mask ); 241 my $have_weight = $ipprc->file_exists( $weight ); 242 my $have_sources = $ipprc->file_exists( $sources ); 243 my $have_psf; 244 if ($convolve) { $have_psf = $ipprc->file_exists( $psf ); } 245 246 if ($skip_missing_inputs) { 247 my $missing_inputs = 0; 248 unless ($have_image) { print "WARNING: MISSING INPUT $image \n"; $missing_inputs = 1; } 249 unless ($have_mask) { print "WARNING: MISSING INPUT $mask \n"; $missing_inputs = 1; } 250 unless ($have_weight) { print "WARNING: MISSING INPUT $weight \n"; $missing_inputs = 1; } 251 unless ($have_sources){ print "WARNING: MISSING INPUT $sources\n"; $missing_inputs = 1; } 252 if ($convolve) { unless ($have_psf) { print "WARNING: MISSING INPUT $psf\n"; $missing_inputs = 1;}} 253 if ($missing_inputs) { next; } 254 } else { 255 &my_die("Image $image does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_image; 256 &my_die("Mask $mask does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_mask; 257 &my_die("Weight $weight does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_weight; 258 &my_die("Sources $sources does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_sources; 259 &my_die("PSF $psf does not exist", $stack_id, $PS_EXIT_SYS_ERROR) if ($convolve and not $have_psf); 260 } 261 224 262 print $listFile "INPUT$num\tMETADATA\n"; 263 264 print $listFile "\tIMAGE\tSTR\t" . $image . "\n"; 265 print $listFile "\tMASK\tSTR\t" . $mask . "\n"; 266 print $listFile "\tVARIANCE\tSTR\t" . $weight . "\n"; 267 print $listFile "\tPSF\tSTR\t" . $psf . "\n" if $convolve; 268 print $listFile "\tSOURCES\tSTR\t" . $sources . "\n"; 269 print $listFile "\tBKGMODEL\tSTR\t" . $bkgmodel . "\n" if $ipprc->file_exists( $bkgmodel ); 270 271 print $listFile "END\n\n"; 225 272 $num++; 226 227 # my $image = $file->{uri}; # Image name228 my $image = $ipprc->filename("PSWARP.OUTPUT", $file->{path_base} ); # Image name229 my $mask = $ipprc->filename( "PSWARP.OUTPUT.MASK", $file->{path_base} ); # Mask name230 my $weight = $ipprc->filename( "PSWARP.OUTPUT.VARIANCE", $file->{path_base} ); # Weight name231 my $psf = $convolve ? $ipprc->filename( "PSPHOT.PSF.SKY.SAVE", $file->{path_base} ) : undef; # PSF name232 my $sources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $file->{path_base}); # Sources name233 234 my $bkgmodel = $ipprc->filename("PSWARP.OUTPUT.BKGMODEL", $file->{path_base});235 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";247 print $listFile "\tBKGMODEL\tSTR\t" . $bkgmodel . "\n" if $ipprc->file_exists( $bkgmodel );248 249 print $listFile "END\n\n";250 273 } 251 274 close($listFile); … … 255 278 # Prepare the output files 256 279 my @outputFiles; 257 prepare_outputs(\@outputFiles, \@outputList, $outroot);280 prepare_outputs(\@outputFiles, \@outputList, $outroot) if $convolve; 258 281 prepare_outputs(\@outputFiles, \@outputListPhotom, $outroot) if $photometry; 259 prepare_outputs(\@outputFiles, \@outputListUnconv, $outroot) if $convolve;282 prepare_outputs(\@outputFiles, \@outputListUnconv, $outroot); # unconvolved output always go here 260 283 261 284 # we need the output image name for the database … … 309 332 } 310 333 if ($output_logflux) { 311 $command .= " -R PPSTACK.OUTPUT FITS.TYPE COMP_STACK "; # Just this one output component? 312 $command .= " -R PPSTACK.OUTPUT.VARIANCE FITS.TYPE COMP_STACK "; 313 # $command .= " -R PPSTACK.OUTPUT.EXPWT FITS.TYPE COMP_STACK "; 314 $command .= " -R PPSTACK.UNCONV FITS.TYPE COMP_STACK "; 315 $command .= " -R PPSTACK.UNCONV.VARIANCE FITS.TYPE COMP_STACK "; 316 # $command .= " -R PPSTACK.UNCONV.EXPWT FITS.TYPE COMP_STACK "; 334 $command .= " -R PPSTACK.OUTPUT FITS.TYPE STK_UNIONS_COMP"; 335 $command .= " -R PPSTACK.OUTPUT.VARIANCE FITS.TYPE STK_UNIONS_COMP"; 336 $command .= " -R PPSTACK.UNCONV FITS.TYPE STK_UNIONS_COMP"; 337 $command .= " -R PPSTACK.UNCONV.VARIANCE FITS.TYPE STK_UNIONS_COMP"; 338 } 339 # if the total exposure time is long (> 6500 sec), need to use 340 # a different compression options. 341 if ($output_deepexp) { 342 $command .= " -R PPSTACK.OUTPUT.EXP FITS.TYPE EXP_UNIONS "; 343 $command .= " -R PPSTACK.UNCONV.EXP FITS.TYPE EXP_UNIONS "; 317 344 } 318 345 $command .= " -threads $threads" if defined $threads;
Note:
See TracChangeset
for help on using the changeset viewer.
