Index: trunk/ppSim/src/ppSimArguments.c
===================================================================
--- trunk/ppSim/src/ppSimArguments.c	(revision 17557)
+++ trunk/ppSim/src/ppSimArguments.c	(revision 18011)
@@ -1,3 +1,3 @@
-#include "ppSim.h"
+# include "ppSim.h"
 
 // Print usage information and die
@@ -18,51 +18,40 @@
 }
 
-// Get a value from the command-line arguments and add it to recipe options
-bool valueArgRecipe(psMetadata *options,    // Target to which to add value
-                    const char *recipeName, // Name for value in the recipe
-		    psMetadata *arguments,  // Command-line arguments
-                    const char *argName	    // Argument name in the command-line arguments
-    )
+// this function supplements the RECIPE:OPTIONS folder with command-line options
+bool ppSimArguments(int argc, char **argv, pmConfig *config)
 {
-    bool status;						    // Status of MD lookup
-    float value = psMetadataLookupF32(&status, arguments, argName); // Value of interest
-    if (isnan(value)) return true;
-    status = psMetadataAddF32(options, PS_LIST_TAIL, recipeName, 0, NULL, value);
-    return status;
-}
-
-// this function supplements the RECIPE:OPTIONS folder with command-line options
-void ppSimArguments(int argc, char *argv[], pmConfig *config)
-{
-    bool mdok;                          // Status of MD lookup
+    bool status;
 
     assert(config);
 
-    // save the following command-line options in the arguments structure
+    // save the following command-line options in the arguments structure.  these will later be
+    // parsed and moved to the config->recipes:PPSIM_RECIPE folder
+
     psMetadata *arguments = psMetadataAlloc(); // Command-line arguments
-    psMetadataAddStr(arguments, PS_LIST_TAIL, "-format", 0, "Camera format name", NULL);
-    psMetadataAddStr(arguments, PS_LIST_TAIL, "-type", 0, "Exposure type (BIAS|DARK|FLAT|OBJECT)", NULL);
-    psMetadataAddStr(arguments, PS_LIST_TAIL, "-filter", 0, "Filter name", NULL);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-exptime", 0, "Exposure time (s)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-biaslevel", 0, "Bias level (e)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-biasrange", 0, "Bias range (e)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-darkrate", 0, "Dark rate (e/s)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-flatsigma", 0, "Flat sigma", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-flatrate", 0, "Flat rate (e/s)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-shuttertime", 0, "Shutter time (s)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-skyrate", 0, "Sky rate (e/s)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-skymags", 0, "Sky brightness in mags / square arcsec", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-ra", 0, "RA (degrees)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-dec", 0, "Dec (degrees)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-pa", 0, "Position angle (degrees)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-scale", 0, "Plate scale (arcsec/pixel)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp", 0, "Photometric zero point", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-seeing", 0, "Seeing FWHM (arcsec)", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-starslum", 0, "Fake star luminosity function slope", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-starsmag", 0, "Brightest magnitude for fake stars", NAN);
-    psMetadataAddF32(arguments, PS_LIST_TAIL, "-starsdensity", 0, "Density of fake stars at magnitude", NAN);
-    psMetadataAddStr(arguments, PS_LIST_TAIL, "-psfclass", 0, "Type of PSF model", NULL);
-    psMetadataAddStr(arguments, PS_LIST_TAIL, "-galmodel", 0, "Type of Galaxy model", NULL);
-    psMetadataAddS32(arguments, PS_LIST_TAIL, "-bin", 0, "Binning in x and y", 1);
+    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-format", 0, "Camera format name", NULL);
+    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-type", 0, "Exposure type (BIAS|DARK|FLAT|OBJECT)", NULL);
+    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-filter", 0, "Filter name", NULL);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-exptime", 0, "Exposure time (s)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-biaslevel", 0, "Bias level (e)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-biasrange", 0, "Bias range (e)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-darkrate", 0, "Dark rate (e/s)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-flatsigma", 0, "Flat sigma", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-flatrate", 0, "Flat rate (e/s)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-shuttertime", 0, "Shutter time (s)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-skyrate", 0, "Sky rate (e/s)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-skymags", 0, "Sky brightness in mags / square arcsec", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-ra", 0, "RA (degrees)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-dec", 0, "Dec (degrees)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-pa", 0, "Position angle (degrees)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-scale", 0, "Plate scale (arcsec/pixel)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-zp", 0, "Photometric zero point", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-seeing", 0, "Seeing FWHM (arcsec)", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-starslum", 0, "Fake star luminosity function slope", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-starsmag", 0, "Brightest magnitude for fake stars", NAN);
+    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-starsdensity", 0, "Density of fake stars at magnitude", NAN);
+    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-psfclass", 0, "Type of PSF model", NULL);
+    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-galmodel", 0, "Type of Galaxy model", NULL);
+    psMetadataAddS32(arguments,  PS_LIST_TAIL, "-bin", 0, "Binning in x and y", 1);
+    psMetadataAddBool(arguments, PS_LIST_TAIL, "+photom", 0, "Perform photometry on fake sources", false);
 
     if (psArgumentGet (argc, argv, "-h")) { usage(argv[0], arguments, config); }
