IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

updated to new pmConfigRead, added PSPHOT_RECIPE, new option lookup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.