Changeset 6582
- Timestamp:
- Mar 13, 2006, 11:50:51 PM (20 years ago)
- Location:
- branches/rel10_ifa/psModules/src/astrom
- Files:
-
- 3 edited
-
pmConceptsRead.c (modified) (5 diffs)
-
pmFPAConstruct.c (modified) (1 diff)
-
pmFPARead.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/astrom/pmConceptsRead.c
r6580 r6582 187 187 if (cell) { 188 188 pmHDU *hdu = pmHDUGetLowest(NULL, NULL, cell); // The HDU at the lowest level 189 if (! hdu) { 190 return false; 191 } 189 192 psMetadata *cameraFormat = hdu->format; // The camera format 190 193 psMetadata *cellConfig = cell->config; // The camera configuration for this cell … … 197 200 psMetadataItem *value = NULL; // The value of the concept 198 201 if (conceptItem) { 199 // Check the SOURCE 200 psString nameSource = NULL; // String with the concept name and ".SOURCE" added 201 psStringAppend(&nameSource, "%s.SOURCE", name); 202 bool mdok = true; // Status of MD lookup 203 psString source = psMetadataLookupStr(&mdok, cell->config, nameSource); // The source 204 if (mdok && strlen(source) > 0 && strcasecmp(source, "VALUE") == 0) { 205 value = psMemIncrRefCounter(conceptItem); 206 conceptParse(spec, value, cameraFormat, target, NULL, NULL, cell); 207 } else if (source && (strlen(source) == 0 || strcasecmp(source, "HEADER") != 0)) { 208 // We leave "HEADER" to pmConceptsReadFromHeader 209 psError(PS_ERR_IO, true, "%s isn't HEADER or VALUE --- can't read %s\n", source, name); 210 continue; 202 if (conceptItem->type == PS_DATA_STRING) { 203 // Check the SOURCE 204 psString nameSource = NULL; // String with the concept name and ".SOURCE" added 205 psStringAppend(&nameSource, "%s.SOURCE", name); 206 bool mdok = true; // Status of MD lookup 207 psString source = psMetadataLookupStr(&mdok, cell->config, nameSource); // The source 208 if (mdok && strlen(source) > 0 && strcasecmp(source, "VALUE") == 0) { 209 value = psMemIncrRefCounter(conceptItem); 210 conceptParse(spec, value, cameraFormat, target, NULL, NULL, cell); 211 } else if (source && (strlen(source) == 0 || strcasecmp(source, "HEADER") != 0)) { 212 // We leave "HEADER" to pmConceptsReadFromHeader 213 psError(PS_ERR_IO, true, "%s isn't HEADER or VALUE --- can't read %s\n", source, 214 name); 215 continue; 216 } 217 } else { 218 // Another type --- should be OK 219 conceptParse(spec, conceptItem, cameraFormat, target, NULL, NULL, cell); 211 220 } 212 221 } … … 227 236 { 228 237 pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // The HDU at the lowest level 238 if (!hdu) { 239 return false; 240 } 229 241 psMetadata *cameraFormat = hdu->format; // The camera format 230 242 bool mdok = true; // Status of MD lookup … … 256 268 { 257 269 pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // The HDU at the lowest level 270 if (!hdu) { 271 return false; 272 } 258 273 psMetadata *cameraFormat = hdu->format; // The camera format 259 274 bool mdok = true; // Status of MD lookup … … 324 339 { 325 340 pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // The HDU at the lowest level 341 if (!hdu) { 342 return false; 343 } 326 344 psMetadata *cameraFormat = hdu->format; // The camera format 327 345 bool mdok = true; // Status of MD lookup -
branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c
r6581 r6582 217 217 // No extensions --- it's all in the PHU 218 218 psString chipType = chipNameFromHeader(formatSpec, phu); // Type of chip 219 printf("chipType: %s<---\n", chipType); 220 #if 1 // This is here for the courtesy of MegaCam, which has "CCD13 " 221 222 char *space = NULL; // Position of a space 223 if ((space = strchr(chipType, ' '))) { 224 psString temp = psStringNCopy(chipType, strlen(chipType) - strlen(space)); 225 // Free memory??? 226 chipType = temp; 227 } 228 #endif 229 219 230 psString content = psMetadataLookupStr(&mdok, contents, chipType); // The content line 231 if (!mdok || strlen(content) == 0) { 232 psError(PS_ERR_IO, true, "Cannot find chip %s in the list of CONTENTS.\n"); 233 psFree(chipType); 234 psFree(content); 235 return false; 236 } 220 237 221 238 // Parse the list of first:second -
branches/rel10_ifa/psModules/src/astrom/pmFPARead.c
r6575 r6582 184 184 { 185 185 pmHDU *hdu = pmHDUFromCell(cell); // The HDU 186 if (!hdu) { 187 return false; // Nothing to see here; move along 188 } 186 189 if (!hdu->images && !pmHDURead(hdu, fits)) { 187 190 psError(PS_ERR_IO, false, "Unable to read HDU for cell.\n");
Note:
See TracChangeset
for help on using the changeset viewer.