@@ -71,19 +60,77 @@
 
     pmConfigFileSetsMD (config->arguments, &argc, argv, "PSPHOT.PSF", "-psf", "-psflist");
-
-    // only one of -camera and -file is needed
-    bool status = pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT", "-file", "-list");
-    if (!config->camera && !status) {
-        psErrorStackPrint(stderr, "A camera name (-camera NAME) or an image (-file NAME) must be specified");
-	exit(PS_EXIT_CONFIG_ERROR);
+    if (psErrorCodeLast () != PS_ERR_NONE) { psAbort ("problem with -psf or -psflist option"); }
+
+    pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT.SOURCES", "-cmf", "-cmflist");
+    if (psErrorCodeLast () != PS_ERR_NONE) { psAbort ("problem with -cmf or -cmflist option"); }
+
+    // Only one of -camera and -file is needed or allowed.  The -camera option would have been
+    // already parsed by pmConfigRead in ppSim.c and resulted in a value for config->camera
+    bool loadImage = pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT", "-input", "-inputlist");
+    if (!config->camera && !loadImage) {
+	psError(PS_ERR_IO, true, "A camera name (-camera NAME) or an input image (-input NAME) must be specified");
+        psFree(arguments);
+	return false;
+    }
+    if (config->camera && loadImage) {
+        psError(PS_ERR_IO, true, "Only one of (-camera NAME) and (-file NAME) may be specified");
+        psFree(arguments);
+	return false;
     }
 
     if (!psArgumentParse(arguments, &argc, argv)) { 
-	exit(PS_EXIT_CONFIG_ERROR);
+        psError(PS_ERR_IO, false, "error in command-line arguments");
+        psFree(arguments);
+	return false;
     }
 
     if (argc != 2) { 
-        psErrorStackPrint(stderr, "Missing output filename");
-	exit(PS_EXIT_CONFIG_ERROR);
+	psError(PS_ERR_IO, true, "Missing output filename");
+        psFree(arguments);
+	return false;
+    }
+
+    // output filename
+    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[1]);
+
+    // save the additional recipe values based on command-line options. These options override
+    // the PPSIM recipe values loaded from recipe files
+    psMetadata *options = pmConfigRecipeOptions (config, PPSIM_RECIPE);
+    if (!options) {
+        psError(PS_ERR_IO, false, "Unable to find recipe options for %s", PPSIM_RECIPE);
+        psFree(arguments);
+	return false;
+    }
+
+    // these arguments may be used whether the input image is created or loaded
+    ppSimArgToRecipeF32(&status, options, "STARS.LUM",     arguments, "-starslum");
+    ppSimArgToRecipeF32(&status, options, "STARS.MAG",     arguments, "-starsmag");
+    ppSimArgToRecipeF32(&status, options, "STARS.DENSITY", arguments, "-starsdensity");
+    ppSimArgToRecipeBool(&status, options, "PHOTOM",        arguments, "+photom");
+
+    // if we are loading the input image (not creating it), then we can skip the remaining arguments
+    if (loadImage) {
+	// if we are supplying an input image, it is so we may supply fake stars; force it to
+	// be treated as an OBJECT image. 
+	psMetadataAddStr(options, PS_LIST_TAIL, "IMAGE.TYPE", 0, "Exposure type", "OBJECT");
+
+	// check for these options as well
+        ppSimArgToRecipeStr(&status, options, "PSF.MODEL",    arguments, "-psfclass"); // PSF model class
+        ppSimArgToRecipeStr(&status, options, "GALAXY.MODEL", arguments, "-galmodel"); // Galaxy model name
+
+	// 'seeing' is not required: we can load a psf-model instead; but if not, it is allowed
+        ppSimArgToRecipeF32(&status, options, "SEEING", arguments, "-seeing"); // seeing (FWHM in arcsec)
+
+	// 'scale' is not required: we can use the WCS instead; but if not, it is allowed
+        ppSimArgToRecipeF32(&status, options, "PIXEL.SCALE", arguments, "-scale"); // Plate scale
+
+	// XXX we need to be more flexible: get this from the input image header or WCS
+        float ra0     = psMetadataLookupF32(NULL, arguments, "-ra"); // Right Ascension of boresight
+        float dec0    = psMetadataLookupF32(NULL, arguments, "-dec"); // Declination of boresight
+        psMetadataAddF32(options, PS_LIST_TAIL, "RA", 0, "Boresight RA (radians)", ra0 * M_PI / 180.0);
+        psMetadataAddF32(options, PS_LIST_TAIL, "DEC", 0, "Boresight Declination (radians)", dec0 * M_PI / 180.0);
+
+	psFree (arguments);
+	return true;
     }
 
