IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 13, 2006, 11:50:51 PM (20 years ago)
Author:
Paul Price
Message:

Nearly all working; doesn't work on megacam split images yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/astrom/pmConceptsRead.c

    r6580 r6582  
    187187    if (cell) {
    188188        pmHDU *hdu = pmHDUGetLowest(NULL, NULL, cell); // The HDU at the lowest level
     189        if (! hdu) {
     190            return false;
     191        }
    189192        psMetadata *cameraFormat = hdu->format; // The camera format
    190193        psMetadata *cellConfig = cell->config; // The camera configuration for this cell
     
    197200            psMetadataItem *value = NULL; // The value of the concept
    198201            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);
    211220                }
    212221            }
     
    227236{
    228237    pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // The HDU at the lowest level
     238    if (!hdu) {
     239        return false;
     240    }
    229241    psMetadata *cameraFormat = hdu->format; // The camera format
    230242    bool mdok = true;                   // Status of MD lookup
     
    256268{
    257269    pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // The HDU at the lowest level
     270    if (!hdu) {
     271        return false;
     272    }
    258273    psMetadata *cameraFormat = hdu->format; // The camera format
    259274    bool mdok = true;                   // Status of MD lookup
     
    324339{
    325340    pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // The HDU at the lowest level
     341    if (!hdu) {
     342        return false;
     343    }
    326344    psMetadata *cameraFormat = hdu->format; // The camera format
    327345    bool mdok = true;                   // Status of MD lookup
Note: See TracChangeset for help on using the changeset viewer.