- Timestamp:
- Mar 9, 2012, 7:14:51 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/initialize.c
r32346 r33448 123 123 } 124 124 125 void initialize_client (int argc, char **argv) { 126 127 int NPHOTCODES; 128 char *codename, *ptr, *list; 129 130 ptr = NULL; 131 132 ConfigInit (&argc, argv); 133 args_client (argc, argv); 134 135 /* build a list of accepted photcodes. these will be used by bcatalog to accept or 136 reject loaded data */ 137 138 NphotcodesKeep = 0; 139 photcodesKeep = NULL; 140 if (PHOTCODE_KEEP_LIST != NULL) { 141 NPHOTCODES = 10; 142 ALLOCATE (photcodesKeep, PhotCode *, NPHOTCODES); 143 144 /* parse the comma-separated list of photcodesKeep */ 145 list = PHOTCODE_KEEP_LIST; 146 while ((codename = strtok_r (list, ",", &ptr)) != NULL) { 147 list = NULL; // pass NULL on successive strtok_r calls 148 fprintf (stderr, "PHOTCODE_LIST: %s\n", PHOTCODE_KEEP_LIST); 149 fprintf (stderr, "codename: %s\n", codename); 150 if ((photcodesKeep[NphotcodesKeep] = GetPhotcodebyName (codename)) == NULL) { 151 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename); 152 exit (1); 153 } 154 NphotcodesKeep ++; 155 CHECK_REALLOCATE (photcodesKeep, PhotCode *, NPHOTCODES, NphotcodesKeep, 10); 156 } 157 } 158 159 NphotcodesSkip = 0; 160 photcodesSkip = NULL; 161 if (PHOTCODE_SKIP_LIST != NULL) { 162 NPHOTCODES = 10; 163 ALLOCATE (photcodesSkip, PhotCode *, NPHOTCODES); 164 165 /* parse the comma-separated list of photcodesSkip */ 166 list = PHOTCODE_SKIP_LIST; 167 while ((codename = strtok_r (list, ",", &ptr)) != NULL) { 168 list = NULL; // pass NULL on successive strtok_r calls 169 fprintf (stderr, "PHOTCODE_LIST: %s\n", PHOTCODE_SKIP_LIST); 170 fprintf (stderr, "codename: %s\n", codename); 171 if ((photcodesSkip[NphotcodesSkip] = GetPhotcodebyName (codename)) == NULL) { 172 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename); 173 exit (1); 174 } 175 NphotcodesSkip ++; 176 CHECK_REALLOCATE (photcodesSkip, PhotCode *, NPHOTCODES, NphotcodesSkip, 10); 177 } 178 } 179 180 NphotcodesGroupA = 0; 181 photcodesGroupA = NULL; 182 if (PHOTCODE_A_LIST != NULL) { 183 NPHOTCODES = 10; 184 ALLOCATE (photcodesGroupA, PhotCode *, NPHOTCODES); 185 186 /* parse the comma-separated list of photcodesGroupA */ 187 fprintf (stderr, "PHOTCODE_A_LIST: %s\n", PHOTCODE_A_LIST); 188 list = PHOTCODE_A_LIST; 189 while ((codename = strtok_r (list, ",", &ptr)) != NULL) { 190 list = NULL; // pass NULL on successive strtok_r calls 191 fprintf (stderr, "codename: %s\n", codename); 192 if ((photcodesGroupA[NphotcodesGroupA] = GetPhotcodebyName (codename)) == NULL) { 193 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename); 194 exit (1); 195 } 196 NphotcodesGroupA ++; 197 CHECK_REALLOCATE (photcodesGroupA, PhotCode *, NPHOTCODES, NphotcodesGroupA, 10); 198 } 199 } 200 201 NphotcodesGroupB = 0; 202 photcodesGroupB = NULL; 203 if (PHOTCODE_B_LIST != NULL) { 204 NPHOTCODES = 10; 205 ALLOCATE (photcodesGroupB, PhotCode *, NPHOTCODES); 206 207 fprintf (stderr, "PHOTCODE_B_LIST: %s\n", PHOTCODE_B_LIST); 208 /* parse the comma-separated list of photcodesGroupB */ 209 list = PHOTCODE_B_LIST; 210 while ((codename = strtok_r (list, ",", &ptr)) != NULL) { 211 list = NULL; // pass NULL on successive strtok_r calls 212 fprintf (stderr, "codename: %s\n", codename); 213 if ((photcodesGroupB[NphotcodesGroupB] = GetPhotcodebyName (codename)) == NULL) { 214 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename); 215 exit (1); 216 } 217 NphotcodesGroupB ++; 218 CHECK_REALLOCATE (photcodesGroupB, PhotCode *, NPHOTCODES, NphotcodesGroupB, 10); 219 } 220 } 221 222 initstats (STATMODE); 223 224 // IMAGE_BAD = ID_IMAGE_ASTROM_POOR | ID_IMAGE_ASTROM_FEW | ID_IMAGE_ASTROM_SKIP; 225 // STAR_BAD = ID_STAR_POOR | ID_STAR_FEW; 226 // MEAS_BAD = ID_MEAS_NOCAL | ID_MEAS_POOR_ASTROM | ID_MEAS_SKIP_ASTROM | ID_MEAS_AREA; 227 } 228
Note:
See TracChangeset
for help on using the changeset viewer.