@@ -96,95 +143,48 @@
         psMetadata *formats = psMetadataLookupMetadata(NULL, config->camera, "FORMATS"); // The camera formats
         if (!formats) {
-            psErrorStackPrint(stderr, "Unable to find FORMATS in camera configuration.");
+	    psError(PS_ERR_IO, false, "Unable to find FORMATS in camera configuration.");
             psFree(arguments);
-            psFree(config);
-            exit(PS_EXIT_CONFIG_ERROR);
+	    return false;
         }
         psMetadata *format = psMetadataLookupMetadata(NULL, formats, formatName); // Format of interest
         if (!format) {
-            psErrorStackPrint(stderr, "Unable to find format %s in camera FORMATS.", formatName);
+	    psError(PS_ERR_IO, false, "Unable to find format %s in camera FORMATS.", formatName);
             psFree(arguments);
-            psFree(config);
-            exit(PS_EXIT_CONFIG_ERROR);
+	    return false;
         }
         config->format = psMemIncrRefCounter(format);
     }
 
-    // specify the type of simulated image to produce
-    // XXX this should not be required if we supplied INPUT
-    const char *typeStr = psMetadataLookupStr(NULL, arguments, "-type"); // Exposure type
-    if (!typeStr) {
-        psErrorStackPrint(stderr, "An exposure type must be specified using -type");
-	exit(PS_EXIT_CONFIG_ERROR);
-    }
-    ppSimType type = PPSIM_TYPE_NONE;   // Type to simulate
-    if (strcasecmp(typeStr, "BIAS") == 0) {
-        type = PPSIM_TYPE_BIAS;
-    } else if (strcasecmp(typeStr, "DARK") == 0) {
-        type = PPSIM_TYPE_DARK;
-    } else if (strcasecmp(typeStr, "FLAT") == 0) {
-        type = PPSIM_TYPE_FLAT;
-    } else if (strcasecmp(typeStr, "OBJECT") == 0) {
-        type = PPSIM_TYPE_OBJECT;
+    char *typeStr = ppSimArgToRecipeStr (&status, options, "IMAGE.TYPE", arguments, "-type"); // Requested exposure type
+    if (typeStr == NULL) {
+	psError(PS_ERR_IO, false, "An exposure type must be specified using -type");
+        psFree(arguments);
+	return false;
+    }
+    ppSimType type = ppSimTypeFromString (typeStr);
+
+    ppSimArgToRecipeStr(&status, options, "FILTER", arguments, "-filter"); // Filter name
+
+    // set the exposure time 
+    if (type == PPSIM_TYPE_BIAS) {
+	psMetadataAddF32(options, PS_LIST_TAIL, "EXPTIME", 0, "Exposure time (s)", 0.0);
     } else {
-        psErrorStackPrint(stderr, "Unrecognised exposure type: %s", typeStr);
-	exit(PS_EXIT_CONFIG_ERROR);
-    }
-    assert(type != PPSIM_TYPE_NONE);
-    psMetadataAddS32(config->arguments, PS_LIST_TAIL, "TYPE", 0, "Exposure type", type);
-
-    const char *filter = psMetadataLookupStr(NULL, arguments, "-filter"); // Filter name
-    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "FILTER", 0, "Filter name", filter);
-
-    // save the following additional recipe values based on command-line options
-    // these options override the PPSIM recipe values loaded from recipe files
-    psMetadata *options = pmConfigRecipeOptions (config, PPSIM_RECIPE);
-    if (!options) {
-        psErrorStackPrint(stderr, "Unable to find recipe options for %s", PPSIM_RECIPE);
-        psFree(arguments);
-        psFree(config);
-        exit(PS_EXIT_CONFIG_ERROR);
-    }
-
-    float expTime;
-    if (type == PPSIM_TYPE_BIAS) {
-        expTime = 0.0;
-    } else {
-        expTime = psMetadataLookupF32(NULL, arguments, "-exptime"); // Exposure time
-        if (isnan(expTime)) {
-            psErrorStackPrint(stderr, "The exposure time must be specified using -exptime");
-	    exit(PS_EXIT_CONFIG_ERROR);
-        }
-    }
-    psMetadataAddF32(options, PS_LIST_TAIL, "EXPTIME", 0, "Exposure time (s)", expTime);
+	ppSimArgToRecipeF32(&status, options, "EXPTIME", arguments, "-exptime");
+	if (!status) {
+	    psError(PS_ERR_IO, false, "The exposure time must be specified using -exptime");
+	    psFree(arguments);
+	    return false;
+        }
+    }
 
     // these values all get moved from arguments to RECIPE:OPTIONS
