IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 12, 2006, 8:59:15 PM (20 years ago)
Author:
eugene
Message:

tests on non-poisson errors, updates to image background, tests of systematic biases, updates to use pmFPAfile paradigm

File:
1 edited

Legend:

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

    r6715 r6851  
    1010
    1111    int N;
     12    bool status;
    1213
    1314    if (*argc == 1) usage ();
     
    118119    }
    119120
    120     // we load all input files onto a psArray, to be parsed later
    121     psArray *input = psArrayAlloc (16);
    122     input->n = 0;
    123 
    124     // load the list of filenames the supplied file (may be a glob: "file*.fits")
    125     if ((N = psArgumentGet (*argc, argv, "-file"))) {
    126         glob_t globList;
    127         psArgumentRemove (N, argc, argv);
    128         globList.gl_offs = 0;
    129         glob (argv[N], 0, NULL, &globList);
    130         for (int i = 0; i < globList.gl_pathc; i++) {
    131             char *filename = psStringCopy (globList.gl_pathv[i]);
    132             psArrayAdd (input, 16, filename);
    133             psFree (filename);
    134         }
    135         psArgumentRemove (N, argc, argv);
    136     }
    137 
    138     // load the list from the supplied text file
    139     if ((N = psArgumentGet (*argc, argv, "-list"))) {
    140         int nItems;
    141         char line[1024]; // XXX limits the list lines to 1024 chars
    142         char word[1024];
    143         char *filename;
    144 
    145         psArgumentRemove (N, argc, argv);
    146         FILE *f = fopen (argv[N], "r");
    147         if (f == NULL) {
    148             psAbort ("psphot", "unable to open specified list file");
    149         }
    150         while (fgets (line, 1024, f) != NULL) {
    151             nItems = sscanf (line, "%s", word);
    152             switch (nItems) {
    153               case 0:
    154                 break;
    155               case 1:
    156                 filename = psStringCopy (word);
    157                 psArrayAdd (input, 16, filename);
    158                 psFree (filename);
    159                 break;
    160               default:
    161                 // rigid format, no comments allowed?
    162                 psAbort ("psphot", "error parsing input list file");
    163                 break;
    164             }
    165         }
    166         psArgumentRemove (N, argc, argv);
    167     }           
    168     if (input->n < 1) usage ();
    169 
    170     // input list gets places as an array on the config->arguements list
    171     psMetadataAddPtr (config->arguments, PS_LIST_TAIL, "INPUT",  PS_DATA_ARRAY, "", input);
    172     psFree (input);
     121    // the input file is a required argument; if not found, we will exit
     122    status = pmConfigFileSetsMD (config->arguments, argc, argv, "INPUT", "-file", "-list");
     123    if (!status) { usage ();}
    173124
    174125    if (*argc != 2) usage ();
Note: See TracChangeset for help on using the changeset viewer.