Changeset 6834 for branches/rel10_ifa/psModules/src/astrom/pmHDU.c
- Timestamp:
- Apr 11, 2006, 4:12:24 PM (20 years ago)
- File:
-
- 1 edited
-
branches/rel10_ifa/psModules/src/astrom/pmHDU.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/astrom/pmHDU.c
r6815 r6834 135 135 } 136 136 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 137 142 // Preserve the extension name, if it's the PHU 138 143 char *extname = hdu->extname; // The name of the extension 139 if (strcasecmp(extname, "PHU") == 0 ) {144 if (strcasecmp(extname, "PHU") == 0 && hdu->header) { 140 145 bool mdok = true; // Status of MD lookup 141 146 extname = psMetadataLookupStr(&mdok, hdu->header, "EXTNAME"); 142 if (!mdok || strlen(extname) == 0) {147 if (!mdok || !extname || strlen(extname) == 0) { 143 148 extname = ""; 144 149 } … … 149 154 // Tell CFITSIO there's nothing there 150 155 psMetadataItem *naxis = psMetadataLookup(hdu->header, "NAXIS"); 151 naxis->data.S32 = 0; 156 if (naxis) { 157 naxis->data.S32 = 0; 158 } 152 159 153 160 if (!psFitsWriteHeader(hdu->header, fits)) {
Note:
See TracChangeset
for help on using the changeset viewer.
