IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10437


Ignore:
Timestamp:
Dec 4, 2006, 11:45:37 AM (19 years ago)
Author:
eugene
Message:

updated to new pmConfigRead, added PSPHOT_RECIPE, new option lookup

Location:
trunk/psphot/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphot.h

    r10425 r10437  
    1010
    1111# include "psphotErrorCodes.h"
     12#define PSPHOT_RECIPE "PSPHOT" // Name of the recipe to use
    1213
    1314// top-level psphot functions
  • trunk/psphot/src/psphotArguments.c

    r10427 r10437  
    1313
    1414    // load config data from default locations
    15     pmConfig *config = pmConfigRead(&argc, argv, "PSPHOT");
     15    pmConfig *config = pmConfigRead(&argc, argv, PSPHOT_RECIPE);
    1616    if (config == NULL) {
    1717        psError(PSPHOT_ERR_CONFIG, false, "Can't read site configuration");
     
    2121    // save the following additional recipe values based on command-line options
    2222    // these options override the PSPHOT recipe values loaded from recipe files
    23 
    24     // if the recipe is already defined in config->arguments, supplement
    25     // save the recipe options onto config->arguments:RECIPES
    26     psMetadata *recipes = psMetadataLookupMetadata(NULL, config->arguments, "RECIPES");
    27     if (!recipes) {
    28         recipes = psMetadataAlloc ();
    29         psMetadataAddPtr (config->arguments, PS_LIST_TAIL, "RECIPES",  PS_DATA_METADATA, "", recipes);
    30     } else {
    31         psMemIncrRefCounter (recipes); // so we can free options below if not allocated here
    32     }
    33     // look for the recipe defined in recipes
    34     psMetadata *options = psMetadataLookupMetadata(NULL, recipes, "PSPHOT");
    35     if (!options) {
    36         options = psMetadataAlloc ();
    37         psMetadataAddPtr (recipes, PS_LIST_TAIL, "PSPHOT",  PS_DATA_METADATA, "", options);
    38     } else {
    39         psMemIncrRefCounter (options); // so we can free options below if not allocated here
    40     }
     23    psMetadata *options = pmConfigRecipeOptions (config, PSPHOT_RECIPE);
    4124
    4225    // run the test model (requires X,Y coordinate)
     
    10083    // drop the local view on the options (saved in config->arguments)
    10184    psFree (options);
    102     psFree (recipes);
    10385
    10486    // the input file is a required argument; if not found, we will exit
  • trunk/psphot/src/psphotImageMedian.c

    r10399 r10437  
    1919
    2020    // select the appropriate recipe information
    21     psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PSPHOT");
     21    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
    2222
    2323    // user supplied seed, if available
  • trunk/psphot/src/psphotParseCamera.c

    r10427 r10437  
    1414
    1515    // select recipe options supplied on command line
    16     psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PSPHOT");
     16    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
    1717
    1818    // set default recipe values here
  • trunk/psphot/src/psphotReadout.c

    r10393 r10437  
    44
    55    // select the current recipe
    6     psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSPHOT");
     6    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE);
    77
    88    // find the currently selected readout
Note: See TracChangeset for help on using the changeset viewer.