IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12680


Ignore:
Timestamp:
Mar 29, 2007, 11:59:42 AM (19 years ago)
Author:
Paul Price
Message:

Make sure header concepts are only read if they are available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/concepts/pmConcepts.c

    r12663 r12680  
    204204    }
    205205
    206     pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // Any HDU, required for the format
    207     if (!hdu) {
     206    // At least one HDU is required for the reading functions
     207    pmHDU *hduLow = pmHDUGetLowest(fpa, chip, cell); // Lowest HDU.
     208    if (!hduLow) {
    208209        // Can't do anything --- don't record any success, but don't return an error either
    209210        return true;
    210211    }
     212    pmHDU *hduHigh = pmHDUGetHighest(fpa, chip, cell); // Highest HDU
    211213
    212214    bool success = true;                // Success in reading concepts?
     
    229231    }
    230232
    231     if (source & PM_CONCEPT_SOURCE_PHU && !(*read & PM_CONCEPT_SOURCE_PHU)) {
     233    if (source & PM_CONCEPT_SOURCE_PHU && !(*read & PM_CONCEPT_SOURCE_PHU) && hduHigh->header) {
    232234        if (p_pmConceptsReadFromHeader(target, *specs, fpa, chip, cell)) {
    233235            *read |= PM_CONCEPT_SOURCE_PHU;
     
    238240    }
    239241
    240     if (source & PM_CONCEPT_SOURCE_HEADER && !(*read & PM_CONCEPT_SOURCE_HEADER)) {
     242    // If there are multiple HDUs, then it may be that one of them hasn't been read yet (hdu->header not set)
     243    if (source & PM_CONCEPT_SOURCE_HEADER && !(*read & PM_CONCEPT_SOURCE_HEADER) &&
     244        hduLow != hduHigh && hduLow->header) {
    241245        if (p_pmConceptsReadFromHeader(target, *specs, fpa, chip, cell)) {
    242246            *read |= PM_CONCEPT_SOURCE_HEADER;
Note: See TracChangeset for help on using the changeset viewer.