Index: branches/eam_branches/ipp-20120405/ippScripts/scripts/destreak_restore_camera.pl
===================================================================
--- branches/eam_branches/ipp-20120405/ippScripts/scripts/destreak_restore_camera.pl	(revision 33724)
+++ branches/eam_branches/ipp-20120405/ippScripts/scripts/destreak_restore_camera.pl	(revision 33949)
@@ -422,5 +422,5 @@
                 # looks like a censored one
                 if (scalar @{$file{bad_instances}}) {
-                    my $bad = ${$file{bad_instances}}->[0];
+                    my $bad = ${$file{bad_instances}}[0];
                     $file{censored} = ($bad =~ /SR_/);
                     print "no good instances found setting censored based on $bad\n";
Index: branches/eam_branches/ipp-20120405/ippScripts/scripts/nightly_science.pl
===================================================================
--- branches/eam_branches/ipp-20120405/ippScripts/scripts/nightly_science.pl	(revision 33724)
+++ branches/eam_branches/ipp-20120405/ippScripts/scripts/nightly_science.pl	(revision 33949)
@@ -1539,4 +1539,8 @@
 	    $cmd .= " -simple  -set_label $label -exp_id $input_exp_id -template_exp_id $template_exp_id ";
 #		$cmd .= " -pretend ";
+	    if (defined($reduction)) {
+		$cmd .= " -set_reduction $reduction ";
+	    }
+
 	    if (defined($pretend)) {
 		$cmd .= ' -pretend ';
@@ -1670,4 +1674,8 @@
 	    $cmd .= "-set_workdir $workdir  -set_dist_group $dist_group  -set_data_group $new_data_group ";
 	    $cmd .= " -simple  -set_label $label -exp_id $input_exp_id -template_exp_id $template_exp_id ";
+	    if (defined($reduction)) {
+		$cmd .= " -set_reduction $reduction ";
+	    }
+
 #		$cmd .= " -pretend ";
 	    if (defined($pretend)) {
@@ -1724,4 +1732,7 @@
     $check_cmd .= " -pretend -simple  -rerun -set_label $label -filter $filter ";
     $check_cmd .= " -dateobs_begin ${lunation_start}T00:00:00 -dateobs_end ${lunation_end}T23:59:59 -distance 1.5 ";
+    if (defined($reduction)) {
+	$check_cmd .= " -set_reduction $reduction ";
+    }
 
     my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 
@@ -1745,4 +1756,7 @@
 	    $cmd .= " -simple  -rerun -set_label $label -filter $filter ";
 	    $cmd .= " -dateobs_begin ${lunation_start}T00:00:00 -dateobs_end ${lunation_end}T23:59:59 -distance 1.5 ";
+	    if (defined($reduction)) {
+		$cmd .= " -set_reduction $reduction ";
+	    }
 
 	    if (defined($pretend)) {
Index: branches/eam_branches/ipp-20120405/ippScripts/scripts/staticsky.pl
===================================================================
--- branches/eam_branches/ipp-20120405/ippScripts/scripts/staticsky.pl	(revision 33724)
+++ branches/eam_branches/ipp-20120405/ippScripts/scripts/staticsky.pl	(revision 33949)
@@ -144,4 +144,5 @@
             my $path_base = $file->{path_base};
             print "input: $path_base\n";
+            my $stack_id = $file->{stack_id};
 
             my $imageCnv  = $ipprc->filename("PPSTACK.OUTPUT",          $path_base ); # Image name
@@ -172,4 +173,5 @@
             &my_die("Couldn't find input: $sources",   $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$sources");
 
+            print $listFile "  STACK_ID      S64  " . $stack_id  . "\n";
             print $listFile "  RAW:IMAGE     STR  " . $imageRaw  . "\n";
             print $listFile "  RAW:MASK      STR  " . $maskRaw   . "\n";
