Index: trunk/psModules/src/imcombine/pmSubtractionStamps.h
===================================================================
--- trunk/psModules/src/imcombine/pmSubtractionStamps.h	(revision 14802)
+++ trunk/psModules/src/imcombine/pmSubtractionStamps.h	(revision 15443)
@@ -9,7 +9,8 @@
 typedef enum {
     PM_SUBTRACTION_STAMP_INIT,          ///< Initial state
+    PM_SUBTRACTION_STAMP_FOUND,         ///< Found a suitable source for this stamp
+    PM_SUBTRACTION_STAMP_CALCULATE,     ///< Calculate matrix and vector values for this stamp
     PM_SUBTRACTION_STAMP_USED,          ///< Use this stamp
     PM_SUBTRACTION_STAMP_REJECTED,      ///< This stamp has been rejected
-    PM_SUBTRACTION_STAMP_CALCULATE,     ///< Calculate matrix and vector values for this stamp
     PM_SUBTRACTION_STAMP_NONE           ///< No stamp in this region
 } pmSubtractionStampStatus;
@@ -54,8 +55,9 @@
     float flux;                         ///< Flux
     float xNorm, yNorm;                 ///< Normalised position
-    psKernel *reference;                ///< Reference image postage stamp
-    psKernel *input;                    ///< Input image postage stamp
+    psKernel *image1;                   ///< Reference image postage stamp
+    psKernel *image2;                   ///< Input image postage stamp
     psKernel *weight;                   ///< Weight image postage stamp
-    psArray *convolutions;              ///< Convolutions of the reference for each kernel component
+    psArray *convolutions1;             ///< Convolutions of image 1 for each kernel component
+    psArray *convolutions2;             ///< Convolutions of image 2 for each kernel component
     psImage *matrix;                    ///< Associated matrix
     psVector *vector;                   ///< Assoicated vector
@@ -72,11 +74,9 @@
                                                 const psRegion *region, ///< Region to search, or NULL
                                                 float threshold, ///< Threshold for stamps in the image
-                                                float spacing ///< Rough spacing for stamps
+                                                float spacing, ///< Rough spacing for stamps
+                                                pmSubtractionMode mode ///< Mode for subtraction
     );
 
 /// Set stamps based on a list of x,y
-///
-/// We may optionally apply an exclusion zone around each star --- this is important when we're convolving to
-/// a specified PSF; less so when we're only trying to get a good subtraction.
 pmSubtractionStampList *pmSubtractionStampsSet(const psVector *x, ///< x coordinates for each stamp
                                                const psVector *y, ///< y coordinates for each stamp
@@ -86,14 +86,23 @@
                                                const psRegion *region, ///< Region to search, or NULL
                                                float spacing, ///< Rough spacing for stamps
-                                               int exclusionZone ///< Exclusion zone around each star
+                                               pmSubtractionMode mode ///< Mode for subtraction
     );
 
-///
+/// Set stamps based on a list of sources
 pmSubtractionStampList *pmSubtractionStampsSetFromSources(
-    const psArray *sources, ///< Sources for each stamp
-    const psImage *subMask, ///< Mask, or NULL
-    const psRegion *region, ///< Region to search, or NULL
-    float spacing, ///< Rough spacing for stamps
-    int exclusionZone ///< Exclusion zone around each star
+    const psArray *sources,             ///< Sources for each stamp
+    const psImage *subMask,             ///< Mask, or NULL
+    const psRegion *region,             ///< Region to search, or NULL
+    float spacing,                      ///< Rough spacing for stamps
+    pmSubtractionMode mode              ///< Mode for subtraction
+    );
+
+/// Set stamps based on values in a file
+pmSubtractionStampList *pmSubtractionStampsSetFromFile(
+    const char *filename,               ///< Filename of file containing x,y (or x,y,flux) on each line
+    const psImage *subMask,             ///< Mask, or NULL
+    const psRegion *region,             ///< Region to search, or NULL
+    float spacing,                      ///< Rough spacing for stamps
+    pmSubtractionMode mode              ///< Mode for subtraction
     );
 
@@ -107,10 +116,3 @@
     );
 
-/// Generate target for stamps based on list
-bool pmSubtractionStampsGenerate(pmSubtractionStampList *stamps, ///< Stamps
-                                 float fwhm, ///< FWHM for each stamp
-                                 int footprint, ///< Stamp footprint size
-                                 int size ///< Kernel half-size
-    );
-
 #endif
