Changeset 8821
- Timestamp:
- Sep 18, 2006, 9:23:40 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConceptsRead.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConceptsRead.c
r8815 r8821 265 265 PS_ASSERT_PTR_NON_NULL(target, false); 266 266 267 pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // The HDU at the lowest level268 if (!hdu ) {267 pmHDU *hduLow = pmHDUGetLowest(fpa, chip, cell); // The HDU at the lowest level 268 if (!hduLow) { 269 269 psError(PS_ERR_UNKNOWN, true, "Can't find HDU at lowest level"); 270 270 return false; 271 271 } 272 psMetadata *cameraFormat = hdu->format; // The camera format 272 pmHDU *hduHigh = pmHDUGetHighest(fpa, chip, cell); // The HDU at the highest level 273 if (!hduHigh) { 274 psError(PS_ERR_UNKNOWN, true, "Can't find HDU at the highest level"); 275 return false; 276 } 277 assert(hduLow->format == hduHigh->format); // Just in case.... 278 psMetadata *cameraFormat = hduLow->format; // The camera format 273 279 bool mdok = true; // Status of MD lookup 274 280 psMetadata *transSpec = psMetadataLookupMD(&mdok, cameraFormat, "TRANSLATION"); // The TRANSLATION spec … … 295 301 psFree(nameSource); 296 302 if (mdok && strlen(source) && strcasecmp(source, "HEADER") == 0) { 297 headerItem = psMemIncrRefCounter(psMetadataLookup(hdu->header, conceptItem->data.V)); 303 headerItem = psMetadataLookup(hduLow->header, conceptItem->data.V); 304 if (!headerItem && hduHigh != hduLow) { 305 headerItem = psMetadataLookup(hduHigh->header, conceptItem->data.V); 306 } 307 psMemIncrRefCounter(headerItem); 298 308 } 299 309 // Leave the error handling to pmConceptsFromCamera, which should already have been called … … 307 317 if (keys->n == 1) { 308 318 // Only one key --- proceed as usual 309 headerItem = psMemIncrRefCounter(psMetadataLookup(hdu->header, keywords)); 319 headerItem = psMetadataLookup(hduLow->header, keywords); 320 if (!headerItem && hduHigh != hduLow) { 321 headerItem = psMetadataLookup(hduHigh->header, keywords); 322 } 323 psMemIncrRefCounter(headerItem); 310 324 } else { 311 325 psListIterator *keysIter = psListIteratorAlloc(keys, PS_LIST_HEAD, false); // Iterator … … 313 327 psList *values = psListAlloc(NULL); // List containing the values 314 328 while ((key = psListGetAndIncrement(keysIter))) { 315 psMetadataItem *value = psMetadataLookup(hdu->header, key); 329 psMetadataItem *value = psMetadataLookup(hduLow->header, key); 330 if (!value && hduHigh != hduLow) { 331 value = psMetadataLookup(hduHigh->header, key); 332 } 333 if (!value) { 334 psWarning("Unable to find header %s --- assuming value is NULL", key); 335 } 316 336 psListAdd(values, PS_LIST_TAIL, value); 317 337 }
Note:
See TracChangeset
for help on using the changeset viewer.
