Changeset 3666 for trunk/stac/src/stacConfig.c
- Timestamp:
- Apr 5, 2005, 11:51:26 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/stac/src/stacConfig.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/stac/src/stacConfig.c
r3660 r3666 6 6 #include "pslib.h" 7 7 #include "stac.h" 8 #include "stacConfig.h" 8 9 9 10 stacConfig *stacConfigAlloc(void) … … 21 22 config->starMapFile = NULL; 22 23 config->aper = 3.0; 23 config->outnx = 512;24 config->outny = 512;25 config->saturated = NULL; // Saturations; will fill this in later, when we know how many images26 config->bad = NULL; // Bad levels; will fill this in later, when we know how many images24 config->outnx = 0; 25 config->outny = 0; 26 config->saturated = 65535.0; // Saturation level 27 config->bad = 0.0; // Bad level 27 28 config->reject = 3.0; 28 29 config->frac = 0.5; … … 40 41 psFree(config->inputs); 41 42 } 42 if (config->saturated) {43 psFree(config->saturated);44 }45 if (config->bad) {46 psFree(config->bad);47 }48 43 // Free everything 49 44 psFree(config); … … 57 52 stacConfig *config = stacConfigAlloc(); // Configuration values 58 53 const char *programName = argv[0]; // Program name 59 60 float saturated = 65535.0; // Saturation level61 float bad = 0.0; // Bad level62 54 63 55 /* Variables for getopt */ … … 96 88 break; 97 89 case 's': 98 if (sscanf(optarg, "%f", & saturated) != 1) {90 if (sscanf(optarg, "%f", &config->saturated) != 1) { 99 91 help(programName); 100 92 exit(EXIT_FAILURE); … … 102 94 break; 103 95 case 'b': 104 if (sscanf(optarg, "%f", & bad) != 1) {96 if (sscanf(optarg, "%f", &config->bad) != 1) { 105 97 help(programName); 106 98 exit(EXIT_FAILURE); … … 170 162 } 171 163 172 // Create the saturation and bad vectors173 config->saturated = psVectorAlloc(argc-1, PS_TYPE_F32);174 config->bad = psVectorAlloc(argc-1, PS_TYPE_F32);175 for (int i = 0; i < argc - 1; i++) {176 ((psVector*)config->saturated)->data.F32[i] = saturated;177 ((psVector*)config->bad)->data.F32[i] = bad;178 }179 180 164 // Debugging output 181 165 psTrace("stac.config", 8, "Parsed command line for configuration\n");
Note:
See TracChangeset
for help on using the changeset viewer.