-    valueArgRecipe(options, "BIAS.LEVEL",    arguments, "-biaslevel");
-    valueArgRecipe(options, "BIAS.RANGE",    arguments, "-biasrange");
-    valueArgRecipe(options, "DARK.RATE",     arguments, "-darkrate");
-    valueArgRecipe(options, "FLAT.SIGMA",    arguments, "-flatsigma");
-    valueArgRecipe(options, "FLAT.RATE",     arguments, "-flatrate");
-    valueArgRecipe(options, "SHUTTER.TIME",  arguments, "-shuttertime");
-    valueArgRecipe(options, "SKY.RATE",      arguments, "-skyrate");
-    valueArgRecipe(options, "STARS.LUM",     arguments, "-starslum");
-    valueArgRecipe(options, "STARS.MAG",     arguments, "-starsmag");
-    valueArgRecipe(options, "STARS.DENSITY", arguments, "-starsdensity");
-
-    psMetadata *recipe = psMetadataLookupMetadata(&mdok, config->recipes, PPSIM_RECIPE); // Recipe
-
-    int biasOrder = psMetadataLookupS32(&mdok, recipe, "BIAS.ORDER"); // Overscan polynomial order
-    if (!mdok) {
-        psWarning("BIAS.ORDER(S32) is not set in the recipe %s --- assuming %d", PPSIM_RECIPE, biasOrder);
-    }
-    psMetadataAddS32(options, PS_LIST_TAIL, "BIAS.ORDER", 0, "Overscan polynomial order", biasOrder);
-
-    int binning = psMetadataLookupS32(NULL, arguments, "-bin"); // Binning in x and y
-    if (binning <= 0) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Binning (%d) is non-positive.", binning);
-	exit(PS_EXIT_CONFIG_ERROR);
-    }
-    psMetadataAddS32(config->arguments, PS_LIST_TAIL, "BINNING", 0, "Binning in x and y", binning);
-
-    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[1]);
+    ppSimArgToRecipeF32(&status,  options, "BIAS.LEVEL",    arguments, "-biaslevel");
+    ppSimArgToRecipeF32(&status,  options, "BIAS.RANGE",    arguments, "-biasrange");
+    ppSimArgToRecipeF32(&status,  options, "DARK.RATE",     arguments, "-darkrate");
+    ppSimArgToRecipeF32(&status,  options, "FLAT.SIGMA",    arguments, "-flatsigma");
+    ppSimArgToRecipeF32(&status,  options, "FLAT.RATE",     arguments, "-flatrate");
+    ppSimArgToRecipeF32(&status,  options, "SHUTTER.TIME",  arguments, "-shuttertime");
+    ppSimArgToRecipeF32(&status,  options, "SKY.RATE",      arguments, "-skyrate");
+    ppSimArgToRecipeS32(&status,  options, "BINNING",       arguments, "-bin");
 
     if (type == PPSIM_TYPE_OBJECT) {
@@ -197,63 +197,25 @@
 	// XXX scale and zp should be supplied by the config file (allow override, but this is camera-dependent)
         if (isnan(ra0) || isnan(dec0) || isnan(pa) || isnan(seeing)) {
-            psErrorStackPrint(stderr, "-ra, -dec, -pa, -scale, -zp, -seeing must be specified for OBJECT type");
-	    exit(PS_EXIT_CONFIG_ERROR);
-        }
-
-        float zp = psMetadataLookupF32(NULL, arguments, "-zp"); // Zero point
-	if (isnan(zp)) {
-	    // use the filter to get the zeropoint from the recipe
-	    psMetadataItem *zpItem = psMetadataLookup (recipe, "ZEROPTS");
-	    // check that item is multi...
-	    
-	    psArray *entries = psListToArray (zpItem->data.list);
-	  
-	    // search for matching filter
-	    for (int i = 0; i < entries->n; i++) {
-		psMetadataItem *item = entries->data[i];
-		psMetadata *entry = item->data.V;
-
-		char *filterName = psMetadataLookupStr (&status, entry, "FILTER");
-		assert (filterName);
-
-		if (strcmp(filterName, filter)) continue;
-
-		zp = psMetadataLookupF32 (&status, entry, "ZERO_PT");
-		assert (status);
-		break;
-            }
-	    psFree (entries);
-	}
-
-        float scale   = psMetadataLookupF32(NULL, arguments, "-scale"); // Plate scale
-	if (isnan(scale)) {
-	    scale = psMetadataLookupF32 (&status, recipe, "PIXEL.SCALE");
-	}
-
-        float skymags = psMetadataLookupF32(NULL, arguments, "-skymags"); // Position angle
-	if (isnan(skymags)) {
-	    skymags = psMetadataLookupF32 (&status, recipe, "SKY.MAGS");
-	}
-
+	    psError(PS_ERR_IO, false, "-ra, -dec, -pa, -scale, -zp, -seeing must be specified for OBJECT type");
+	    psFree(arguments);
+	    return false;
+        }
+
+        ppSimArgToRecipeF32(&status, options, "PIXEL.SCALE", arguments, "-scale"); // Plate scale (arcsec / pixel)
+        ppSimArgToRecipeF32(&status, options, "SKY.MAGS", arguments, "-skymags"); // Plate scale
+        ppSimArgToRecipeStr(&status, options, "PSF.MODEL",    arguments, "-psfclass"); // PSF model class
+        ppSimArgToRecipeStr(&status, options, "GALAXY.MODEL", arguments, "-galmodel"); // Galaxy model name
+
+	// the user supplies FWHM in arcsec; here we convert to Sigma in pixels
+        psMetadataAddF32(options, PS_LIST_TAIL, "SEEING", 0, "Seeing FWHM (arcsec)", seeing);
         psMetadataAddF32(options, PS_LIST_TAIL, "RA", 0, "Boresight RA (radians)", ra0 * M_PI / 180.0);
         psMetadataAddF32(options, PS_LIST_TAIL, "DEC", 0, "Boresight Declination (radians)", dec0 * M_PI / 180.0);
         psMetadataAddF32(options, PS_LIST_TAIL, "PA", 0, "Boresight position angle (radians)",pa * M_PI / 180.0);
 
