Index: /branches/eam_branches/20091113/psastro/src/psastro.h
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastro.h	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastro.h	(revision 26167)
@@ -87,8 +87,9 @@
 psArray          *psastroRemoveClumps (psArray *input, int scale);
 psArray          *psastroRemoveClumpsIterate (psArray *input, int scale, int nIter);
+bool              psastroRemoveClumpsRawstars (pmConfig *config);
 
 
 // utility functions:
-bool              psastroUpdateChipToFPA (pmFPA *fpa, pmChip *chip, psArray *rawstars, psArray *refstars);
+bool              psastroUpdateChipToFPA (pmFPA *fpa, pmChip *chip);
 bool              psastroWriteStars (char *filename, psArray *sources);
 bool              psastroWriteTransform (psPlaneTransform *map);
Index: /branches/eam_branches/20091113/psastro/src/psastroAnalysis.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroAnalysis.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroAnalysis.c	(revision 26167)
@@ -69,4 +69,9 @@
     }
 
+    if (!psastroRemoveClumpsRawstars(config)) {
+        psError (PSASTRO_ERR_UNKNOWN, false, "failed to remove RAWSTAR clumps\n");
+        return false;
+    }
+
     // load the reference stars overlapping the data stars
     psArray *refs = psastroLoadRefstars(config, "PSASTRO.INPUT");
Index: /branches/eam_branches/20091113/psastro/src/psastroChipAstrom.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroChipAstrom.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroChipAstrom.c	(revision 26167)
@@ -56,12 +56,10 @@
 
                 // select the raw objects for this readout
-                psArray *rawstarsAll = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.RAWSTARS");
-                if (rawstarsAll == NULL) { continue; }
-		psArray *rawstars = psastroRemoveClumpsIterate(rawstarsAll, 150, 3);
+                psArray *rawstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.RAWSTARS.SUBSET");
+                if (rawstars == NULL) { continue; }
 
                 // select the raw objects for this readout
-                psArray *refstarsAll = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.REFSTARS");
-                if (refstarsAll == NULL) { continue; }
-		psArray *refstars = psastroRemoveClumpsIterate(refstarsAll, 150, 2);
+                psArray *refstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.REFSTARS.SUBSET");
+                if (refstars == NULL) { continue; }
 
                 // the absolute minimum number of stars is 4 (for order = 1)
@@ -69,6 +67,4 @@
                     readout->data_exists = false;
                     psLogMsg ("psastro", 3, "insufficient rawstars (%ld) or refstars (%ld)", rawstars->n, refstars->n);
-		    psFree (rawstars);
-		    psFree (refstars);
                     continue;
                 }
@@ -87,6 +83,4 @@
                     readout->data_exists = false;
                     psLogMsg ("psastro", 3, "failed to find a solution\n");
-		    psFree (rawstars);
-		    psFree (refstars);
                     continue;
                 }
@@ -95,11 +89,6 @@
                     readout->data_exists = false;
                     psLogMsg ("psastro", 3, "failed to find a solution\n");
-		    psFree (rawstars);
-		    psFree (refstars);
                     continue;
                 }
-
-		psFree (rawstars);
-		psFree (refstars);
 
                 numGoodRO++;
Index: /branches/eam_branches/20091113/psastro/src/psastroChooseRefstars.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroChooseRefstars.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroChooseRefstars.c	(revision 26167)
@@ -134,9 +134,17 @@
 
 		psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.REFSTARS", PS_DATA_ARRAY, "astrometry matches", refstars);
+
+		// generate a reduced subset excluding the clumps
+		// XXX do we need both REFSTARS and SUBSET? 
+		psArray *subset = psastroRemoveClumpsIterate(refstars, 150, 3);
+		psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.REFSTARS.SUBSET", PS_DATA_ARRAY, "astrometry objects", subset);
+
 		psFree (refstars);
+		psFree (subset);
 		psFree (extent);
 
 		if (matchLumFunc) {
-		    // in this case, no PSASTRO.REFSTARS is added to readout->analysis
+		    // limit the total magnitude range of PSASTRO.REFSTARS.SUBSET based on
+		    // overlapping luminosity functions
 		    if (!psastroRefstarSubset (readout)) {
 			psError(PSASTRO_ERR_DATA, false, "Can't determine an appropriate refstar subset\n");
Index: /branches/eam_branches/20091113/psastro/src/psastroDemoDump.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroDemoDump.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroDemoDump.c	(revision 26167)
@@ -160,9 +160,9 @@
 
 		// select the raw objects for this readout
-		psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");
+		psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS.SUBSET");
 		if (rawstars == NULL) continue;
 
 		// select the raw objects for this readout
-		psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");
+		psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS.SUBSET");
 		if (refstars == NULL) continue;
 		psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n);
Index: /branches/eam_branches/20091113/psastro/src/psastroFixChips.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroFixChips.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroFixChips.c	(revision 26167)
@@ -319,5 +319,5 @@
         }
 
