Index: trunk/psastro/src/psastro.c
===================================================================
--- trunk/psastro/src/psastro.c	(revision 9574)
+++ trunk/psastro/src/psastro.c	(revision 9587)
@@ -39,5 +39,5 @@
 
     // load the reference stars overlapping the data stars
-    psArray *refs = psastroLoadReferences (config);
+    psArray *refs = psastroLoadRefstars (config);
     if (!refs) {
 	psErrorStackPrint(stderr, "failed to load reference data");
@@ -45,6 +45,9 @@
     }
 
-    // XXX ?? what does this do ??
-    psastroMosaicGetRefstars (config, refs);
+    // choose reference stars corresponding to the selected chips
+    if (psastroChooseRefstars (config, refs)) {
+	psErrorStackPrint(stderr, "failed to select reference data for chips");
+	exit (1);
+    }
 
     char *mosastro = psMetadataLookupStr (NULL, config->arguments, "MOSASTRO");
