12 targetFile.precision(20);
13 map<string, CCfits::Column*>::iterator it;
14 for (it=colMap.begin(); it != colMap.end(); it++)
17 for (vector<string>::iterator jt=dumpList.begin(); jt != dumpList.end(); jt++)
27 int offset = offsets[it->second->index()-1];
28 const char* charSrc =
reinterpret_cast<char*
>(&fitsBuffer[offset]);
29 unsigned char copyBuffer[30];
30 for (
int width = 0; width<it->second->width(); width++)
32 switch (it->second->type())
35 targetFile << *charSrc;
36 charSrc +=
sizeof(char);
39 reverse_copy(charSrc, charSrc+
sizeof(
unsigned short), copyBuffer);
40 targetFile << *reinterpret_cast<const unsigned short*>(copyBuffer);
41 charSrc +=
sizeof(char);
44 reverse_copy(charSrc, charSrc+
sizeof(
short), copyBuffer);
45 targetFile << *reinterpret_cast<const short*>(copyBuffer);
46 charSrc +=
sizeof(char);
49 reverse_copy(charSrc, charSrc+
sizeof(
unsigned int), copyBuffer);
51 targetFile << *reinterpret_cast<unsigned int*>(copyBuffer);
52 charSrc +=
sizeof(int);
55 reverse_copy(charSrc, charSrc+
sizeof(
int), copyBuffer);
56 targetFile << *reinterpret_cast<int*>(copyBuffer);
57 charSrc +=
sizeof(int);
60 reverse_copy(charSrc, charSrc+
sizeof(
unsigned long), copyBuffer);
61 targetFile << *reinterpret_cast<unsigned long*>(copyBuffer);
62 charSrc +=
sizeof(int);
65 reverse_copy(charSrc, charSrc+
sizeof(
long), copyBuffer);
66 targetFile << *reinterpret_cast<long*>(copyBuffer);
67 charSrc +=
sizeof(int);
69 case CCfits::Tlonglong:
70 reverse_copy(charSrc, charSrc+
sizeof(
long long), copyBuffer);
71 targetFile << *reinterpret_cast<long long*>(copyBuffer);
72 charSrc +=
sizeof(
long long);
75 reverse_copy(charSrc, charSrc+
sizeof(
float), copyBuffer);
76 targetFile << *reinterpret_cast<float*>(copyBuffer);
77 charSrc +=
sizeof(float);
80 reverse_copy(charSrc, charSrc+
sizeof(
double), copyBuffer);
81 targetFile << *reinterpret_cast<double*>(copyBuffer);
82 charSrc +=
sizeof(double);
86 case CCfits::Tlogical:
88 case CCfits::Tcomplex:
89 case CCfits::Tdblcomplex:
92 case CCfits::VTlogical:
93 case CCfits::VTushort:
99 case CCfits::VTlonglong:
100 case CCfits::VTfloat:
101 case CCfits::VTdouble:
102 case CCfits::VTcomplex:
103 case CCfits::VTdblcomplex:
104 cout <<
"Data type not implemented yet." << endl;
108 cout <<
"THIS SHOULD NEVER BE REACHED" << endl;