Index: trunk/stac/src/stac.h
===================================================================
--- trunk/stac/src/stac.h	(revision 2897)
+++ trunk/stac/src/stac.h	(revision 3610)
@@ -8,6 +8,6 @@
 #define MAXCHAR 80
 
-// Temporary implementation
-psPlaneTransform *psPlaneTransformAlloc(psS32 n1, psS32 n2);
+// Get the current time
+double getTime(void);
 
 /************************************************************************************************************/
@@ -21,8 +21,11 @@
     psArray *inputs;			// Input file names
     const char *output;			// Output file name
+    bool saveShifts;			// Save shifted images?
+    const char *starFile;		// File with star coordinates
+    const char *starMapFile;		// File with map for stars
     int outnx, outny;			// Size of output image
     float xOffset, yOffset;		// Offset to get lower-left corner at 0,0
-    float saturated;			// Saturation level
-    float bad;				// Bad level
+    psVector *saturated;		// Saturation level for each image
+    psVector *bad;			// Bad level for each image
     float reject;			// Rejection level
     float frac;				// Fraction of input pixel that must be masked before the pixel is
@@ -30,4 +33,6 @@
     float grad;				// Multiplier of the gradient
     int nReject;			// Number of rejection iterations
+    float xMapDiff, yMapDiff;		// Difference between pure map and output image coordinates
+    float aper;				// Aperture size (pixels)
 } stacConfig;
 
@@ -52,4 +57,10 @@
 // Read the input files and return an array of images
 psArray *stacReadImages(stacConfig *config);
+
+// Read a file of coordinates (x,y)
+psArray *stacReadCoords(const char *filename);
+
+// Read a single map file and return the transformation
+psPlaneTransform *stacReadMap(const char *filename);
 
 // Read the map files and return an array of transformations
@@ -77,4 +88,6 @@
 		   const psArray *masks, // Masks of input images
 		   const psImage *region, // Region of interest for transformation
+		   const psVector *scales, // Relative scales
+		   const psVector *offsets, // Relative offsets
 		   const stacConfig *config // Configuration
     );
@@ -181,3 +194,26 @@
 /************************************************************************************************************/
 
+// stacScale.c
+
+// Calculate the background in an image
+float stacBackground(const psImage *image, // Image for which to get the background
+		     int sample		// Sample in increments of this value
+    );
+
+
+// Calculate the relative scales and offsets between the images
+bool stacScales(psVector **scalesPtr,	// Scales to return
+		psVector **offsetsPtr,	// Offsets to return
+		const psArray *images,	// Images on which to measure the scales and offsets
+		const stacConfig *config // Configuration
+    );
+
+// Rescale images
+bool stacRescale(psArray *images,	// Images to rescale
+		 psArray *errImages,	// Variance images to rescale
+		 const psImage *mask,	// Mask indicating which pixels to scale
+		 const psVector *scales,// Scales for images
+		 const psVector *offsets // Offsets for images
+    );
+
 #endif
