Changeset 6881 for branches/eam_rel9_b1/psLib/src/fits/psFitsHeader.c
- Timestamp:
- Apr 17, 2006, 5:40:44 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_rel9_b1/psLib/src/fits/psFitsHeader.c
r5511 r6881 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 $ $Name: not supported by cvs2svn $10 * @date $Date: 200 5-11-14 22:18:30$9 * @version $Revision: 1.1.6.1 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-04-18 03:40:44 $ 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 121 char *lastSpace = NULL; // The last space in the string 122 while (strlen(keyValueFixed) > 1 && (lastSpace = strrchr(keyValueFixed, ' ')) && 123 lastSpace[1] == '\0') { 124 // This is a trailing space, not a leading space. 125 lastSpace[0] = '\0'; // Truncate the string here 126 } 127 128 psTrace("pslib.fits.readHeader", 8, "%s: %s (%s)\n", keyName, keyValueFixed, keyComment); 129 116 130 success = psMetadataAdd(out, 117 131 PS_LIST_TAIL, … … 119 133 PS_DATA_STRING | PS_META_DUPLICATE_OK, 120 134 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); 135 keyValueFixed); 136 break; 129 137 } 130 break;131 138 case 'L': 132 139 tempBool = (keyValue[0] == 'T') ? 1 : 0;
Note:
See TracChangeset
for help on using the changeset viewer.
