Index: /trunk/psastro/src/psastroAnalysis.c
===================================================================
--- /trunk/psastro/src/psastroAnalysis.c	(revision 14163)
+++ /trunk/psastro/src/psastroAnalysis.c	(revision 14164)
@@ -3,4 +3,5 @@
 bool psastroAnalysis (pmConfig *config) {
 
+    bool status;
     int nStars;
 
@@ -28,9 +29,22 @@
     }
 
-    // XXX does this check the recipe??
-    bool chipastro = psMetadataLookupBool (NULL, config->arguments, "PSASTRO.CHIP.MODE");
-    bool mosastro  = psMetadataLookupBool (NULL, config->arguments, "PSASTRO.MOSAIC.MODE");
+    // 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;
+    }
+
+    // check the command-line arguments first
+    bool chipastro = psMetadataLookupBool (&status, config->arguments, "PSASTRO.CHIP.MODE");
+    if (!status) {
+	chipastro = psMetadataLookupBool (&status, recipe, "PSASTRO.CHIP.MODE");
+    }
+    bool mosastro  = psMetadataLookupBool (&status, config->arguments, "PSASTRO.MOSAIC.MODE");
+    if (!status) {
+	mosastro  = psMetadataLookupBool (&status, recipe, "PSASTRO.MOSAIC.MODE");
+    }
     if (!chipastro && !mosastro) {
-	psLogMsg ("psastro", 3, "no astrometry mode selected, assuming chip mode\n");
+	psLogMsg ("psastro", 3, "no astrometry mode selected, assuming chip astrometry\n");
 	chipastro = true;
     }
