IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 21, 2006, 1:52:54 PM (20 years ago)
Author:
Paul Price
Message:

Now works with GPC1 dummy OTA FITS file from Sidik; some other changes to organise things.

File:
1 edited

Legend:

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

    r6618 r6663  
    115115        return false;
    116116    }
    117     psString result = psMetadataLookupStr(&mdok, header, keyword);
    118     if (!mdok || strlen(result) == 0) {
     117    psMetadataItem *resultItem = psMetadataLookup(header, keyword);
     118    if (! resultItem) {
    119119        psError(PS_ERR_IO, false, "Unable to find %s in primary header to identify %s.\n", keyword, name);
    120120        return NULL;
    121121    }
    122 
    123     return result;
     122    return psMetadataItemParseString(resultItem);
    124123}
    125124
     
    190189    }
    191190    psMetadataItem *fpaNameItem = psMetadataLookup(phu, nameKeyword); // Name of the FPA
     191    if (!fpaNameItem) {
     192        psError(PS_ERR_IO, false, "Unable to find keyword %s with the name of the FPA.\n", nameKeyword);
     193        return NULL;
     194    }
    192195    const char *newFPAname = psMetadataItemParseString(fpaNameItem); // FPA.NAME for new source
    193196    fpaNameItem = psMetadataLookup(fpa->concepts, "FPA.NAME"); // Current name of FPA
     
    421424            psString chipName = NULL;   // Name of chip under consideration
    422425            pmChip *chip = NULL;        // The chip we're looking for
    423             if (! fpa->hdu->phu) {
     426            #if 1
     427            // Think I'm doing this at the start now
     428            if (!fpa->hdu || !fpa->hdu->phu) {
    424429                // Need to look up the name of the chip
    425430                chipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu);
     
    431436                chip = fpa->chips->data[chipNum];
    432437            }
     438            #endif
    433439            for (int i = 0; i < names->n; i++) {
    434440                psString cellType = values->data[i]; // The type of the cell
    435441                psString cellName = NULL; // The name of the cell
    436                 if (fpa->hdu->phu) {
     442                if (fpa->hdu && fpa->hdu->phu) {
    437443                    // We've got chipName:cellType with cellType == cellName
    438444                    chipName = names->data[i];
Note: See TracChangeset for help on using the changeset viewer.