Index: /trunk/psphot/src/psphotArguments.c
===================================================================
--- /trunk/psphot/src/psphotArguments.c	(revision 10553)
+++ /trunk/psphot/src/psphotArguments.c	(revision 10554)
@@ -89,5 +89,12 @@
     }
 
-    // drop the local view on the options (saved in config->arguments)
+    // chip selection is used to limit chips to be processed
+    if ((N = psArgumentGet (argc, argv, "-chip"))) {
+        psArgumentRemove (N, &argc, argv);
+        psMetadataAddStr (options, PS_LIST_TAIL, "CHIP_SELECTIONS", PS_DATA_STRING, "", argv[N]);
+        psArgumentRemove (N, &argc, argv);
+    }
+
+    // drop the local view on the options (saved in config->arguments:PSPHOT_RECIPE)
     psFree (options);
 
@@ -97,11 +104,4 @@
         psError(PSPHOT_ERR_ARGUMENTS, false, "pmConfigFileSetsMD failed to parse arguments");
         return NULL;
-    }
-
-    // chip selection is used to limit chips to be processed
-    if ((N = psArgumentGet (argc, argv, "-chip"))) {
-        psArgumentRemove (N, &argc, argv);
-        psMetadataAddStr (config->arguments, PS_LIST_TAIL, "CHIP_SELECTIONS", PS_DATA_STRING, "", psStringCopy(argv[N]));
-        psArgumentRemove (N, &argc, argv);
     }
 
Index: /trunk/psphot/src/psphotParseCamera.c
===================================================================
--- /trunk/psphot/src/psphotParseCamera.c	(revision 10553)
+++ /trunk/psphot/src/psphotParseCamera.c	(revision 10554)
@@ -74,11 +74,12 @@
 
     // Chip selection: turn on only the chips specified (pass status to suppress missing-key log msg)
-    // XXX why not put this in the recipe?
-    char *chipLine = psMetadataLookupStr(&status, config->arguments, "CHIP_SELECTIONS");
+    char *chipLine = psMetadataLookupStr(&status, recipe, "CHIP_SELECTIONS");
     psArray *chips = psStringSplitArray (chipLine, ",", false);
     if (chips->n > 0) {
+	// select on the basis of extname?
 	pmFPASelectChip (input->fpa, -1, true); // deselect all chips
 	for (int i = 0; i < chips->n; i++) {
 	    int chipNum = atoi(chips->data[i]);
+	    fprintf (stderr, "select chip %d\n", chipNum);
 	    if (! pmFPASelectChip(input->fpa, chipNum, false)) {
 		psError(PS_ERR_IO, false, "Chip number %d doesn't exist in camera.\n", chipNum);
