Index: trunk/psastro/src/psastroMosaicSetMatch.c
===================================================================
--- trunk/psastro/src/psastroMosaicSetMatch.c	(revision 21422)
+++ trunk/psastro/src/psastroMosaicSetMatch.c	(revision 26259)
@@ -26,7 +26,10 @@
     double RADIUS = psMetadataLookupF32 (&status, recipe, radiusWord);
     if (!status) {
-        psError(PS_ERR_IO, false, "Failed to lookup matching radius: %s", radiusWord);
-        psFree (view);
-        return false;
+        psAbort("Failed to lookup matching radius: %s", radiusWord);
+    }
+
+    int uniqIter = psMetadataLookupS32 (&status, recipe, "PSASTRO.MOSAIC.UNIQ.ITER");
+    if (!status) {
+        psAbort("Failed to lookup matching PSASTRO.MOSAIC.UNIQ.ITER");
     }
 
@@ -58,9 +61,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);
@@ -68,4 +71,14 @@
                 psArray *matches = pmAstromRadiusMatchChip (rawstars, refstars, RADIUS);
                 psTrace ("psastro", 4, "Matched %ld refstars\n", matches->n);
+
+		if (iteration >= uniqIter) {
+		    psArray *unique = pmAstromRadiusMatchUniq (rawstars, refstars, matches);
+		    if (!unique) {
+			psLogMsg ("psastro", 3, "failed to generate a uniq set of matched sources\n");
+			return false;
+		    }
+		    psFree (matches);
+		    matches = unique;
+		}
 
                 pmAstromVisualPlotMosaicMatches(rawstars, refstars, matches, iteration, recipe);
