Index: /trunk/psphot/src/psphot.h
===================================================================
--- /trunk/psphot/src/psphot.h	(revision 10436)
+++ /trunk/psphot/src/psphot.h	(revision 10437)
@@ -10,4 +10,5 @@
 
 # include "psphotErrorCodes.h"
+#define PSPHOT_RECIPE "PSPHOT" // Name of the recipe to use
 
 // top-level psphot functions
Index: /trunk/psphot/src/psphotArguments.c
===================================================================
--- /trunk/psphot/src/psphotArguments.c	(revision 10436)
+++ /trunk/psphot/src/psphotArguments.c	(revision 10437)
@@ -13,5 +13,5 @@
 
     // load config data from default locations
-    pmConfig *config = pmConfigRead(&argc, argv, "PSPHOT");
+    pmConfig *config = pmConfigRead(&argc, argv, PSPHOT_RECIPE);
     if (config == NULL) {
         psError(PSPHOT_ERR_CONFIG, false, "Can't read site configuration");
@@ -21,22 +21,5 @@
     // save the following additional recipe values based on command-line options
     // these options override the PSPHOT recipe values loaded from recipe files
-
-    // if the recipe is already defined in config->arguments, supplement
-    // save the recipe options onto config->arguments:RECIPES
-    psMetadata *recipes = psMetadataLookupMetadata(NULL, config->arguments, "RECIPES");
-    if (!recipes) {
-	recipes = psMetadataAlloc ();
-	psMetadataAddPtr (config->arguments, PS_LIST_TAIL, "RECIPES",  PS_DATA_METADATA, "", recipes);
-    } else {
-	psMemIncrRefCounter (recipes); // so we can free options below if not allocated here
-    }
-    // look for the recipe defined in recipes
-    psMetadata *options = psMetadataLookupMetadata(NULL, recipes, "PSPHOT");
-    if (!options) {
-	options = psMetadataAlloc ();
-	psMetadataAddPtr (recipes, PS_LIST_TAIL, "PSPHOT",  PS_DATA_METADATA, "", options);
-    } else {
-	psMemIncrRefCounter (options); // so we can free options below if not allocated here
-    }
+    psMetadata *options = pmConfigRecipeOptions (config, PSPHOT_RECIPE);
 
     // run the test model (requires X,Y coordinate)
@@ -100,5 +83,4 @@
     // drop the local view on the options (saved in config->arguments)
     psFree (options);
-    psFree (recipes);
 
     // the input file is a required argument; if not found, we will exit
Index: /trunk/psphot/src/psphotImageMedian.c
===================================================================
--- /trunk/psphot/src/psphotImageMedian.c	(revision 10436)
+++ /trunk/psphot/src/psphotImageMedian.c	(revision 10437)
@@ -19,5 +19,5 @@
 
     // select the appropriate recipe information
-    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PSPHOT");
+    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
 
     // user supplied seed, if available
Index: /trunk/psphot/src/psphotParseCamera.c
===================================================================
--- /trunk/psphot/src/psphotParseCamera.c	(revision 10436)
+++ /trunk/psphot/src/psphotParseCamera.c	(revision 10437)
@@ -14,5 +14,5 @@
 
     // select recipe options supplied on command line
-    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PSPHOT");
+    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
 
     // set default recipe values here
Index: /trunk/psphot/src/psphotReadout.c
===================================================================
--- /trunk/psphot/src/psphotReadout.c	(revision 10436)
+++ /trunk/psphot/src/psphotReadout.c	(revision 10437)
@@ -4,5 +4,5 @@
 
     // select the current recipe
-    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSPHOT");
+    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE);
 
     // find the currently selected readout
