Changeset 6597
- Timestamp:
- Mar 15, 2006, 3:00:42 PM (20 years ago)
- File:
-
- 1 edited
-
branches/rel10_ifa/psLib/src/fits/psFitsHeader.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psLib/src/fits/psFitsHeader.c
r6354 r6597 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $10 * @date $Date: 2006-0 2-08 01:03:34$9 * @version $Revision: 1.2.4.1 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-03-16 01:00:42 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 110 110 atof(keyValue)); 111 111 break; 112 case 'C': 113 // remove the single-quotes at front/end 114 if (keyValue[0] == '\'' && keyValue[strlen(keyValue)-1] == '\'') { 115 keyValue[strlen(keyValue)-1] = '\0'; 112 case 'C': { 113 char *keyValueFixed = keyValue; // Fixed version of the string 114 // remove the single-quotes at front/end 115 if (keyValueFixed[0] == '\'' && keyValueFixed[strlen(keyValue)-1] == '\'') { 116 keyValue[strlen(keyValue)-1] = '\0'; // Remove the trailing quote 117 keyValueFixed += 1; // Advance past the leading quote 118 } 119 // Remove trailing spaces, which are not significant, according to the FITS standard 120 // http://archive.stsci.edu/fits/fits_standard/node31.html#SECTION00921000000000000000 121 char *lastSpace = NULL; // The last space in the string 122 while ((lastSpace = strrchr(keyValueFixed, ' ')) && lastSpace[1] == '\0') { 123 // This is a trailing space, not a leading space. 124 lastSpace[0] = '\0'; // Truncate the string here 125 } 126 127 psTrace("pslib.fits.readHeader", 8, "%s: %s (%s)\n", keyName, keyValueFixed, keyComment); 128 116 129 success = psMetadataAdd(out, 117 130 PS_LIST_TAIL, … … 119 132 PS_DATA_STRING | PS_META_DUPLICATE_OK, 120 133 keyComment, 121 keyValue+1); 122 } else { 123 success = psMetadataAdd(out, 124 PS_LIST_TAIL, 125 keyName, 126 PS_DATA_STRING | PS_META_DUPLICATE_OK, 127 keyComment, 128 keyValue); 134 keyValueFixed); 135 break; 129 136 } 130 break;131 137 case 'L': 132 138 tempBool = (keyValue[0] == 'T') ? 1 : 0;
Note:
See TracChangeset
for help on using the changeset viewer.
