Index: trunk/ippScripts/scripts/background_chip.pl
===================================================================
--- trunk/ippScripts/scripts/background_chip.pl	(revision 35154)
+++ trunk/ippScripts/scripts/background_chip.pl	(revision 35681)
@@ -159,7 +159,4 @@
 }
 
-# XXX: M31 TEST turn off restoring pattern correction
-$apply_pattern = 0;
-
 # Set up files
 &my_die("Couldn't find input file: $in_image\n", $chip_bg_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($in_image);
@@ -170,9 +167,4 @@
 
 $ipprc->outroot_prepare($outroot);
-#my $out_image = $ipprc->filename("PPBACKGROUND.OUTPUT", $outroot, $class_id);
-#my $out_mask = $ipprc->filename("PPBACKGROUND.OUTPUT.MASK", $outroot, $class_id);
-#my $out_stats = $ipprc->filename("PPBACKGROUND.STATS", $outroot, $class_id);
-#my $out_config = $ipprc->filename("PPBACKGROUND.CONFIG", $outroot, $class_id);
-#my $traceDest = $ipprc->filename("TRACE.IMFILE", $outroot, $class_id);
 
 my $out_image = prepare_output("PPBACKGROUND.OUTPUT", $outroot, $class_id, 1);
@@ -183,74 +175,6 @@
 my $traceDest = prepare_output("TRACE.IMFILE", $outroot, $class_id, 1);
 
-my $auxmask;
-
-my $apply_auxiliary_mask = 1;
-# XXX Temporary lookup of auxiliary mask file from static location.
-# At some point I'll convert this to register the masks in the database and use detselect
-if ($apply_auxiliary_mask) {
-    my @auxmask_start_date = qw(
-    0000
-    5178
-    5218
-    5403
-    5424
-    5455
-    5485
-    5512
-    5545
-    5770
-    5797
-    5825
-    5854
-    5881
-    6138
-    6153
-    6197
-    6214
-    );
-    my @auxmask_end_date = qw(
-    5177
-    5217
-    5402
-    5423
-    5454
-    5484
-    5511
-    5544
-    5769
-    5796
-    5824
-    5853
-    5880
-    6137
-    6152
-    6196
-    6213
-    9999
-    );
-
-    my $outroot_base = basename($outroot);
-
-    # Assume that outroot base begins with exp_name: fix by passing in exp_name
-    my $mjd = substr($outroot_base, 1, 4);
-    if ($mjd =~ /\D/) {
-            my $error_code = 1;
-            &my_die("unexpected outroot base: $outroot_base: $error_code", $chip_bg_id, $class_id, $error_code);
-    }
-
-    my $i = 0;
-    while ($auxmask_end_date[$i] < $mjd) {
-        $i++;
-    }
-
-    my $auxmask_base = "/data/ipp064.0/bills/m31-masks/www.usm.uni-muenchen.de/people/arri/PAndromeda/masks_fits/mask";
-
-    $auxmask = sprintf "%s_%04d-%04d_%s.fits", $auxmask_base, $auxmask_start_date[$i], $auxmask_end_date[$i], $class_id;
-    print "Auxililary mask file is $auxmask\n";
-}
-
-
-
-# Run ppImage
+
+# Run ppBackground
 unless ($no_op) {
     my $command  = "$ppBackground $outroot";
@@ -258,5 +182,4 @@
     $command .= " -mask $in_mask";
     $command .= " -variance $in_wt";
-    $command .= " -auxmask $auxmask" if $auxmask;
     $command .= " -stats $out_stats" if $do_stats;
     $command .= " -background $in_bg" if $apply_bg;
