Changeset 7297 for trunk/psLib/src/fits/psFitsHeader.c
- Timestamp:
- Jun 2, 2006, 10:59:57 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fits/psFitsHeader.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFitsHeader.c
r7295 r7297 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-06-02 19:50:48$9 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-06-02 20:59:57 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 36 36 37 37 // List of FITS header keys not to write (handled by cfitsio); NULL-terminated 38 static char *noWriteFitsKeys[] = {" XTENSION", "BITPIX", "NAXIS", "EXTNAME", "BSCALE", "BZERO",38 static char *noWriteFitsKeys[] = {"SIMPLE", "XTENSION", "BITPIX", "NAXIS", "EXTNAME", "BSCALE", "BZERO", 39 39 "TFIELDS", NULL}; 40 40 // List of the start of FITS header keys not to write (handled by cfitsio); NULL-terminated … … 250 250 ) 251 251 { 252 int status = 0; // Status of cfitsio calls 253 bool simple = true; // If SIMPLE is T, then the file should conform to the FITS standard 254 psMetadataItem *simpleItem = psMetadataLookup(output, "SIMPLE"); // SIMPLE in the header 255 if (simpleItem) { 256 // We allow the user to write SIMPLE, but it must be boolean 257 if (simpleItem->type != PS_DATA_BOOL) { 258 psError(PS_ERR_BAD_PARAMETER_TYPE, true, "SIMPLE in a FITS header must be of boolean type: " 259 "not %x --- assuming TRUE.\n", simpleItem->type); 260 int value = false; // Temporary holder for boolean 261 fits_update_key(fits->fd, TLOGICAL, "SIMPLE", &value, 262 "File does not conform to FITS standard", &status); 263 simple = false; 264 } else if (!simpleItem->data.B) { 265 simple = false; 266 int value = false; // Temporary holder for boolean 267 fits_update_key(fits->fd, TLOGICAL, "SIMPLE", &value, 268 "File does not conform to FITS standard", &status); 269 } 270 // SIMPLE = T is taken care of by cfitsio. 271 } 272 252 273 // Traverse the metadata list and add each key. 253 274 psListIterator* iter = psListIteratorAlloc(output->list, PS_LIST_HEAD, true); // Iterator 254 275 psMetadataItem* item; // Item from iteration 255 int status = 0; // Status of cfitsio calls256 bool simple = true; // If SIMPLE is T, then the file should conform to the FITS standard257 276 while ((item = psListGetAndIncrement(iter))) { 258 // We allow the user to write SIMPLE, but it must be boolean259 if (strcmp(item->name, "SIMPLE") == 0) {260 if (item->type != PS_DATA_BOOL) {261 psError(PS_ERR_BAD_PARAMETER_TYPE, true, "SIMPLE in a FITS header must be of boolean type: "262 "not %x --- assuming FALSE.\n", item->type);263 int value = false; // Temporary264 fits_update_key(fits->fd, TLOGICAL, "SIMPLE", &value,265 "File does not conform to FITS standard", &status);266 simple = false;267 continue;268 } else if (! item->data.B) {269 simple = false;270 }271 }272 273 277 // Check to see if the item should be ignored 274 278 if (simple) {
Note:
See TracChangeset
for help on using the changeset viewer.
