Index: /branches/eam_branch_20080511/ppSim/src/ppSimCreate.c
===================================================================
--- /branches/eam_branch_20080511/ppSim/src/ppSimCreate.c	(revision 17959)
+++ /branches/eam_branch_20080511/ppSim/src/ppSimCreate.c	(revision 17960)
@@ -73,4 +73,18 @@
 	}
 	psMetadataAddF32(recipe, PS_LIST_TAIL, "SEEING", PS_META_REPLACE, "Seeing SIGMA (pixels)", seeing / 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) {
+	    float ra = psMetadataLookupF32(&status, recipe, "RA");
+	    if (isnan(ra)) {
+		ra = psMetadataLookupF64(&status, input->fpa->concepts, "FPA.RA");
+		psMetadataAddF32(recipe, PS_LIST_TAIL, "RA", PS_META_REPLACE, "ra (radians)", ra);
+	    }
+	    float dec = psMetadataLookupF32(&status, recipe, "DEC");
+	    if (isnan(dec)) {
+		dec = psMetadataLookupF64(&status, input->fpa->concepts, "FPA.DEC");
+		psMetadataAddF32(recipe, PS_LIST_TAIL, "DEC", PS_META_REPLACE, "dec (radians)", dec);
+	    }
+	}
     }
 
@@ -90,5 +104,15 @@
     if (doPhotom) {
 
-	// XXX optionally select fake and/or force
+	// 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?)
