Index: trunk/ppSim/src/ppSimCreate.c
===================================================================
--- trunk/ppSim/src/ppSimCreate.c	(revision 29125)
+++ trunk/ppSim/src/ppSimCreate.c	(revision 30618)
@@ -103,4 +103,7 @@
         psMetadataAddF32(recipe, PS_LIST_TAIL, "SEEING", PS_META_REPLACE, "Seeing SIGMA (pixels)", seeing / 2.0 / sqrt(2.0 * log(2.0)) / scale);
 
+        float seeingMax = psMetadataLookupF32(&status, recipe, "SEEING.MAX");
+        psMetadataAddF32(recipe, PS_LIST_TAIL, "SEEING.MAX", PS_META_REPLACE, "Seeing SIGMA (pixels)", seeingMax / 2.0 / sqrt(2.0 * log(2.0)) / scale);
+
         // if we have been supplied an input image, but no ra & dec, use the input image values
         if (input) {
@@ -132,65 +135,19 @@
     bool doPhotom = psMetadataLookupBool(&status, recipe, "PHOTOM"); // Density of fakes
     if (doPhotom) {
-
-        // XXX at the moment, we can perform photometry on the fake sources and the forced
-        // photometry positions, but not one or the other.  Also, we only support photometry in
-        // the context of an image previously analysed by psphot.  Add support for:
-        // * photometry of a pure fake image (requires peak detection and psf creation)
-        // * photometry of forced source positions without fake image (this might work, it just
-        // requires not generating any fake features).
-
-        if (!input) {
-            psError(PS_ERR_UNKNOWN, false, "input image not found; currently required for photometry");
-            return NULL;
-        }
-
-        // we need a chip image if we perform photometry (is it necessary to build it if we don't use it?)
-        pmFPAfile *fakeImage = pmFPAfileDefineChipMosaic(config, output->fpa, "PPSIM.FAKE.CHIP");
-        if (!fakeImage) {
-            psError(PS_ERR_IO, false, _("Unable to generate new file from PPSIM.FAKE.CHIP"));
-            psFree(fpa);
-            return NULL;
-        }
-        if (fakeImage->type != PM_FPA_FILE_IMAGE) {
-            psError(PS_ERR_IO, true, "PPSIM.FAKE.CHIP is not of type IMAGE");
-            psFree(fpa);
-            return NULL;
-        }
-
-        // we need a chip image if we perform photometry (is it necessary to build it if we don't use it?)
-        pmFPAfile *forceImage = NULL;
-        if (input) {
-            forceImage = pmFPAfileDefineChipMosaic(config, input->fpa, "PPSIM.FORCE.CHIP");
-            if (!forceImage) {
-                psError(PS_ERR_IO, false, _("Unable to generate new file from PPSIM.FORCE.CHIP"));
-                psFree(fpa);
-                return NULL;
-            }
-            if (forceImage->type != PM_FPA_FILE_IMAGE) {
-                psError(PS_ERR_IO, true, "PPSIM.FORCE.CHIP is not of type IMAGE");
-                psFree(fpa);
-                return NULL;
-            }
-        }
-
-        // define associated psphot input/output files
-        if (!ppSimPhotomFiles (config, fakeImage, forceImage)) {
-            psError(PSPHOT_ERR_CONFIG, false, "Trouble defining the additional input/output files for psphot");
-            psFree(fpa);
-            return NULL;
-        }
-    } else {
-        // have we supplied a psf model?  this happens in ppSimPhotomFiles if we request a photometry
-        // analysis.  however, even if we do not, a psf model may be used to generate the fake
-        // sources.
-        if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.PSF")) {
-            // tie the psf file to the chipMosaic
-            pmFPAfileBindFromArgs(&status, output, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF");
-            if (!status) {
-                psError(PS_ERR_UNKNOWN, false, "Failed to find/build PSPHOT.PSF.LOAD");
-                psFree(fpa);
-                return NULL;
-            }
-        }
+	psError(PS_ERR_UNKNOWN, false, "in-line photometry in ppSim had been deprecated");
+	return NULL;
+    }
+
+    // have we supplied a psf model?  this happens in ppSimPhotomFiles if we request a photometry
+    // analysis.  however, even if we do not, a psf model may be used to generate the fake
+    // sources.
+    if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.PSF")) {
+	// tie the psf file to the chipMosaic
+	pmFPAfileBindFromArgs(&status, output, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF");
+	if (!status) {
+	    psError(PS_ERR_UNKNOWN, false, "Failed to find/build PSPHOT.PSF.LOAD");
+	    psFree(fpa);
+	    return NULL;
+	}
     }
 
@@ -257,4 +214,17 @@
                 }
             }
+	    // XXX this is a hack, but I don't have a better way at the moment: assumes a single cell per chip
+	    if (nx) {
+		psMetadataAddS32(chip->concepts, PS_LIST_TAIL, "CHIP.XSIZE", PS_META_REPLACE, "", nx);
+	    } else {
+		nx = psMetadataLookupF32(&status, cell->concepts, "CELL.XSIZE");
+		psMetadataAddS32(chip->concepts, PS_LIST_TAIL, "CHIP.XSIZE", PS_META_REPLACE, "", nx);
+	    }
+	    if (ny) {
+		psMetadataAddS32(chip->concepts, PS_LIST_TAIL, "CHIP.YSIZE", PS_META_REPLACE, "", ny);
+	    } else {
+		ny = psMetadataLookupF32(&status, cell->concepts, "CELL.YSIZE");
+		psMetadataAddS32(chip->concepts, PS_LIST_TAIL, "CHIP.YSIZE", PS_META_REPLACE, "", ny);
+	    }
         }
     }
