Index: /tags/ipp-20130712/pstamp/scripts/psmkreq
===================================================================
--- /tags/ipp-20130712/pstamp/scripts/psmkreq	(revision 36821)
+++ /tags/ipp-20130712/pstamp/scripts/psmkreq	(revision 36822)
@@ -29,5 +29,5 @@
 my ($ra, $dec, $x, $y, $list, $output, $req_name, $req_name_base);
 
-my ($image, $mask, $variance, $jpeg, $cmf, $psf, $backmdl, $inverse);
+my ($image, $mask, $variance, $jpeg, $cmf, $psf, $backmdl, $inverse, $restorebackground);
 my ($convolved, $unconvolved, $uncompressed, $use_imfile_id, $no_wait);
 
@@ -39,8 +39,9 @@
 my $job_type     = 'stamp';
 my $req_type     = 'bycoord';
-my $stage        = 'chip';
+my $stage        = 'stack';
 my $option_mask;
 my $width        = $default_size;
 my $height       = $default_size;
+my $whole_file   = 0;
 my $project      = 'gpc1';
 my $coord_mask;
@@ -81,4 +82,5 @@
     'width=i'           => \$width,
     'height=i'          => \$height,
+    'whole-file'        => \$whole_file,
     'pixcenter'         => \$pixcenter,
     'arcseconds'        => \$arcseconds,
@@ -118,4 +120,5 @@
     'convolved'         => \$convolved,
     'uncompressed'      => \$uncompressed,
+    'restorebackground' => \$restorebackground,
     'use_imfile_id'     => \$use_imfile_id,
     'do_not_wait'       => \$no_wait,
@@ -141,13 +144,22 @@
         pod2usage( -msg => "--ra --dec --x --y are not used with --list", -exitval =>1 )
             if defined $x or defined $y;
-    } elsif (!$pixcenter) {
-        pod2usage( -msg => "Required options for stamp requests: --ra and --dec or --list", -exitval =>1 )
-            unless (defined $ra and defined $dec);
-        # to simplify code we just use $x and $y from here
-        $x = $ra;
-        $y = $dec;
     } else {
-        pod2usage( -msg => "Required options for stamp requests: --x and --y or --list", -exitval =>1 )
-                unless (defined $x and defined $y);
+        if ($whole_file) {
+            $pixcenter = 1;
+            $x = 0;
+            $y = 0;
+            $width = 0;
+            $height = 0;
+        }
+        if (!$pixcenter) {
+            pod2usage( -msg => "Required options for stamp requests: --ra and --dec or --list", -exitval =>1 )
+                unless (defined $ra and defined $dec);
+            # to simplify code we just use $x and $y from here
+            $x = $ra;
+            $y = $dec;
+        } else {
+            pod2usage( -msg => "Required options for stamp requests: --x and --y or --list", -exitval =>1 )
+                    unless (defined $x and defined $y);
+        }
     }
 } else {
@@ -209,8 +221,9 @@
         $option_mask |= $PSTAMP_SELECT_PSF      if $psf;
         $option_mask |= $PSTAMP_SELECT_BACKMDL  if $backmdl;
-        $option_mask |= $PSTAMP_SELECT_UNCOMPRESSED   if $uncompressed;
+        $option_mask |= $PSTAMP_SELECT_UNCOMPRESSED if $uncompressed;
         $option_mask |= $PSTAMP_SELECT_UNCONV   if $unconvolved;
         $option_mask |= $PSTAMP_USE_IMFILE_ID   if $use_imfile_id;
         $option_mask |= $PSTAMP_SELECT_INVERSE  if $inverse;
+        $option_mask |= $PSTAMP_RESTORE_BACKGROUND  if $restorebackground;
     }
     $option_mask |= $PSTAMP_NO_WAIT_FOR_UPDATE if $no_wait;
