IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7519


Ignore:
Timestamp:
Jun 11, 2006, 11:07:09 AM (20 years ago)
Author:
eugene
Message:

sequence re-order to make code clearer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotArguments.c

    r7344 r7519  
    1212    }
    1313
    14     // these other options override the PSPHOT recipe options
     14    // load config data from default locations
     15    pmConfig *config = pmConfigRead(argc, argv);
     16    if (config == NULL) {
     17        psError(PSPHOT_ERR_CONFIG, false, "Can't find site configuration");
     18        return NULL;
     19    }
     20
     21    // Storage for other command-line arguments
     22    config->arguments = psMetadataAlloc ();
     23
     24    // save the recipe options separately until we have loaded the recipe (psphotParseDetrend)
    1525    psMetadata *options = psMetadataAlloc ();
     26    psMetadataAddPtr (config->arguments, PS_LIST_TAIL, "PSPHOT.OPTIONS",  PS_DATA_METADATA, "", options);
     27
     28    // the following options override the PSPHOT recipe options
    1629
    1730    // run the test model (requires X,Y coordinate)
     
    96109        psArgumentRemove (N, argc, argv);
    97110    }
    98 
    99     // load config data from default locations
    100     pmConfig *config = pmConfigRead(argc, argv);
    101 
    102     if (config == NULL) {
    103         psError(PSPHOT_ERR_CONFIG, false, "pmConfigRead returns NULL");
    104         psFree(options);
    105         return NULL;
    106     }
    107 
    108     // Storage for other command-line arguments
    109     config->arguments = psMetadataAlloc ();
    110 
    111     // save these recipe options until we have loaded the options
    112     psMetadataAddPtr (config->arguments, PS_LIST_TAIL, "PSPHOT.OPTIONS",  PS_DATA_METADATA, "", options);
     111   
     112    // drop the local view on the options (saved on config->arguments)
    113113    psFree (options);
    114 
    115     // chip selection is used to limit chips to be processed
    116     if ((N = psArgumentGet (*argc, argv, "-chip"))) {
    117         psArgumentRemove (N, argc, argv);
    118         psMetadataAddStr (config->arguments, PS_LIST_TAIL, "CHIP_SELECTION", PS_DATA_STRING, "", psStringCopy(argv[N]));
    119         psArgumentRemove (N, argc, argv);
    120     }
    121114
    122115    // the input file is a required argument; if not found, we will exit
     
    125118        psError(PSPHOT_ERR_ARGUMENTS, false, "pmConfigFileSetsMD failed to parse arguments");
    126119        return NULL;
     120    }
     121
     122    // chip selection is used to limit chips to be processed
     123    if ((N = psArgumentGet (*argc, argv, "-chip"))) {
     124        psArgumentRemove (N, argc, argv);
     125        psMetadataAddStr (config->arguments, PS_LIST_TAIL, "CHIP_SELECTIONS", PS_DATA_STRING, "", psStringCopy(argv[N]));
     126        psArgumentRemove (N, argc, argv);
    127127    }
    128128
Note: See TracChangeset for help on using the changeset viewer.