IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 11, 2006, 4:12:24 PM (20 years ago)
Author:
Paul Price
Message:

Adding pmFPAAddSourceFromView; renaming pmFPAAddSource to pmFPAAddSourceFromHeader.

File:
1 edited

Legend:

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

    r6815 r6834  
    135135    }
    136136
     137    if (!hdu->images && !hdu->table && !hdu->header) {
     138        psLogMsg(__func__, PS_LOG_WARN, "Nothing to write for HDU %s\n", hdu->extname);
     139        return false;
     140    }
     141
    137142    // Preserve the extension name, if it's the PHU
    138143    char *extname = hdu->extname;       // The name of the extension
    139     if (strcasecmp(extname, "PHU") == 0) {
     144    if (strcasecmp(extname, "PHU") == 0 && hdu->header) {
    140145        bool mdok = true;               // Status of MD lookup
    141146        extname = psMetadataLookupStr(&mdok, hdu->header, "EXTNAME");
    142         if (!mdok || strlen(extname) == 0) {
     147        if (!mdok || !extname || strlen(extname) == 0) {
    143148            extname = "";
    144149        }
     
    149154        // Tell CFITSIO there's nothing there
    150155        psMetadataItem *naxis = psMetadataLookup(hdu->header, "NAXIS");
    151         naxis->data.S32 = 0;
     156        if (naxis) {
     157            naxis->data.S32 = 0;
     158        }
    152159
    153160        if (!psFitsWriteHeader(hdu->header, fits)) {
Note: See TracChangeset for help on using the changeset viewer.