-	// the user supplies FWHM in arcsec; here we convert to Sigma in pixels
-        psMetadataAddF32(options, PS_LIST_TAIL, "SEEING", 0, "Seeing SIGMA (pixels)", seeing / 2.0 / sqrt(2.0 * log(2.0)) / scale);
-
-        psMetadataAddF32(options, PS_LIST_TAIL, "SCALE", 0, "Plate scale (arcsec/pix)", scale);
-        psMetadataAddF32(options, PS_LIST_TAIL, "ZEROPOINT", 0, "Photometric zeropoint", zp);
-        psMetadataAddF32(options, PS_LIST_TAIL, "SKY.MAGS", 0, "sky surface brightness", skymags);
-
-        const char *psfClass = psMetadataLookupStr(NULL, arguments, "-psfclass"); // PSF model class
-        psMetadataAddStr(config->arguments, PS_LIST_TAIL, "PSF.MODEL", 0, "PSF model class", psfClass);
-
-        const char *galModel = psMetadataLookupStr(NULL, arguments, "-galmodel"); // Galaxy model name
-        psMetadataAddStr(config->arguments, PS_LIST_TAIL, "GALAXY.MODEL", 0, "Galaxy model", galModel);
+        ppSimArgToRecipeF32(&status, options, "ZEROPOINT", arguments, "-zp"); // Zero point
     }
 
     psFree(arguments);
-    return;
+    return true;
 }
 
@@ -262,12 +224,6 @@
    PSPHOT.PSF
    INPUT
-   TYPE
-   FILTER
-   BIAS.ORDER
-   BINNING
    OUTPUT
-   PSF.MODEL
-   GALAXY.MODEL
-
-   all othr values should come from the recipe
+
+   all other values should come from the recipe
 */
