IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 2, 2021, 3:49:09 PM (5 years ago)
Author:
eugene
Message:

add option to generate a deep compressed exptime output; generate STK_UNIONS output for logflux; correctly skip missing inputs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20211108/ippScripts/scripts/stack_skycell.pl

    r41938 r41950  
    209209my $output_nocomp = metadataLookupBool($recipe, 'OUTPUT.NOCOMP'); # change filerules to produced uncompressed output images
    210210my $output_logflux = metadataLookupBool($recipe, 'OUTPUT.LOGFLUX'); # change filerules to produce logflux compressed output images.
     211my $output_deepexp = metadataLookupBool($recipe, 'OUTPUT.DEEPEXP'); # change filerules to produce exptime map with more depth
    211212my $replicate_outputs = (defined($neb) and metadataLookupBool($recipe, 'OUTPUT.REPLICATE')); # replicate output images
    212213my $skip_missing_inputs = metadataLookupBool($recipe, 'SKIP.MISSING.INPUTS'); # ignore missing inputs
    213214if ($output_nocomp and $output_logflux) {
    214215    &my_die("Unable to not compress and logflux compress simultaneously. Check config.",$stack_id, $PS_EXIT_CONFIG_ERROR);
     216}
     217if ($output_nocomp and $output_deepexp) {
     218    &my_die("Unable to not compress and use deepexp simultaneously. Check config.",$stack_id, $PS_EXIT_CONFIG_ERROR);
    215219}
    216220my $stack_type = metadataLookupStr($recipe, 'STACK.TYPE');
     
    225229    if ($file->{ignored}) { next; }
    226230
    227     print $listFile "INPUT$num\tMETADATA\n";
    228     $num++;
    229 
    230     # select the input files
     231    # check for the input files
    231232    my $image    = $ipprc->filename("PSWARP.OUTPUT", $file->{path_base} ); # Image name
    232233    my $mask     = $ipprc->filename( "PSWARP.OUTPUT.MASK", $file->{path_base} ); # Mask name
     
    240241    my $have_weight  = $ipprc->file_exists( $weight );
    241242    my $have_sources = $ipprc->file_exists( $sources );
    242     my $have_psf     = $convolve and $ipprc->file_exists( $psf );
     243    my $have_psf;
     244    if ($convolve) { $have_psf = $ipprc->file_exists( $psf ); }
    243245
    244246    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; }
     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; }
    252254    } else {
    253255        &my_die("Image $image does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $have_image;
     
    258260    }
    259261
     262    print $listFile "INPUT$num\tMETADATA\n";
     263
    260264    print $listFile "\tIMAGE\tSTR\t"    . $image    . "\n";
    261265    print $listFile "\tMASK\tSTR\t"     . $mask     . "\n";
     
    266270
    267271    print $listFile "END\n\n";
     272    $num++;
    268273}
    269274close($listFile);
     
    327332    }
    328333    if ($output_logflux) {
    329         $command .= " -R PPSTACK.OUTPUT FITS.TYPE COMP_STACK "; # Just this one output component?
    330         $command .= " -R PPSTACK.OUTPUT.VARIANCE FITS.TYPE COMP_STACK ";
    331 #       $command .= " -R PPSTACK.OUTPUT.EXPWT FITS.TYPE COMP_STACK ";
    332         $command .= " -R PPSTACK.UNCONV FITS.TYPE COMP_STACK ";
    333         $command .= " -R PPSTACK.UNCONV.VARIANCE FITS.TYPE COMP_STACK ";
    334 #       $command .= " -R PPSTACK.UNCONV.EXPWT FITS.TYPE COMP_STACK ";
     334        $command .= " -R PPSTACK.OUTPUT          FITS.TYPE STK_UNIONS "; # Just this one output component?
     335        $command .= " -R PPSTACK.OUTPUT.VARIANCE FITS.TYPE STK_UNIONS ";
     336        $command .= " -R PPSTACK.UNCONV          FITS.TYPE STK_UNIONS";
     337        $command .= " -R PPSTACK.UNCONV.VARIANCE FITS.TYPE STK_UNIONS ";
     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 ";
    335344    }
    336345    $command .= " -threads $threads" if defined $threads;
Note: See TracChangeset for help on using the changeset viewer.