Index: trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
===================================================================
--- trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm	(revision 40388)
+++ trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm	(revision 40389)
@@ -1666,5 +1666,22 @@
     foreach my $row (@$rowList) {
         print $pointsList "$npoints $row->{CENTER_X} $row->{CENTER_Y}\n";
-        $npoints++;
+	#$npoints++;
+        ## MEH hack -- add width, height corners
+        if ( ($row->{OPTION_MASK} & $PSTAMP_MULTI_OVERLAP_IMAGE) && !($row->{COORD_MASK} & $PSTAMP_RANGE_IN_PIXELS) ){
+            ## +ra +dec corner
+            printf $pointsList "$npoints %f %f\n", $row->{CENTER_X}+$row->{WIDTH}/3600.0, $row->{CENTER_Y}+$row->{HEIGHT}/3600.0;
+	    #$npoints++;
+            ## +ra -dec corner 
+            printf $pointsList "$npoints %f %f\n", $row->{CENTER_X}+$row->{WIDTH}/3600.0, $row->{CENTER_Y}-$row->{HEIGHT}/3600.0;
+	    #$npoints++;
+            ## -ra +dec corner
+            printf $pointsList "$npoints %f %f\n", $row->{CENTER_X}-$row->{WIDTH}/3600.0, $row->{CENTER_Y}+$row->{HEIGHT}/3600.0;
+	    #$npoints++;
+            ## -ra -dec corner 
+            printf $pointsList "$npoints %f %f\n", $row->{CENTER_X}-$row->{WIDTH}/3600.0, $row->{CENTER_Y}-$row->{HEIGHT}/3600.0;
+	    #$npoints++;
+        }
+	####
+	$npoints++;
         # this gets overwitten if an overlapping image is found
         $row->{error_code} = $PSTAMP_NO_OVERLAP;
@@ -1725,5 +1742,8 @@
                     $ref = $components{$component} = [];
                 }
-                push @$ref, $ptnum;
+		#push @$ref, $ptnum;
+                ## MEH hack -- only push ptnum if not already, so check if ptnum in list 
+		push(@$ref, $ptnum) unless grep{$_ == $ptnum} @$ref;
+		##
                 my $row = $rowList->[$ptnum];
                 # this row found a match
Index: trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm
===================================================================
--- trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm	(revision 40388)
+++ trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm	(revision 40389)
@@ -35,4 +35,5 @@
                     $PSTAMP_SELECT_UNCONV
                     $PSTAMP_RESTORE_BACKGROUND
+		    $PSTAMP_MULTI_OVERLAP_IMAGE
                     $PSTAMP_USE_IMFILE_ID
                     $PSTAMP_NO_WAIT_FOR_UPDATE
@@ -81,6 +82,6 @@
 our $PSTAMP_SELECT_UNCONV       = 2048;
 our $PSTAMP_RESTORE_BACKGROUND  = 4096;
-# unused 8192
-
+# MEH -- previously unused 8192
+our $PSTAMP_MULTI_OVERLAP_IMAGE  = 8192; 
 our $PSTAMP_USE_IMFILE_ID      = 16384;
 our $PSTAMP_NO_WAIT_FOR_UPDATE = 32768;
Index: trunk/pstamp/scripts/pstamp_job_run.pl
===================================================================
--- trunk/pstamp/scripts/pstamp_job_run.pl	(revision 40388)
+++ trunk/pstamp/scripts/pstamp_job_run.pl	(revision 40389)
@@ -248,4 +248,7 @@
         $command .= " -stage $stage";
         $command .= " -forheader $calibfile" if $calibfile;
+	## MEH hack for centeroffchip -- needs constraint for coord_mask 0 all in sky values..
+	$command .= " -centeroffchip" if ($options & $PSTAMP_MULTI_OVERLAP_IMAGE);
+
         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
             run(command => $command, verbose => $verbose);
Index: trunk/pstamp/src/ppstampArguments.c
===================================================================
--- trunk/pstamp/src/ppstampArguments.c	(revision 40388)
+++ trunk/pstamp/src/ppstampArguments.c	(revision 40389)
@@ -31,4 +31,5 @@
     fprintf(stderr, "   [-write_cmf]          : create an output cmf with the sources overlapping the stamp\n");
     fprintf(stderr, "   [-wholefile]          : ignore the region of interest and process the entire input image\n");
+    fprintf(stderr, "   [-centeroffchip]          : allow center to be off chip boundary and include any pixels in ROI (testing) \n");
     // fprintf(stderr, "   [-no_censor_masked]   : do not set masked pixels to NAN\n");
     fprintf(stderr, "\n");
@@ -66,4 +67,9 @@
     *pOptions = options;
 
+    if ((argnum = psArgumentGet(argc, argv, "-centeroffchip"))) {
+        psArgumentRemove(argnum, &argc, argv);
+        options->centeroffchip = true;
+    }
+	
     if ((argnum = psArgumentGet(argc, argv, "-wholefile"))) {
         psArgumentRemove(argnum, &argc, argv);
Index: trunk/pstamp/src/ppstampMakeStamp.c
===================================================================
--- trunk/pstamp/src/ppstampMakeStamp.c	(revision 40388)
+++ trunk/pstamp/src/ppstampMakeStamp.c	(revision 40389)
@@ -592,5 +592,6 @@
     }
 
-    if (onChip) {
+    //MEH add hack for ROI not to include center on chip
+    if (onChip || options->centeroffchip ) {
         if (options->roip.celestialRange) {
             findBoundingBox(options, input->fpa, chip, center);
Index: trunk/pstamp/src/ppstampOptions.h
===================================================================
--- trunk/pstamp/src/ppstampOptions.h	(revision 40388)
+++ trunk/pstamp/src/ppstampOptions.h	(revision 40389)
@@ -8,4 +8,5 @@
     // input arguments
     pstampROI   roip;
+    bool    	centeroffchip;
     bool        wholeFile;
     psString    chipName;
Index: trunk/pstamp/src/pstamp.h
===================================================================
--- trunk/pstamp/src/pstamp.h	(revision 40388)
+++ trunk/pstamp/src/pstamp.h	(revision 40389)
@@ -43,5 +43,6 @@
 #define PSTAMP_SELECT_UNCONV        2048
 #define PSTAMP_RESTORE_BACKGROUND   4096
-// unused                           8192
+// MEH -- previously unused                           8192
+#define PSTAMP_MULTI_OVERLAP_IMAGE  8192
 #define PSTAMP_USE_IMFILE_ID        16384
 
