Index: trunk/psModules/src/camera/pmReadoutFake.c
===================================================================
--- trunk/psModules/src/camera/pmReadoutFake.c	(revision 15815)
+++ trunk/psModules/src/camera/pmReadoutFake.c	(revision 15838)
@@ -28,5 +28,4 @@
 
 
-#ifdef PAP_WORK
 // Given an object model, circularise it by setting the axes to be identical
 static bool circulariseModel(pmModel *model // Model to circularise
@@ -45,25 +44,14 @@
     return pmPSF_AxesToModel(params, axes);
 }
-#endif
 
-#ifdef PAP_WORK
 bool pmReadoutFakeFromSources(pmReadout *readout, int numCols, int numRows, const psArray *sources,
-                              const psVector *xOffset, const psVector *yOffset, pmPSF *psf,
+                              const psVector *xOffset, const psVector *yOffset, const pmPSF *psf,
                               float minFlux, int radius, bool circularise)
-#else
-pmReadout *pmReadoutFakeFromSources(int numCols, int numRows, const psArray *sources,
-                                    float fwhm, float minFlux)
-#endif
 {
-#ifdef PAP_WORK
     PS_ASSERT_PTR_NON_NULL(readout, false);
-#else
-    pmReadout *readout = pmReadoutAlloc(NULL);
-#endif
     PS_ASSERT_INT_LARGER_THAN(numCols, 0, false);
     PS_ASSERT_INT_LARGER_THAN(numRows, 0, false);
     PS_ASSERT_ARRAY_NON_NULL(sources, false);
 
-#ifdef PAP_WORK
     if (xOffset || yOffset) {
         PS_ASSERT_VECTOR_NON_NULL(xOffset, false);
@@ -84,5 +72,4 @@
         return false;
     }
-#endif
 
     readout->image = psImageRecycle(readout->image, numCols, numRows, PS_TYPE_F32);
@@ -91,39 +78,9 @@
     int numSources = sources->n;          // Number of stars
 
-#ifndef PAP_WORK
-    pmModelType modelType = pmModelClassGetType(MODEL_TYPE); // Type of PSF model
-    assert(modelType >= 0);
-    pmModel *fakeModel = pmModelAlloc(modelType);
-
-    float sigma = fwhm / (2.0 * sqrtf(2.0 * log(2.0))); // Gaussian sigma
-
-    fakeModel->params->data.F32[PM_PAR_SKY] = 0.0;
-    fakeModel->params->data.F32[PM_PAR_I0] = 1.0;
-    fakeModel->params->data.F32[PM_PAR_XPOS] = NAN;
-    fakeModel->params->data.F32[PM_PAR_YPOS] = NAN;
-    fakeModel->params->data.F32[PM_PAR_SXX] = sigma * M_SQRT2;
-    fakeModel->params->data.F32[PM_PAR_SYY] = sigma * M_SQRT2;
-    fakeModel->params->data.F32[PM_PAR_SXY] = 0.0;
-    switch (modelType) {
-      case 0:                           // GAUSS
-      case 1:                           // PGAUSS
-        break;
-      case 2:                           // QGAUSS
-        fakeModel->params->data.F32[PM_PAR_7] = 1.0;
-        break;
-      case 3:                           // RGAUSS
-        fakeModel->params->data.F32[PM_PAR_7] = 2.0;
-        break;
-      default:
-        psAbort("Unsupported model type: %d", modelType);
-    }
-#else
     pmModel *fakeModel = pmModelFromPSFforXY(psf, (float)numCols / 2.0, (float)numRows / 2.0,
                                              1.0); // Fake model, with central intensity of 1.0
-#endif
 
     float flux0 = fakeModel->modelFlux(fakeModel->params); // Flux for central intensity of 1.0
 
-#ifdef PAP_WORK
     if (circularise && !circulariseModel(fakeModel)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to circularise PSF model.");
@@ -132,5 +89,4 @@
     }
     psFree(fakeModel);
-#endif
 
     for (int i = 0; i < numSources; i++) {
@@ -148,5 +104,4 @@
         }
 
-#ifdef PAP_WORK
         pmModel *fakeModel = pmModelFromPSFforXY(psf, x, y, powf(10.0, -0.4 * source->psfMag) / flux0);
         if (!fakeModel) {
@@ -159,9 +114,4 @@
             return false;
         }
-#else
-        fakeModel->params->data.F32[PM_PAR_I0] = powf(10.0, -0.4 * source->psfMag) / flux0;
-        fakeModel->params->data.F32[PM_PAR_XPOS] = x;
-        fakeModel->params->data.F32[PM_PAR_YPOS] = y;
-#endif
 
         psTrace("psModules.camera", 10, "Adding source at %f,%f with flux %f\n",
@@ -171,11 +121,6 @@
         pmSource *fakeSource = pmSourceAlloc(); // Fake source to generate
         fakeSource->peak = pmPeakAlloc(x, y, fakeModel->params->data.F32[PM_PAR_I0], PM_PEAK_LONE);
-        float fakeRadius =
-#ifdef PAP_WORK
-            radius > 0 ? radius :
-#endif
-            fakeModel->modelRadius(fakeModel->params, minFlux); // Radius
+        float fakeRadius = radius > 0 ? radius : fakeModel->modelRadius(fakeModel->params, minFlux); // Radius
 
-#ifdef PAP_WORK
         if (xOffset) {
             if (!pmSourceDefinePixels(fakeSource, readout, x + xOffset->data.S32[i],
@@ -193,7 +138,5 @@
                 return false;
             }
-        } else
-#endif
-        {
+        } else {
             if (!pmSourceDefinePixels(fakeSource, readout, x, y, fakeRadius)) {
                 psError(PS_ERR_UNKNOWN, false, "Unable to define pixels for source.");
@@ -210,16 +153,7 @@
         }
         psFree(fakeSource);
-#ifdef PAP_WORK
         psFree(fakeModel);
-#endif
     }
 
-    return
-#ifdef PAP_WORK
-        true
-#else
-        readout
-#endif
-        ;
-
+    return true;
 }
Index: trunk/psModules/src/camera/pmReadoutFake.h
===================================================================
--- trunk/psModules/src/camera/pmReadoutFake.h	(revision 15815)
+++ trunk/psModules/src/camera/pmReadoutFake.h	(revision 15838)
@@ -12,9 +12,4 @@
 #include <pmPSF.h>
 
-
-//#define PAP_WORK
-
-
-#ifdef PAP_WORK
 /// Generate a fake readout from an array of sources
 bool pmReadoutFakeFromSources(pmReadout *readout, ///< Output readout, or NULL
@@ -23,19 +18,9 @@
                               const psVector *xOffset, ///< x offsets for sources (source -> img), or NULL
                               const psVector *yOffset, ///< y offsets for sources (source -> img), or NULL
-                              pmPSF *psf, ///< PSF for sources
+                              const pmPSF *psf, ///< PSF for sources
                               float minFlux, ///< Minimum flux to bother about; for setting source radius
                               int radius, ///< Fixed radius for sources
                               bool circularise ///< Circularise PSF model?
     );
-#else
-pmReadout *pmReadoutFakeFromSources(int numCols, int numRows, ///< Dimension of image
-                                    const psArray *sources, ///< Array of pmSource
-                                    float target, ///< Target FWHM
-                                    float minFlux ///< Minimum flux to bother about; for setting source radius
-    );
-#endif // PAP_WORK
-
-
-
 
 #endif