-        psastroUpdateChipToFPA (input->fpa, obsChip, rawstars, refstars);
+        psastroUpdateChipToFPA (input->fpa, obsChip);
 
         // XXX update the header with info to reflect the failure
Index: /branches/eam_branches/20091113/psastro/src/psastroFixChipsTest.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroFixChipsTest.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroFixChipsTest.c	(revision 26167)
@@ -246,5 +246,5 @@
 	} 
 
-	psastroUpdateChipToFPA (fpa, chip, rawstars, refstars);
+	psastroUpdateChipToFPA (fpa, chip);
 
 	// XXX skip the re-fit step for a test
Index: /branches/eam_branches/20091113/psastro/src/psastroLoadGhosts.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroLoadGhosts.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroLoadGhosts.c	(revision 26167)
@@ -119,5 +119,7 @@
                 if (! readout->data_exists) { continue; }
 
-                // select the raw objects for this readout (loaded in psastroExtract.c)
+                // select the raw objects for this readout (loaded in psastroChooseRefstars.c)
+		// XXX : note that we place limits on the refstar sample in psastroChooseRefstars.c:
+		// 1) on chip and 2) < PSASTRO.MAX.NREF. magnitude limits and clump exclusion are only 
                 psArray *refstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.REFSTARS");
                 if (refstars == NULL) { continue; }
Index: /branches/eam_branches/20091113/psastro/src/psastroMaskUpdates.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroMaskUpdates.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroMaskUpdates.c	(revision 26167)
@@ -182,4 +182,7 @@
 
                 // select the raw objects for this readout
+		// XXX : note that we place limits on the refstar sample in psastroChooseRefstars.c:
+		// 1) on chip and 2) < PSASTRO.MAX.NREF. magnitude limits and clump exclusion are only 
+		// applied to the SUBSETs
                 psArray *refstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.REFSTARS");
                 if (!refstars) continue;
Index: /branches/eam_branches/20091113/psastro/src/psastroMosaicFPtoTP.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroMosaicFPtoTP.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroMosaicFPtoTP.c	(revision 26167)
@@ -45,9 +45,9 @@
 
 		// select the raw objects for this readout
-		psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");
+		psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS.SUBSET");
 		if (rawstars == NULL) { continue; }
 
 		// select the raw objects for this readout
-		psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");
+		psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS.SUBSET");
 		if (refstars == NULL) { continue; }
 
@@ -126,4 +126,6 @@
 }
 
+// apply the rotation and scale to all stars in PSASTRO.REFSTARS (also adjusts
+// PSASTRO.REFSTARS.SUBSET since they are the same pointers)
 bool psastroMosaicApplyRotAndScale (pmFPA *fpa, psPlaneTransform *TPtoFP) {
 
Index: /branches/eam_branches/20091113/psastro/src/psastroMosaicGetGrads.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroMosaicGetGrads.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroMosaicGetGrads.c	(revision 26167)
@@ -27,9 +27,9 @@
 
 		// select the raw objects for this readout
-		psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");
+		psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS.SUBSET");
 		if (rawstars == NULL) { continue; }
 
 		// select the raw objects for this readout
-		psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");
+		psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS.SUBSET");
 		if (refstars == NULL) { continue; }
 
Index: /branches/eam_branches/20091113/psastro/src/psastroMosaicGradients.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroMosaicGradients.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroMosaicGradients.c	(revision 26167)
@@ -48,9 +48,9 @@
 
 		// select the raw objects for this readout
-		psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");
+		psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS.SUBSET");
 		if (rawstars == NULL) { continue; }
 
 		// select the raw objects for this readout
-		psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");
+		psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS.SUBSET");
 		if (refstars == NULL) { continue; }
 
Index: /branches/eam_branches/20091113/psastro/src/psastroMosaicOneChip.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroMosaicOneChip.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroMosaicOneChip.c	(revision 26167)
@@ -31,8 +31,8 @@
 
     // select the raw objects for this readout
-    psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");
+    psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS.SUBSET");
     if (rawstars == NULL) return false;
 
-    psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");
+    psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS.SUBSET");
     if (refstars == NULL) return false;
 
@@ -162,5 +162,5 @@
 
     // determine fromFPA transformation and apply new transformation to raw & ref stars
-    psastroUpdateChipToFPA (fpa, chip, rawstars, refstars);
+    psastroUpdateChipToFPA (fpa, chip);
 
     //plot results
Index: /branches/eam_branches/20091113/psastro/src/psastroMosaicSetMatch.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroMosaicSetMatch.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroMosaicSetMatch.c	(revision 26167)
@@ -58,9 +58,9 @@
 
                 // select the raw objects for this readout
-                psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");
+                psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS.SUBSET");
                 if (rawstars == NULL) { continue; }
 
                 // select the raw objects for this readout
-                psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");
+                psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS.SUBSET");
                 if (refstars == NULL) { continue; }
                 psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n);
