Index: trunk/ippScripts/scripts/staticsky.pl
===================================================================
--- trunk/ippScripts/scripts/staticsky.pl	(revision 31662)
+++ trunk/ippScripts/scripts/staticsky.pl	(revision 33690)
@@ -89,5 +89,5 @@
 
 my $logDest = $ipprc->filename("LOG.EXP", $outroot);
-$ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $sky_id, $PS_EXIT_SYS_ERROR ) if $redirect;
+$ipprc->redirect_to_logfile($logDest) or my_die( "Unable to redirect output", $sky_id, $PS_EXIT_SYS_ERROR ) if $redirect;
 
 my $traceDest      = $ipprc->filename("TRACE.EXP", $outroot);
@@ -148,8 +148,10 @@
             my $maskCnv   = $ipprc->filename("PPSTACK.OUTPUT.MASK",     $path_base ); # Mask name
             my $weightCnv = $ipprc->filename("PPSTACK.OUTPUT.VARIANCE", $path_base ); # Weight name
+            my $expnumCnv = $ipprc->filename("PPSTACK.OUTPUT.EXPNUM",   $path_base ); # Expnum name
 
             my $imageRaw  = $ipprc->filename("PPSTACK.UNCONV",          $path_base ); # Image name
             my $maskRaw   = $ipprc->filename("PPSTACK.UNCONV.MASK",     $path_base ); # Mask name
             my $weightRaw = $ipprc->filename("PPSTACK.UNCONV.VARIANCE", $path_base ); # Weight name
+            my $expnumRaw = $ipprc->filename("PPSTACK.UNCONV.EXPNUM",   $path_base ); # Expnum name
 
             my $sources   = $ipprc->filename("PSPHOT.OUT.CMF.MEF",      $path_base ); # Sources name
@@ -162,7 +164,9 @@
             &my_die("Couldn't find input: $maskRaw",   $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$maskRaw");
             &my_die("Couldn't find input: $weightRaw", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$weightRaw");
+            &my_die("Couldn't find input: $expnumRaw", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$expnumRaw");
             &my_die("Couldn't find input: $imageCnv",  $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$imageCnv");
             &my_die("Couldn't find input: $maskCnv",   $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$maskCnv");
             &my_die("Couldn't find input: $weightCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$weightCnv");
+            &my_die("Couldn't find input: $expnumCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$expnumCnv");
             &my_die("Couldn't find input: $psfCnv",    $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$psfCnv");
             &my_die("Couldn't find input: $sources",   $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$sources");
@@ -171,8 +175,10 @@
             print $listFile "  RAW:MASK      STR  " . $maskRaw   . "\n";
             print $listFile "  RAW:VARIANCE  STR  " . $weightRaw . "\n";
+            print $listFile "  RAW:EXPNUM    STR  " . $expnumRaw . "\n";
 
             print $listFile "  CNV:IMAGE     STR  " . $imageCnv  . "\n";
             print $listFile "  CNV:MASK      STR  " . $maskCnv   . "\n";
             print $listFile "  CNV:VARIANCE  STR  " . $weightCnv . "\n";
+            print $listFile "  CNV:EXPNUM    STR  " . $expnumCnv . "\n";
             print $listFile "  CNV:PSF       STR  " . $psfCnv    . "\n";
 
@@ -288,5 +294,5 @@
         my $use_raw = metadataLookupBool($recipeData, 'PSPHOT.STACK.USE.RAW');
 
-        my ($image, $mask, $variance);
+        my ($image, $mask, $variance, $expnum);
         if ($use_raw) {
             $image  = $ipprc->filename("PPSTACK.UNCONV",          $path_base ); # Image name
@@ -297,4 +303,5 @@
             $mask   = $ipprc->filename("PPSTACK.OUTPUT.MASK",     $path_base ); # Mask name
             $variance = $ipprc->filename("PPSTACK.OUTPUT.VARIANCE", $path_base ); # Weight name
+            $expnum = $ipprc->filename("PPSTACK.OUTPUT.EXPNUM", $path_base ); # Weight name
         }
 
@@ -306,4 +313,5 @@
         &my_die("Couldn't find input: $mask",   $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$mask");
         &my_die("Couldn't find input: $variance", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$variance");
+        &my_die("Couldn't find input: $expnum", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$expnum");
 
         # Perform stack photometry analysis
@@ -313,4 +321,5 @@
             $command .= " -mask $mask";
             $command .= " -variance $variance";
+            $command .= " -expnum $expnum";
             $command .= " -threads $threads" if defined $threads;
             $command .= " -recipe PSPHOT  $recipe_psphot";
