IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6582


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.

Location:
branches/rel10_ifa/psModules/src/astrom
Files:
3 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
  • branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c

    r6581 r6582  
    217217        // No extensions --- it's all in the PHU
    218218        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
    219230        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        }
    220237
    221238        // Parse the list of first:second
  • branches/rel10_ifa/psModules/src/astrom/pmFPARead.c

    r6575 r6582  
    184184{
    185185    pmHDU *hdu = pmHDUFromCell(cell);   // The HDU
     186    if (!hdu) {
     187        return false;                    // Nothing to see here; move along
     188    }
    186189    if (!hdu->images && !pmHDURead(hdu, fits)) {
    187190        psError(PS_ERR_IO, false, "Unable to read HDU for cell.\n");
Note: See TracChangeset for help on using the changeset viewer.