Index: /branches/eam_branches/20091113/psastro/src/psastroOneChipFit.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroOneChipFit.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroOneChipFit.c	(revision 26167)
@@ -118,5 +118,5 @@
         // determine fromFPA transformation and apply new transformation to raw & ref stars
 	// this applies the transformation to all stars (including subset)
-        psastroUpdateChipToFPA (fpa, chip, rawstars, refstars);
+        psastroUpdateChipToFPA (fpa, chip); // updates PSASTRO.RAWSTARS and PSASTRO.REFSTARS
 
         // toSky converts from FPA & TPA units (microns) to sky units (radians)
@@ -171,7 +171,4 @@
     psMetadataAddF32 (updates, PS_LIST_TAIL, "EQUINOX",  PS_META_REPLACE, "equinox of ref catalog", 2000.0); // XXX this is bogus: should be defined based on equinox of refstars
 
-    // XXX drop from here : determine fromFPA transformation and apply new transformation to raw & ref stars
-    // psastroUpdateChipToFPA (fpa, chip, rawstars, refstars);
-
     // XXX check if we correctly applied the new transformation:
     if (psTraceGetLevel("psastro.dump") > 0) {
Index: /branches/eam_branches/20091113/psastro/src/psastroOneChipGrid.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroOneChipGrid.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroOneChipGrid.c	(revision 26167)
@@ -59,5 +59,5 @@
     // adjust the chip.toFPA terms only
     pmAstromGridApply (chip->toFPA, stats);
-    psastroUpdateChipToFPA (fpa, chip, rawstars, refstars);
+    psastroUpdateChipToFPA (fpa, chip); // updates PSASTRO.RAWSTARS and PSASTRO.REFSTARS
     psFree (gridStats);
     psFree (gridStars);
Index: /branches/eam_branches/20091113/psastro/src/psastroRefstarSubset.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroRefstarSubset.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroRefstarSubset.c	(revision 26167)
@@ -16,5 +16,5 @@
 
   // select the raw objects for this readout
-  psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");
+  psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS.SUBSET");
   if (rawstars == NULL)  {
     psError(PSASTRO_ERR_DATA, false, "missing rawstars in psastroRefstarSubset\n");
@@ -23,5 +23,5 @@
 
   // select the raw objects for this readout
-  psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");
+  psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS.SUBSET");
   if (refstars == NULL)  {
     psError(PSASTRO_ERR_DATA, false, "missing refstars in psastroRefstarSubset\n");
@@ -74,6 +74,6 @@
   psLogMsg ("psastro", 4, "keeping %ld of %ld reference stars\n", subset->n, refstars->n);
 
-  psMetadataRemoveKey (readout->analysis, "PSASTRO.REFSTARS");
-  psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.REFSTARS", PS_DATA_ARRAY, "astrometry matches", subset);
+  psMetadataRemoveKey (readout->analysis, "PSASTRO.REFSTARS.SUBSET");
+  psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.REFSTARS.SUBSET", PS_DATA_ARRAY, "astrometry matches", subset);
 
   if (psTraceGetLevel("psastro.dump") > 0) {
Index: /branches/eam_branches/20091113/psastro/src/psastroRemoveClumps.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroRemoveClumps.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroRemoveClumps.c	(revision 26167)
@@ -12,4 +12,59 @@
 
 # include "psastroInternal.h"
+
+bool psastroRemoveClumpsRawstars (pmConfig *config) {
+
+    bool status;
+
+    pmChip *chip = NULL;
+    pmCell *cell = NULL;
+    pmReadout *readout = NULL;
+
+    // select the current recipe
+    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE);
+    if (!recipe) {
+        psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe");
+        return false;
+    }
+
+    // select the input data sources
+    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSASTRO.INPUT");
+    if (!input) {
+        psError(PSASTRO_ERR_CONFIG, true, "Can't find input data");
+        return false;
+    }
+
+    pmFPAview *view = pmFPAviewAlloc (0);
+    pmFPA *fpa = input->fpa;
+
+    while ((chip = pmFPAviewNextChip (view, fpa, 1)) != NULL) {
+        psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
+        if (!chip->process || !chip->file_exists) { continue; }
+
+        while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {
+            psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
+            if (!cell->process || !cell->file_exists) { continue; }
+            if (!chip->fromFPA) { continue; }
+
+            // process each of the readouts
+            while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) {
+                if (! readout->data_exists) { continue; }
+
+                // select the raw objects for this readout
+                psArray *rawstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.RAWSTARS");
+                if (rawstars == NULL) { continue; }
+
+		// generate a reduced subset excluding the clumps
+		// XXX do we need both RAWSTARS and SUBSET? 
+		// XXX put these parameters in the recipe, please
+		psArray *subset = psastroRemoveClumpsIterate(rawstars, 150, 3);
+		psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.RAWSTARS.SUBSET", PS_DATA_ARRAY, "astrometry objects", subset);
+		psFree (subset);
+	    }
+	}
+    }
+    psFree (view);
+    return true;
+}
 
 psArray *psastroRemoveClumpsIterate (psArray *input, int scale, int nIter) {
Index: /branches/eam_branches/20091113/psastro/src/psastroUtils.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroUtils.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroUtils.c	(revision 26167)
@@ -106,5 +106,5 @@
 }
 
-bool psastroUpdateChipToFPA (pmFPA *fpa, pmChip *chip, psArray *rawstars, psArray *refstars) {
+bool psastroUpdateChipToFPA (pmFPA *fpa, pmChip *chip) {
 
     psRegion *region = pmChipPixels (chip);
@@ -114,15 +114,33 @@
     psFree (region);
 
-    for (int i = 0; i < rawstars->n; i++) {
-        pmAstromObj *raw = rawstars->data[i];
-
-        psPlaneTransformApply (raw->FP, chip->toFPA, raw->chip);
-        psPlaneTransformApply (raw->TP, fpa->toTPA, raw->FP);
-        psDeproject (raw->sky, raw->TP, fpa->toSky);
-    }
-
-    for (int i = 0; i < refstars->n; i++) {
-        pmAstromObj *ref = refstars->data[i];
-        psPlaneTransformApply (ref->chip, chip->fromFPA, ref->FP);
+    // loop over cells in this chip
+    for (int nCell = 0; nCell < chip->cells->n; nCell++) {
+	pmCell *cell = chip->cells->data[nCell];
+	if (!cell->process || !cell->file_exists) { continue; }
+
+	// loop over readouts in this cell
+	for (int nRead = 0; nRead < cell->readouts->n; nRead++) {
+	    pmReadout *readout = cell->readouts->data[nRead];
+	    if (! readout->data_exists) { continue; }
+
+	    // select the raw objects for this readout
+	    psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");
+	    if (rawstars) { 
+		for (int i = 0; i < rawstars->n; i++) {
+		    pmAstromObj *raw = rawstars->data[i];
+		    psPlaneTransformApply (raw->FP, chip->toFPA, raw->chip);
+		    psPlaneTransformApply (raw->TP, fpa->toTPA, raw->FP);
+		    psDeproject (raw->sky, raw->TP, fpa->toSky);
+		}
+	    }
+
+	    psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");
+	    if (refstars) { 
+		for (int i = 0; i < refstars->n; i++) {
+		    pmAstromObj *ref = refstars->data[i];
+		    psPlaneTransformApply (ref->chip, chip->fromFPA, ref->FP);
+		}
+	    }
+	}
     }
 
Index: /branches/eam_branches/20091113/psastro/src/psastroZeroPoint.c
===================================================================
--- /branches/eam_branches/20091113/psastro/src/psastroZeroPoint.c	(revision 26166)
+++ /branches/eam_branches/20091113/psastro/src/psastroZeroPoint.c	(revision 26167)
@@ -113,9 +113,9 @@
 
     // select the raw objects for this readout
-    psArray *rawstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.RAWSTARS");
+    psArray *rawstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.RAWSTARS.SUBSET");
     if (rawstars == NULL) return dMag;
 
     // select the raw objects for this readout
-    psArray *refstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.REFSTARS");
+    psArray *refstars = psMetadataLookupPtr (&status, readout->analysis, "PSASTRO.REFSTARS.SUBSET");
     if (refstars == NULL) return dMag;
 
