IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10438


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

updated to new pmConfigRead, added PSASTRO_RECIPE, new option lookup

Location:
trunk/psastro/src
Files:
11 edited

Legend:

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

    r10292 r10438  
    1111
    1212# include "psastroErrorCodes.h"
     13#define PSASTRO_RECIPE "PSASTRO" // Name of the recipe to use
    1314
    1415# define psMemCopy(A)(psMemIncrRefCounter((A)))
  • trunk/psastro/src/psastroArguments.c

    r9627 r10438  
    1515    psLogSetFormat ("M");
    1616
    17     // these other options override the PSASTRO recipe options
    18     psMetadata *options = psMetadataAlloc ();
     17    // load config data from default locations
     18    pmConfig *config = pmConfigRead(&argc, argv, PSASTRO_RECIPE);
     19    if (config == NULL) {
     20        psError(PSASTRO_ERR_CONFIG, false, "Can't read site configuration");
     21        return NULL;
     22    }
     23
     24    // save the following additional recipe values based on command-line options
     25    // these options override the PSPHOT recipe values loaded from recipe files
     26    psMetadata *options = pmConfigRecipeOptions (config, PSASTRO_RECIPE);
    1927
    2028    // photcode : used in output to supplement header data (argument or recipe?)
     
    2432        psArgumentRemove (N, &argc, argv);
    2533    }
    26 
    27     // load config data from default locations
    28     pmConfig *config = pmConfigRead(&argc, argv);
    29     if (config == NULL) {
    30         psError(PSASTRO_ERR_CONFIG, false, "Can't read site configuration");
    31         return NULL;
    32     }
    33 
    34     // save these recipe options until we have loaded the options
    35     psMetadataAddPtr (config->arguments, PS_LIST_TAIL, "PSASTRO.OPTIONS",  PS_DATA_METADATA, "", options);
    36     psFree (options);
    3734
    3835    // chip selection is used to limit chips to be processed
     
    4946        psArgumentRemove (N, &argc, argv);
    5047    }
     48
     49    // drop the local view on the options (saved in config->arguments)
     50    psFree (options);
    5151
    5252    status = pmConfigFileSetsMD (config->arguments, config, "INPUT", "-file", "-list");
  • trunk/psastro/src/psastroAstromGuess.c

    r9641 r10438  
    2828
    2929    // select the current recipe
    30     psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO");
     30    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE);
    3131    if (!recipe) {
    3232        psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!");
  • trunk/psastro/src/psastroChipAstrom.c

    r9644 r10438  
    99
    1010    // select the current recipe
    11     psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO");
     11    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE);
    1212    if (!recipe) {
    1313        psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe");
  • trunk/psastro/src/psastroChooseRefstars.c

    r9732 r10438  
    99
    1010    // select the current recipe
    11     psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO");
     11    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE);
    1212    if (!recipe) {
    1313        psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n");
  • trunk/psastro/src/psastroDataLoad.c

    r9574 r10438  
    1313
    1414    // select the current recipe
    15     psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO");
     15    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE);
    1616    if (!recipe) {
    1717        psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n");
  • trunk/psastro/src/psastroDataSave.c

    r9574 r10438  
    1010
    1111    // select the current recipe
    12     psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO");
     12    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE);
    1313    if (!recipe) {
    1414        psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n");
  • trunk/psastro/src/psastroLoadRefstars.c

    r9732 r10438  
    1313
    1414    // select the current recipe
    15     psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO");
     15    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE);
    1616
    1717    // DVO APIs expect decimal degrees
  • trunk/psastro/src/psastroMosaicAstrom.c

    r9646 r10438  
    77
    88    // select the current recipe
    9     psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO");
     9    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE);
    1010    if (!recipe) {
    1111        psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n");
  • trunk/psastro/src/psastroMosaicHeaders.c

    r9574 r10438  
    77
    88    // select the current recipe
    9     psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSASTRO");
     9    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE);
    1010    if (!recipe) {
    1111        psError(PSASTRO_ERR_CONFIG, true, "Can't find PSASTRO recipe!\n");
  • trunk/psastro/src/psastroParseCamera.c

    r9574 r10438  
    1313
    1414    // select recipe options supplied on command line
    15     psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes,   "PSASTRO");
    16     psMetadata *options = psMetadataLookupPtr (&status, config->arguments, "PSASTRO.OPTIONS");
    17     psMetadataCopy (recipe, options);
     15    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE);
    1816
    1917    // set default recipe values here
Note: See TracChangeset for help on using the changeset viewer.