IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 27, 2009, 11:34:07 AM (17 years ago)
Author:
eugene
Message:

merge changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/ippScripts/scripts/stack_skycell.pl

    r25406 r25624  
    141141$ipprc->define_camera($camera);
    142142
     143print "I've configured everything: $stack_id\n";
     144
    143145# Recipes to use based on reduction class
    144146$reduction = 'DEFAULT' unless defined $reduction;
     
    150152}
    151153
    152 print "I've configured everything: $stack_id\n";
     154my $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}
     166my $convolve = metadataLookupBool($recipe, 'CONVOLVE'); # Convolve inputs?
     167
    153168
    154169# Generate MDC file with the inputs
     
    166181    my $mask = $ipprc->filename( "PSWARP.OUTPUT.MASK", $file->{path_base} ); # Mask name
    167182    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 name
     183    my $psf = $convolve ? $ipprc->filename( "PSPHOT.PSF.SKY.SAVE", $file->{path_base} ) : undef; # PSF name
    169184    my $sources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $file->{path_base}); # Sources name
    170185
     
    172187    &my_die("Mask $mask does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $mask );
    173188    &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 ));
    175190    &my_die("Sources $sources does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $sources );
    176191
     
    178193    print $listFile "\tMASK\tSTR\t" . $mask . "\n";
    179194    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;
    181196    print $listFile "\tSOURCES\tSTR\t" . $sources . "\n";
    182 
    183     ### XXX NEED TO UPDATE THESE appropriately
    184     print $listFile "\tWEIGHTING\tF32\t" . 1.0 . "\n";
    185197
    186198    print $listFile "END\n\n";
     
    274286#       &my_die("Couldn't find expected output file: $bin2Name",    $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name);
    275287    }
    276    
     288
    277289    print "I've stacked $listName: $stack_id\n";
    278290}
     
    352364
    353365    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?
    365368    if ($temp_delete) {
    366         my $temp_dir = metadataLookupStr($md, 'TEMP.DIR'); # Directory with temporary files
    367         my $temp_image = metadataLookupStr($md, 'TEMP.IMAGE'); # Suffix for image
    368         my $temp_mask = metadataLookupStr($md, 'TEMP.MASK'); # Suffix for mask
    369         my $temp_weight = metadataLookupStr($md, 'TEMP.VARIANCE'); # Suffix for weight
     369        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
    370373        my $temp_root = basename($outroot); # Root name for temporary files
    371374
Note: See TracChangeset for help on using the changeset viewer.