Index: /trunk/psastro/src/psastroChooseRefstars.c
===================================================================
--- /trunk/psastro/src/psastroChooseRefstars.c	(revision 13163)
+++ /trunk/psastro/src/psastroChooseRefstars.c	(revision 13164)
@@ -24,4 +24,6 @@
     float fieldExtra = psMetadataLookupS32 (&status, recipe, "PSASTRO.FIELD.EXTRA");
     if (!status) fieldExtra = 0.0;
+
+    bool matchLumFunc = psMetadataLookupBool (&status, recipe, "PSASTRO.MATCH.LUMFUNC");
 
     pmFPAview *view = pmFPAviewAlloc (0);
@@ -77,15 +79,13 @@
                 psTrace ("psastro", 4, "Added %ld refstars\n", refstars->n);
 
-                psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.REFSTARS", PS_DATA_ARRAY, "astrometry matches", refstars);
-                psFree (refstars);
+		psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.REFSTARS", PS_DATA_ARRAY, "astrometry matches", refstars);
+		psFree (refstars);
 
-		// XXX TEST : skip the luminosity function selection
-		continue;
-
-		// XXX this error means the readout fails, but should probably not kill the entire program
-		// in this case, no PSASTRO.REFSTARS is added to readout->analysis
-                if (!psastroRefstarSubset (readout)) {
-		    psError(PSASTRO_ERR_DATA, false, "Can't determine an appropriate refstar subset\n");
-		    return false;
+		if (matchLumFunc) {
+		    // in this case, no PSASTRO.REFSTARS is added to readout->analysis
+		    if (!psastroRefstarSubset (readout)) {
+			psError(PSASTRO_ERR_DATA, false, "Can't determine an appropriate refstar subset\n");
+			return false;
+		    }
 		}
             }
