Index: /trunk/archive/modules/include/phase2.h
===================================================================
--- /trunk/archive/modules/include/phase2.h	(revision 961)
+++ /trunk/archive/modules/include/phase2.h	(revision 962)
@@ -30,8 +30,8 @@
 
 /** Returns an image that is the result of convolving the input image with the specified kernel. */
-psReadout *psPhase2ConvolveWithKernel(psReadout *out, ///< Output image, or NULL
-				      const psReadout *in, ///< Input image to be convolved
-				      const psImage *kernel ///< Kernel by which to convolve
-				      );
+psImage *psPhase2ConvolveWithKernel(psImage *out, ///< Output image, or NULL
+				    const psImage *in, ///< Input image to be convolved
+				    const psImage *kernel ///< Kernel by which to convolve
+				    );
 
 /************************************************************************************************************/
@@ -55,18 +55,4 @@
 		       );
 
-/** Array of image regions */
-typedef struct {
-    int n;				///< Number of image regions
-    psImageRegion *arr;			///< Array of image regions
-} psImageRegionArray;
-
-/** Constructor */
-psImageRegionArray *psImageRegionArrayAlloc(int n ///< Number of entries to allocate
-					    );
-
-/** Destructor */
-void psImageRegionArrayFree(psImageRegionArray *reg ///< Array of regions to destroy
-			    );
-
 /** Overscan axis */
 typedef enum {
@@ -82,5 +68,5 @@
 				psPolynomial1D *polySpec, ///< Polynomial specification to use for fit,
 							  ///< outputed
-				const psImageRegionArray *regions, ///< Bias regions
+				const psList *regions, ///< Linked list of psImageRegion types.
 				psOverscanAxis overscanAxis, ///< Overscan axis
 				const psStatsOptions *stat, ///< Statistic to use
@@ -102,5 +88,5 @@
  */
 psReadout *psPhase2CorrectNonLinearity(psReadout *in, ///< Input image to be corrected, and output
-				       psPolynomial1D *coeff ///< Polynomial with which to correct
+				       const psPolynomial1D *coeff ///< Polynomial with which to correct
 				       );
 
@@ -110,8 +96,15 @@
 			     );
 
-/** Subtracts the sky background. Needs work. */
+/** Subtracts the sky background. */
 psReadout *psPhase2SubtractSky(psReadout *in, ///< Input image to be sky-subtracted, and output
 			       psPolynomial2D *poly, ///< Polynomial specification, returns coeffcients
-			       const psImageArray *skyImages ///< Array of sky images
+			       psVector *outNorms, ///< Normalisations of the template sky images: output
+			       const psList *skyImages, ///< Template sky images: a list of type psImage, or
+							///< NULL
+			       const psList *catalog, ///< Sources nearby to mask when measuring the
+						      ///< background: a list of type psObject, or NULL
+			       float radiusMultiply, ///< Multiplying factor of object radius for mask
+			       float radiusAdd, ///< Additive factor to grow the object masks
+			       int binFactor ///< Binning factor to use on image before solving for polynomial
 			       );
 
@@ -150,8 +143,8 @@
 
 /** Find and measure objects on the input image.  Fills in the "objects" member of the psReadout */
-psReadout *psPhase2GetObjects(psReadout *in, ///< Input image on which to find objects, and output
-			      const psImage *psf, ///< PSF to use to find objects
-			      const psVector *levels ///< Threshold levels (std dev.s)
-			      );
+psReadout *psPhase2FindObjects(psReadout *in, ///< Input image on which to find objects, and output
+			       const psImage *psf, ///< PSF to use to find objects
+			       const psVector *levels ///< Threshold levels (std dev.s)
+			       );
 
 /************************************************************************************************************/
