Changeset 11905 for trunk/Mars/mcore
- Timestamp:
- 08/13/11 13:19:30 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/fits.h
r11806 r11905 76 76 size_t size; 77 77 char type; 78 string unit; 78 79 }; 79 80 … … 224 225 return; 225 226 226 const string id = Get<string>("TTYPE"+num.str()); 227 const string fmt = Get<string>("TFORM"+num.str()); 227 const string id = Get<string>("TTYPE"+num.str()); 228 const string fmt = Get<string>("TFORM"+num.str()); 229 const string unit = Get<string>("TUNIT"+num.str()); 228 230 229 231 istringstream sin(fmt); … … 265 267 } 266 268 267 const Table::Column col = { bytes, n, size, type };269 const Table::Column col = { bytes, n, size, type, unit }; 268 270 269 271 cols[id] = col; … … 284 286 } 285 287 286 void PrintKeys( ) const288 void PrintKeys(bool display_all=false) const 287 289 { 288 290 for (Keys::const_iterator it=keys.begin(); it!=keys.end(); it++) 291 { 292 if (!display_all && 293 (it->first.substr(0, 6)!="TTYPE" || 294 it->first.substr(0, 6)!="TFORM" || 295 it->first.substr(0, 6)!="TUNIT" || 296 it->first!="TFIELDS" || 297 it->first!="XTENSION" || 298 it->first!="NAXIS" || 299 it->first!="BITPIX" || 300 it->first!="PCOUNT" || 301 it->first!="GCOUNT") 302 ) 303 continue; 304 289 305 gLog << all << setw(2) << it->second.type << '|' << it->first << '=' << it->second.value << '/' << it->second.comment << '|' << endl; 290 }306 }} 291 307 292 308 void PrintColumns() const … … 300 316 301 317 for (Sorted::const_iterator it=sorted.begin(); it!=sorted.end(); it++) 302 gLog << all << setw(6) << it->second.offset << "| " << it->first.second << " [" << it->second.type << '=' << it->second.num << 'x' << it->second.size << "byte]" << endl; 318 { 319 gLog << all << setw(6) << it->second.offset << "| "; 320 gLog << it->second.num << 'x'; 321 switch (it->second.type) 322 { 323 case 'L': gLog << "bool(8)"; break; 324 case 'B': gLog << "byte(8)"; break; 325 case 'I': gLog << "short(16)"; break; 326 case 'J': gLog << "int(32)"; break; 327 case 'K': gLog << "int(64)"; break; 328 case 'E': gLog << "float(32)"; break; 329 case 'D': gLog << "double(64)"; break; 330 } 331 gLog << ": " << it->first.second << " [" << it->second.unit << "]" << endl; 332 } 303 333 } 304 334
Note:
See TracChangeset
for help on using the changeset viewer.