Index: trunk/ppSim/src/ppSim.h
===================================================================
--- trunk/ppSim/src/ppSim.h	(revision 17557)
+++ trunk/ppSim/src/ppSim.h	(revision 18011)
@@ -13,12 +13,13 @@
 #include <psmodules.h>
 #include <psastro.h>
+#include <psphot.h>
 
 #define PPSIM_RECIPE "PPSIM"
-#define OUTPUT_FILE "PPSIM.OUTPUT"
+// #define OUTPUT_FILE "PPSIM.OUTPUT"
 
 // Compare a value with minimum and maximum values, replacing where required.
-#define COMPARE(VALUE,MIN,MAX) { \
-        if (VALUE < MIN) { MIN = VALUE; } \
-        if (VALUE > MAX) { MAX = VALUE; } \
+#define COMPARE(VALUE,MIN,MAX) {		\
+        if (VALUE < MIN) { MIN = VALUE; }	\
+        if (VALUE > MAX) { MAX = VALUE; }	\
     }
 
@@ -70,7 +71,7 @@
 
 /// Parse command-line arguments
-void ppSimArguments(int argc, char *argv[], ///< Command-line arguments
+bool ppSimArguments(int argc, char **argv, ///< Command-line arguments
                     pmConfig *config ///< Configuration
-                    );
+    );
 
 /// Create output file
@@ -78,23 +79,25 @@
 /// Returns a borrowed pointer to the FPA file.
 pmFPAfile *ppSimCreate(pmConfig *config ///< Configuration
-                       );
+    );
 
 // Return bounds of a chip, based on the concepts
 psRegion *ppSimChipBounds(const pmChip *chip, // Chip for which to determine size
                           pmFPAview *view // View for chip
-                          );
+    );
 
 // Return bounds of an FPA, based on the concepts
 psRegion *ppSimFPABounds(const pmFPA *fpa       // FPA for which to determine size
-                         );
+    );
 
 /// Loop over the output file, generating simulated data
 bool ppSimLoop(pmConfig *config ///< Configuration
-                 );
+    );
 
 psVector *ppSimMakeBiassec (pmCell *cell, pmConfig *config);
-psVector *ppSimMakeBias (pmReadout *readout, pmConfig *config, const psRandom *rng) ;
+psVector *ppSimMakeBias (bool *status, pmReadout *readout, pmConfig *config, const psRandom *rng) ;
 bool ppSimMakeDark (pmReadout *readout, pmConfig *config);
 bool ppSimMakeSky (pmReadout *readout, psImage *expCorr, ppSimType type, pmConfig *config);
+
+bool ppSimLoadSpots (pmFPA *fpa, pmConfig *config);
 
 bool ppSimLoadStars (psArray *stars, pmFPA *fpa, pmConfig *config);
@@ -127,4 +130,10 @@
 bool ppSimInsertGalaxies (pmReadout *readout, psImage *expCorr, psArray *galaxies, pmConfig *config);
 
+bool ppSimMosaicChip(pmConfig *config, const psMaskType blankMask, const pmFPAview *view,
+		     const char *outFile, const char *inFile);
+
+bool ppSimPhotom (pmConfig *config, pmFPAview *view);
+
+
 /// Add bad pixels to an image
 bool ppSimBadPixels(pmReadout *readout, ///< Readout for which to generate bad pixels
@@ -139,3 +148,54 @@
 float ppSimMagToFlux (float mag, float zp);
 
+float ppSimArgToRecipeF32(bool *status, 
+			  psMetadata *options,    // Target to which to add value
+			  const char *recipeName, // Name for value in the recipe
+			  psMetadata *arguments,  // Command-line arguments
+			  const char *argName	 // Argument name in the command-line arguments
+    );
+
+int ppSimArgToRecipeS32(bool *status,
+			psMetadata *options,    // Target to which to add value
+			const char *recipeName, // Name for value in the recipe
+			psMetadata *arguments,  // Command-line arguments
+			const char *argName	 // Argument name in the command-line arguments
+    );
+
+char *ppSimArgToRecipeStr(bool *status,
+			  psMetadata *options,    // Target to which to add value
+			  const char *recipeName, // Name for value in the recipe
+			  psMetadata *arguments,  // Command-line arguments
+			  const char *argName	 // Argument name in the command-line arguments
+    );
+
+bool ppSimArgToRecipeBool(bool *status,
+			  psMetadata *options,    // Target to which to add value
+			  const char *recipeName, // Name for value in the recipe
+			  psMetadata *arguments,  // Command-line arguments
+			  const char *argName	    // Argument name in the command-line arguments
+    );
+
+ppSimType ppSimTypeFromString (char *typeStr);
+char *ppSimTypeToString (ppSimType type);
+
+float ppSimGetZeroPoint (psMetadata *recipe, char *filter);
+
+bool ppSimMergeReadouts (pmConfig *config, pmFPAview *view);
+
+double ppSimRandomGaussian (const psRandom *rnd, double mean, double sigma);
+double ppSimRandomGaussianNorm (const psRandom *rnd);
+void ppSimRandomGaussianFree();
+
+bool ppSimPhotomFiles (pmConfig *config, pmFPAfile *fakeFile, pmFPAfile *forceFile);
+
+bool ppSimPhotomReadoutFake(pmConfig *config, const pmFPAview *view);
+bool ppSimPhotomReadoutForce(pmConfig *config, const pmFPAview *view);
+
+psArray *ppSimLoadForceSources(pmConfig *config, const pmFPAview *view);
+bool ppSimDetections (psImage *significance, psMetadata *recipe, psArray *sources);
+psArray *ppSimMergeSources (psArray *in1, psArray *in2);
+
+psArray *ppSimSelectSources (pmConfig *config, const pmFPAview *view, const char *filename);
+bool ppSimDefinePixels (psArray *sources, pmReadout *readout, psMetadata *recipe);
+
 #endif
