Index: trunk/psphot/src/psphotOutput.c
===================================================================
--- trunk/psphot/src/psphotOutput.c	(revision 13008)
+++ trunk/psphot/src/psphotOutput.c	(revision 13035)
@@ -59,5 +59,5 @@
         for (int j = 0; j < source->pixels->numCols; j++) {
             // skip masked points
-            if (source->mask->data.U8[i][j]) {
+            if (source->maskObj->data.U8[i][j]) {
                 continue;
             }
@@ -72,5 +72,5 @@
 		     source->pixels->data.F32[i][j],
 		     1.0 / source->weight->data.F32[i][j],
-		     source->mask->data.U8[i][j]);
+		     source->maskObj->data.U8[i][j]);
         }
     }
@@ -104,5 +104,5 @@
     for (int i = 0; (sources != NULL) && (i < sources->n); i++) {
         pmSource *source = (pmSource *) sources->data[i];
-        pmModel *model = pmSourceSelectModel (source);
+        pmModel *model = pmSourceGetModel (NULL, source);
         if (model == NULL)
             continue;
@@ -154,68 +154,2 @@
     return header;
 }
-
-# if (0)
-// output functions: we have several fixed modes (sx, obj, cmp)
-void psphotOutput (pmReadout *readout, psMetadata *arguments) {
-
-    bool status;
-    char *outputFile = NULL;
-
-    psMetadata *header = pmReadoutGetHeader (readout);
-
-    pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
-    // sample PSF images??
-    if (psfSample != NULL) psphotSamplePSFs (psf, readout->image, psfSample);
-    if (psfSample != NULL) psphotSamplePSFs (psf, readout->image, psfSample);
-
-    if (psfFile != NULL) {
-	psMetadata *psfData = pmPSFtoMD (NULL, psf);
-	psMetadataConfigWrite (psfData, psfFile);
-	psFree (psfData);
-    }
-}
-
-psImage *pmModelPSFatXY (psImage *image, pmModel *modelEXT, pmPSF *psf, int x, int y, int dx, int dy) {
-
-    psRegion region = {x - dx, x + dx, y - dy, y + dy};
-    psImage *view = psImageSubset (image, region);
-    psImage *sample = psImageCopy (NULL, view, PS_TYPE_F32);
-    psImageInit (sample, 0);
-    modelEXT->params->data.F32[2] = x;
-    modelEXT->params->data.F32[3] = y;
-    pmModel *modelPSF = pmModelFromPSF (modelEXT, psf);
-    pmModelAdd (sample, NULL, modelPSF, false, false);
-    psFree (modelPSF);
-    return (sample);
-}
-
-bool psphotSamplePSFs (pmPSF *psf, psImage *image, char *output) {
-
-    // make sample PSFs for 4 corners and the center
-    psImage *sample;
-
-    // optional dump of all rough source data
-    if (output[0] == 0) return false;
-
-    pmModel *modelEXT = pmModelAlloc (psf->type);
-    modelEXT->params->data.F32[0] = 0;
-    modelEXT->params->data.F32[1] = 1;
-
-    psFits *fits = psFitsOpen (output, "w");
-
-    // the centers are in parent coordinates; they do not need to correspond to valid pixels...
-    sample = pmModelPSFatXY (image, modelEXT, psf, 25, 25, 25, 25);
-    psFitsWriteImage (fits, NULL, sample, 0);
-    sample = pmModelPSFatXY (image, modelEXT, psf, image->numCols - 25, image->numRows - 25, 25, 25);
-    psFitsWriteImage (fits, NULL, sample, 0);
-    sample = pmModelPSFatXY (image, modelEXT, psf, image->numCols - 25, 25, 25, 25);
-    psFitsWriteImage (fits, NULL, sample, 0);
-    sample = pmModelPSFatXY (image, modelEXT, psf, 25, image->numRows - 25, 25, 25);
-    psFitsWriteImage (fits, NULL, sample, 0);
-    sample = pmModelPSFatXY (image, modelEXT, psf, image->numCols / 2, image->numRows / 2, 25, 25);
-    psFitsWriteImage (fits, NULL, sample, 0);
-
-    psFitsClose (fits);
-    return (TRUE);
-}
-# endif
