Index: trunk/psphot/src/psphotImageMedian.c
===================================================================
--- trunk/psphot/src/psphotImageMedian.c	(revision 6571)
+++ trunk/psphot/src/psphotImageMedian.c	(revision 6715)
@@ -11,5 +11,5 @@
 // generate the median in NxN boxes, clipping heavily
 // linear interpolation to generate full-scale model
-psImage *psphotImageMedian (psMetadata *config, pmFPAview *view) 
+bool psphotImageMedian (pmConfig *config, pmFPAview *view) 
 { 
     bool status;
@@ -21,6 +21,6 @@
     // find the currently selected readout
     psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PSPHOT");
-    pmFPA *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT");
-    pmReadout  *readout = pmFPAviewThisReadout (view, input);
+    pmFPAfile  *input   = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT");
+    pmReadout  *readout = pmFPAviewThisReadout (view, input->fpa);
 
     psImage *image = readout->image;
@@ -28,5 +28,5 @@
 
     rnd = psRandomAlloc (PS_RANDOM_TAUS, 0);
-    MAX_SAMPLE_PIXELS = psMetadataLookupF32 (&status, config, "IMSTATS_NPIX");
+    MAX_SAMPLE_PIXELS = psMetadataLookupF32 (&status, recipe, "IMSTATS_NPIX");
     if (!status) MAX_SAMPLE_PIXELS = 1000;
 
@@ -36,7 +36,7 @@
 
     // scaling factor
-    int DX = psMetadataLookupS32 (&status, config, "BACKGROUND_XBIN");
+    int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND_XBIN");
     if (!status) {DX = 64;}
-    int DY = psMetadataLookupS32 (&status, config, "BACKGROUND_YBIN");
+    int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND_YBIN");
     if (!status) {DY = 64;}
 
@@ -79,5 +79,5 @@
 
     // select background pixels, from output background file, or create
-    background = pmFPAfileReadoutImage (config->files, view, "PSPHOT.BACKGND", Nx, Ny, PS_TYPE_F32);
+    psImage *background = pmFPAfileReadoutImage (config->files, view, "PSPHOT.BACKGND", Nx, Ny, PS_TYPE_F32);
 
     // XXX this code skips the initial pixels
@@ -212,5 +212,5 @@
 
     // back-sub image pixels, from output background file (don't create if not requested)
-    backSub = pmFPAfileReadoutImage (config->files, view, "PSPHOT.BACKSUB", 0, 0, PS_TYPE_F32);
+    psImage *backSub = pmFPAfileReadoutImage (config->files, view, "PSPHOT.BACKSUB", 0, 0, PS_TYPE_F32);
 
     // subtract the background model
