IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 8, 2008, 4:03:31 PM (18 years ago)
Author:
eugene
Message:

update from changes on eam_branch_20080511 : adding photometry of fake sources, force photometry; major cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSim/src/ppSimArguments.c

    r17557 r18011  
    1 #include "ppSim.h"
     1# include "ppSim.h"
    22
    33// Print usage information and die
     
    1818}
    1919
    20 // Get a value from the command-line arguments and add it to recipe options
    21 bool valueArgRecipe(psMetadata *options,    // Target to which to add value
    22                     const char *recipeName, // Name for value in the recipe
    23                     psMetadata *arguments,  // Command-line arguments
    24                     const char *argName     // Argument name in the command-line arguments
    25     )
     20// this function supplements the RECIPE:OPTIONS folder with command-line options
     21bool ppSimArguments(int argc, char **argv, pmConfig *config)
    2622{
    27     bool status;                                                    // Status of MD lookup
    28     float value = psMetadataLookupF32(&status, arguments, argName); // Value of interest
    29     if (isnan(value)) return true;
    30     status = psMetadataAddF32(options, PS_LIST_TAIL, recipeName, 0, NULL, value);
    31     return status;
    32 }
    33 
    34 // this function supplements the RECIPE:OPTIONS folder with command-line options
    35 void ppSimArguments(int argc, char *argv[], pmConfig *config)
    36 {
    37     bool mdok;                          // Status of MD lookup
     23    bool status;
    3824
    3925    assert(config);
    4026
    41     // save the following command-line options in the arguments structure
     27    // save the following command-line options in the arguments structure.  these will later be
     28    // parsed and moved to the config->recipes:PPSIM_RECIPE folder
     29
    4230    psMetadata *arguments = psMetadataAlloc(); // Command-line arguments
    43     psMetadataAddStr(arguments, PS_LIST_TAIL, "-format", 0, "Camera format name", NULL);
    44     psMetadataAddStr(arguments, PS_LIST_TAIL, "-type", 0, "Exposure type (BIAS|DARK|FLAT|OBJECT)", NULL);
    45     psMetadataAddStr(arguments, PS_LIST_TAIL, "-filter", 0, "Filter name", NULL);
    46     psMetadataAddF32(arguments, PS_LIST_TAIL, "-exptime", 0, "Exposure time (s)", NAN);
    47     psMetadataAddF32(arguments, PS_LIST_TAIL, "-biaslevel", 0, "Bias level (e)", NAN);
    48     psMetadataAddF32(arguments, PS_LIST_TAIL, "-biasrange", 0, "Bias range (e)", NAN);
    49     psMetadataAddF32(arguments, PS_LIST_TAIL, "-darkrate", 0, "Dark rate (e/s)", NAN);
    50     psMetadataAddF32(arguments, PS_LIST_TAIL, "-flatsigma", 0, "Flat sigma", NAN);
    51     psMetadataAddF32(arguments, PS_LIST_TAIL, "-flatrate", 0, "Flat rate (e/s)", NAN);
    52     psMetadataAddF32(arguments, PS_LIST_TAIL, "-shuttertime", 0, "Shutter time (s)", NAN);
    53     psMetadataAddF32(arguments, PS_LIST_TAIL, "-skyrate", 0, "Sky rate (e/s)", NAN);
    54     psMetadataAddF32(arguments, PS_LIST_TAIL, "-skymags", 0, "Sky brightness in mags / square arcsec", NAN);
    55     psMetadataAddF32(arguments, PS_LIST_TAIL, "-ra", 0, "RA (degrees)", NAN);
    56     psMetadataAddF32(arguments, PS_LIST_TAIL, "-dec", 0, "Dec (degrees)", NAN);
    57     psMetadataAddF32(arguments, PS_LIST_TAIL, "-pa", 0, "Position angle (degrees)", NAN);
    58     psMetadataAddF32(arguments, PS_LIST_TAIL, "-scale", 0, "Plate scale (arcsec/pixel)", NAN);
    59     psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp", 0, "Photometric zero point", NAN);
    60     psMetadataAddF32(arguments, PS_LIST_TAIL, "-seeing", 0, "Seeing FWHM (arcsec)", NAN);
    61     psMetadataAddF32(arguments, PS_LIST_TAIL, "-starslum", 0, "Fake star luminosity function slope", NAN);
    62     psMetadataAddF32(arguments, PS_LIST_TAIL, "-starsmag", 0, "Brightest magnitude for fake stars", NAN);
    63     psMetadataAddF32(arguments, PS_LIST_TAIL, "-starsdensity", 0, "Density of fake stars at magnitude", NAN);
    64     psMetadataAddStr(arguments, PS_LIST_TAIL, "-psfclass", 0, "Type of PSF model", NULL);
    65     psMetadataAddStr(arguments, PS_LIST_TAIL, "-galmodel", 0, "Type of Galaxy model", NULL);
    66     psMetadataAddS32(arguments, PS_LIST_TAIL, "-bin", 0, "Binning in x and y", 1);
     31    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-format", 0, "Camera format name", NULL);
     32    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-type", 0, "Exposure type (BIAS|DARK|FLAT|OBJECT)", NULL);
     33    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-filter", 0, "Filter name", NULL);
     34    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-exptime", 0, "Exposure time (s)", NAN);
     35    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-biaslevel", 0, "Bias level (e)", NAN);
     36    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-biasrange", 0, "Bias range (e)", NAN);
     37    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-darkrate", 0, "Dark rate (e/s)", NAN);
     38    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-flatsigma", 0, "Flat sigma", NAN);
     39    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-flatrate", 0, "Flat rate (e/s)", NAN);
     40    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-shuttertime", 0, "Shutter time (s)", NAN);
     41    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-skyrate", 0, "Sky rate (e/s)", NAN);
     42    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-skymags", 0, "Sky brightness in mags / square arcsec", NAN);
     43    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-ra", 0, "RA (degrees)", NAN);
     44    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-dec", 0, "Dec (degrees)", NAN);
     45    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-pa", 0, "Position angle (degrees)", NAN);
     46    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-scale", 0, "Plate scale (arcsec/pixel)", NAN);
     47    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-zp", 0, "Photometric zero point", NAN);
     48    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-seeing", 0, "Seeing FWHM (arcsec)", NAN);
     49    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-starslum", 0, "Fake star luminosity function slope", NAN);
     50    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-starsmag", 0, "Brightest magnitude for fake stars", NAN);
     51    psMetadataAddF32(arguments,  PS_LIST_TAIL, "-starsdensity", 0, "Density of fake stars at magnitude", NAN);
     52    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-psfclass", 0, "Type of PSF model", NULL);
     53    psMetadataAddStr(arguments,  PS_LIST_TAIL, "-galmodel", 0, "Type of Galaxy model", NULL);
     54    psMetadataAddS32(arguments,  PS_LIST_TAIL, "-bin", 0, "Binning in x and y", 1);
     55    psMetadataAddBool(arguments, PS_LIST_TAIL, "+photom", 0, "Perform photometry on fake sources", false);
    6756
    6857    if (psArgumentGet (argc, argv, "-h")) { usage(argv[0], arguments, config); }
     
    7160
    7261    pmConfigFileSetsMD (config->arguments, &argc, argv, "PSPHOT.PSF", "-psf", "-psflist");
    73 
    74     // only one of -camera and -file is needed
    75     bool status = pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT", "-file", "-list");
    76     if (!config->camera && !status) {
    77         psErrorStackPrint(stderr, "A camera name (-camera NAME) or an image (-file NAME) must be specified");
    78         exit(PS_EXIT_CONFIG_ERROR);
     62    if (psErrorCodeLast () != PS_ERR_NONE) { psAbort ("problem with -psf or -psflist option"); }
     63
     64    pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT.SOURCES", "-cmf", "-cmflist");
     65    if (psErrorCodeLast () != PS_ERR_NONE) { psAbort ("problem with -cmf or -cmflist option"); }
     66
     67    // Only one of -camera and -file is needed or allowed.  The -camera option would have been
     68    // already parsed by pmConfigRead in ppSim.c and resulted in a value for config->camera
     69    bool loadImage = pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT", "-input", "-inputlist");
     70    if (!config->camera && !loadImage) {
     71        psError(PS_ERR_IO, true, "A camera name (-camera NAME) or an input image (-input NAME) must be specified");
     72        psFree(arguments);
     73        return false;
     74    }
     75    if (config->camera && loadImage) {
     76        psError(PS_ERR_IO, true, "Only one of (-camera NAME) and (-file NAME) may be specified");
     77        psFree(arguments);
     78        return false;
    7979    }
    8080
    8181    if (!psArgumentParse(arguments, &argc, argv)) {
    82         exit(PS_EXIT_CONFIG_ERROR);
     82        psError(PS_ERR_IO, false, "error in command-line arguments");
     83        psFree(arguments);
     84        return false;
    8385    }
    8486
    8587    if (argc != 2) {
    86         psErrorStackPrint(stderr, "Missing output filename");
    87         exit(PS_EXIT_CONFIG_ERROR);
     88        psError(PS_ERR_IO, true, "Missing output filename");
     89        psFree(arguments);
     90        return false;
     91    }
     92
     93    // output filename
     94    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[1]);
     95
     96    // save the additional recipe values based on command-line options. These options override
     97    // the PPSIM recipe values loaded from recipe files
     98    psMetadata *options = pmConfigRecipeOptions (config, PPSIM_RECIPE);
     99    if (!options) {
     100        psError(PS_ERR_IO, false, "Unable to find recipe options for %s", PPSIM_RECIPE);
     101        psFree(arguments);
     102        return false;
     103    }
     104
     105    // these arguments may be used whether the input image is created or loaded
     106    ppSimArgToRecipeF32(&status, options, "STARS.LUM",     arguments, "-starslum");
     107    ppSimArgToRecipeF32(&status, options, "STARS.MAG",     arguments, "-starsmag");
     108    ppSimArgToRecipeF32(&status, options, "STARS.DENSITY", arguments, "-starsdensity");
     109    ppSimArgToRecipeBool(&status, options, "PHOTOM",        arguments, "+photom");
     110
     111    // if we are loading the input image (not creating it), then we can skip the remaining arguments
     112    if (loadImage) {
     113        // if we are supplying an input image, it is so we may supply fake stars; force it to
     114        // be treated as an OBJECT image.
     115        psMetadataAddStr(options, PS_LIST_TAIL, "IMAGE.TYPE", 0, "Exposure type", "OBJECT");
     116
     117        // check for these options as well
     118        ppSimArgToRecipeStr(&status, options, "PSF.MODEL",    arguments, "-psfclass"); // PSF model class
     119        ppSimArgToRecipeStr(&status, options, "GALAXY.MODEL", arguments, "-galmodel"); // Galaxy model name
     120
     121        // 'seeing' is not required: we can load a psf-model instead; but if not, it is allowed
     122        ppSimArgToRecipeF32(&status, options, "SEEING", arguments, "-seeing"); // seeing (FWHM in arcsec)
     123
     124        // 'scale' is not required: we can use the WCS instead; but if not, it is allowed
     125        ppSimArgToRecipeF32(&status, options, "PIXEL.SCALE", arguments, "-scale"); // Plate scale
     126
     127        // XXX we need to be more flexible: get this from the input image header or WCS
     128        float ra0     = psMetadataLookupF32(NULL, arguments, "-ra"); // Right Ascension of boresight
     129        float dec0    = psMetadataLookupF32(NULL, arguments, "-dec"); // Declination of boresight
     130        psMetadataAddF32(options, PS_LIST_TAIL, "RA", 0, "Boresight RA (radians)", ra0 * M_PI / 180.0);
     131        psMetadataAddF32(options, PS_LIST_TAIL, "DEC", 0, "Boresight Declination (radians)", dec0 * M_PI / 180.0);
     132
     133        psFree (arguments);
     134        return true;
    88135    }
    89136
     
    96143        psMetadata *formats = psMetadataLookupMetadata(NULL, config->camera, "FORMATS"); // The camera formats
    97144        if (!formats) {
    98             psErrorStackPrint(stderr, "Unable to find FORMATS in camera configuration.");
     145            psError(PS_ERR_IO, false, "Unable to find FORMATS in camera configuration.");
    99146            psFree(arguments);
    100             psFree(config);
    101             exit(PS_EXIT_CONFIG_ERROR);
     147            return false;
    102148        }
    103149        psMetadata *format = psMetadataLookupMetadata(NULL, formats, formatName); // Format of interest
    104150        if (!format) {
    105             psErrorStackPrint(stderr, "Unable to find format %s in camera FORMATS.", formatName);
     151            psError(PS_ERR_IO, false, "Unable to find format %s in camera FORMATS.", formatName);
    106152            psFree(arguments);
    107             psFree(config);
    108             exit(PS_EXIT_CONFIG_ERROR);
     153            return false;
    109154        }
    110155        config->format = psMemIncrRefCounter(format);
    111156    }
    112157
    113     // specify the type of simulated image to produce
    114     // XXX this should not be required if we supplied INPUT
    115     const char *typeStr = psMetadataLookupStr(NULL, arguments, "-type"); // Exposure type
    116     if (!typeStr) {
    117         psErrorStackPrint(stderr, "An exposure type must be specified using -type");
    118         exit(PS_EXIT_CONFIG_ERROR);
    119     }
    120     ppSimType type = PPSIM_TYPE_NONE;   // Type to simulate
    121     if (strcasecmp(typeStr, "BIAS") == 0) {
    122         type = PPSIM_TYPE_BIAS;
    123     } else if (strcasecmp(typeStr, "DARK") == 0) {
    124         type = PPSIM_TYPE_DARK;
    125     } else if (strcasecmp(typeStr, "FLAT") == 0) {
    126         type = PPSIM_TYPE_FLAT;
    127     } else if (strcasecmp(typeStr, "OBJECT") == 0) {
    128         type = PPSIM_TYPE_OBJECT;
     158    char *typeStr = ppSimArgToRecipeStr (&status, options, "IMAGE.TYPE", arguments, "-type"); // Requested exposure type
     159    if (typeStr == NULL) {
     160        psError(PS_ERR_IO, false, "An exposure type must be specified using -type");
     161        psFree(arguments);
     162        return false;
     163    }
     164    ppSimType type = ppSimTypeFromString (typeStr);
     165
     166    ppSimArgToRecipeStr(&status, options, "FILTER", arguments, "-filter"); // Filter name
     167
     168    // set the exposure time
     169    if (type == PPSIM_TYPE_BIAS) {
     170        psMetadataAddF32(options, PS_LIST_TAIL, "EXPTIME", 0, "Exposure time (s)", 0.0);
    129171    } else {
    130         psErrorStackPrint(stderr, "Unrecognised exposure type: %s", typeStr);
    131         exit(PS_EXIT_CONFIG_ERROR);
    132     }
    133     assert(type != PPSIM_TYPE_NONE);
    134     psMetadataAddS32(config->arguments, PS_LIST_TAIL, "TYPE", 0, "Exposure type", type);
    135 
    136     const char *filter = psMetadataLookupStr(NULL, arguments, "-filter"); // Filter name
    137     psMetadataAddStr(config->arguments, PS_LIST_TAIL, "FILTER", 0, "Filter name", filter);
    138 
    139     // save the following additional recipe values based on command-line options
    140     // these options override the PPSIM recipe values loaded from recipe files
    141     psMetadata *options = pmConfigRecipeOptions (config, PPSIM_RECIPE);
    142     if (!options) {
    143         psErrorStackPrint(stderr, "Unable to find recipe options for %s", PPSIM_RECIPE);
    144         psFree(arguments);
    145         psFree(config);
    146         exit(PS_EXIT_CONFIG_ERROR);
    147     }
    148 
    149     float expTime;
    150     if (type == PPSIM_TYPE_BIAS) {
    151         expTime = 0.0;
    152     } else {
    153         expTime = psMetadataLookupF32(NULL, arguments, "-exptime"); // Exposure time
    154         if (isnan(expTime)) {
    155             psErrorStackPrint(stderr, "The exposure time must be specified using -exptime");
    156             exit(PS_EXIT_CONFIG_ERROR);
    157         }
    158     }
    159     psMetadataAddF32(options, PS_LIST_TAIL, "EXPTIME", 0, "Exposure time (s)", expTime);
     172        ppSimArgToRecipeF32(&status, options, "EXPTIME", arguments, "-exptime");
     173        if (!status) {
     174            psError(PS_ERR_IO, false, "The exposure time must be specified using -exptime");
     175            psFree(arguments);
     176            return false;
     177        }
     178    }
    160179
    161180    // these values all get moved from arguments to RECIPE:OPTIONS
    162     valueArgRecipe(options, "BIAS.LEVEL",    arguments, "-biaslevel");
    163     valueArgRecipe(options, "BIAS.RANGE",    arguments, "-biasrange");
    164     valueArgRecipe(options, "DARK.RATE",     arguments, "-darkrate");
    165     valueArgRecipe(options, "FLAT.SIGMA",    arguments, "-flatsigma");
    166     valueArgRecipe(options, "FLAT.RATE",     arguments, "-flatrate");
    167     valueArgRecipe(options, "SHUTTER.TIME",  arguments, "-shuttertime");
    168     valueArgRecipe(options, "SKY.RATE",      arguments, "-skyrate");
    169     valueArgRecipe(options, "STARS.LUM",     arguments, "-starslum");
    170     valueArgRecipe(options, "STARS.MAG",     arguments, "-starsmag");
    171     valueArgRecipe(options, "STARS.DENSITY", arguments, "-starsdensity");
    172 
    173     psMetadata *recipe = psMetadataLookupMetadata(&mdok, config->recipes, PPSIM_RECIPE); // Recipe
    174 
    175     int biasOrder = psMetadataLookupS32(&mdok, recipe, "BIAS.ORDER"); // Overscan polynomial order
    176     if (!mdok) {
    177         psWarning("BIAS.ORDER(S32) is not set in the recipe %s --- assuming %d", PPSIM_RECIPE, biasOrder);
    178     }
    179     psMetadataAddS32(options, PS_LIST_TAIL, "BIAS.ORDER", 0, "Overscan polynomial order", biasOrder);
    180 
    181     int binning = psMetadataLookupS32(NULL, arguments, "-bin"); // Binning in x and y
    182     if (binning <= 0) {
    183         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Binning (%d) is non-positive.", binning);
    184         exit(PS_EXIT_CONFIG_ERROR);
    185     }
    186     psMetadataAddS32(config->arguments, PS_LIST_TAIL, "BINNING", 0, "Binning in x and y", binning);
    187 
    188     psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[1]);
     181    ppSimArgToRecipeF32(&status,  options, "BIAS.LEVEL",    arguments, "-biaslevel");
     182    ppSimArgToRecipeF32(&status,  options, "BIAS.RANGE",    arguments, "-biasrange");
     183    ppSimArgToRecipeF32(&status,  options, "DARK.RATE",     arguments, "-darkrate");
     184    ppSimArgToRecipeF32(&status,  options, "FLAT.SIGMA",    arguments, "-flatsigma");
     185    ppSimArgToRecipeF32(&status,  options, "FLAT.RATE",     arguments, "-flatrate");
     186    ppSimArgToRecipeF32(&status,  options, "SHUTTER.TIME",  arguments, "-shuttertime");
     187    ppSimArgToRecipeF32(&status,  options, "SKY.RATE",      arguments, "-skyrate");
     188    ppSimArgToRecipeS32(&status,  options, "BINNING",       arguments, "-bin");
    189189
    190190    if (type == PPSIM_TYPE_OBJECT) {
     
    197197        // XXX scale and zp should be supplied by the config file (allow override, but this is camera-dependent)
    198198        if (isnan(ra0) || isnan(dec0) || isnan(pa) || isnan(seeing)) {
    199             psErrorStackPrint(stderr, "-ra, -dec, -pa, -scale, -zp, -seeing must be specified for OBJECT type");
    200             exit(PS_EXIT_CONFIG_ERROR);
    201         }
    202 
    203         float zp = psMetadataLookupF32(NULL, arguments, "-zp"); // Zero point
    204         if (isnan(zp)) {
    205             // use the filter to get the zeropoint from the recipe
    206             psMetadataItem *zpItem = psMetadataLookup (recipe, "ZEROPTS");
    207             // check that item is multi...
    208            
    209             psArray *entries = psListToArray (zpItem->data.list);
    210          
    211             // search for matching filter
    212             for (int i = 0; i < entries->n; i++) {
    213                 psMetadataItem *item = entries->data[i];
    214                 psMetadata *entry = item->data.V;
    215 
    216                 char *filterName = psMetadataLookupStr (&status, entry, "FILTER");
    217                 assert (filterName);
    218 
    219                 if (strcmp(filterName, filter)) continue;
    220 
    221                 zp = psMetadataLookupF32 (&status, entry, "ZERO_PT");
    222                 assert (status);
    223                 break;
    224             }
    225             psFree (entries);
    226         }
    227 
    228         float scale   = psMetadataLookupF32(NULL, arguments, "-scale"); // Plate scale
    229         if (isnan(scale)) {
    230             scale = psMetadataLookupF32 (&status, recipe, "PIXEL.SCALE");
    231         }
    232 
    233         float skymags = psMetadataLookupF32(NULL, arguments, "-skymags"); // Position angle
    234         if (isnan(skymags)) {
    235             skymags = psMetadataLookupF32 (&status, recipe, "SKY.MAGS");
    236         }
    237 
     199            psError(PS_ERR_IO, false, "-ra, -dec, -pa, -scale, -zp, -seeing must be specified for OBJECT type");
     200            psFree(arguments);
     201            return false;
     202        }
     203
     204        ppSimArgToRecipeF32(&status, options, "PIXEL.SCALE", arguments, "-scale"); // Plate scale (arcsec / pixel)
     205        ppSimArgToRecipeF32(&status, options, "SKY.MAGS", arguments, "-skymags"); // Plate scale
     206        ppSimArgToRecipeStr(&status, options, "PSF.MODEL",    arguments, "-psfclass"); // PSF model class
     207        ppSimArgToRecipeStr(&status, options, "GALAXY.MODEL", arguments, "-galmodel"); // Galaxy model name
     208
     209        // the user supplies FWHM in arcsec; here we convert to Sigma in pixels
     210        psMetadataAddF32(options, PS_LIST_TAIL, "SEEING", 0, "Seeing FWHM (arcsec)", seeing);
    238211        psMetadataAddF32(options, PS_LIST_TAIL, "RA", 0, "Boresight RA (radians)", ra0 * M_PI / 180.0);
    239212        psMetadataAddF32(options, PS_LIST_TAIL, "DEC", 0, "Boresight Declination (radians)", dec0 * M_PI / 180.0);
    240213        psMetadataAddF32(options, PS_LIST_TAIL, "PA", 0, "Boresight position angle (radians)",pa * M_PI / 180.0);
    241214
    242         // the user supplies FWHM in arcsec; here we convert to Sigma in pixels
    243         psMetadataAddF32(options, PS_LIST_TAIL, "SEEING", 0, "Seeing SIGMA (pixels)", seeing / 2.0 / sqrt(2.0 * log(2.0)) / scale);
    244 
    245         psMetadataAddF32(options, PS_LIST_TAIL, "SCALE", 0, "Plate scale (arcsec/pix)", scale);
    246         psMetadataAddF32(options, PS_LIST_TAIL, "ZEROPOINT", 0, "Photometric zeropoint", zp);
    247         psMetadataAddF32(options, PS_LIST_TAIL, "SKY.MAGS", 0, "sky surface brightness", skymags);
    248 
    249         const char *psfClass = psMetadataLookupStr(NULL, arguments, "-psfclass"); // PSF model class
    250         psMetadataAddStr(config->arguments, PS_LIST_TAIL, "PSF.MODEL", 0, "PSF model class", psfClass);
    251 
    252         const char *galModel = psMetadataLookupStr(NULL, arguments, "-galmodel"); // Galaxy model name
    253         psMetadataAddStr(config->arguments, PS_LIST_TAIL, "GALAXY.MODEL", 0, "Galaxy model", galModel);
     215        ppSimArgToRecipeF32(&status, options, "ZEROPOINT", arguments, "-zp"); // Zero point
    254216    }
    255217
    256218    psFree(arguments);
    257     return;
     219    return true;
    258220}
    259221
     
    262224   PSPHOT.PSF
    263225   INPUT
    264    TYPE
    265    FILTER
    266    BIAS.ORDER
    267    BINNING
    268226   OUTPUT
    269    PSF.MODEL
    270    GALAXY.MODEL
    271 
    272    all othr values should come from the recipe
     227
     228   all other values should come from the recipe
    273229*/
Note: See TracChangeset for help on using the changeset viewer.