Write a single row of the selected data.
167 map<string, CCfits::Column*>::iterator it;
173 if (it->first == *jt)
181 int offset = offsets[it->second->index()-1];
182 const char* charSrc =
reinterpret_cast<char*
>(&fitsBuffer[offset]);
183 unsigned char copyBuffer[30];
184 for (
int width = 0; width<it->second->width(); width++)
186 switch (it->second->type())
189 targetFile << *charSrc;
190 charSrc +=
sizeof(char);
192 case CCfits::Tushort:
193 targetFile << *reinterpret_cast<const unsigned short*>(charSrc);
194 charSrc +=
sizeof(char);
197 targetFile << *reinterpret_cast<const short*>(charSrc);
198 charSrc +=
sizeof(char);
201 reverse_copy(charSrc, charSrc+
sizeof(
unsigned int), copyBuffer);
203 targetFile << *reinterpret_cast<unsigned int*>(copyBuffer);
204 charSrc +=
sizeof(int);
207 reverse_copy(charSrc, charSrc+
sizeof(
int), copyBuffer);
208 targetFile << *reinterpret_cast<int*>(copyBuffer);
209 charSrc +=
sizeof(int);
212 reverse_copy(charSrc, charSrc+
sizeof(
unsigned long), copyBuffer);
213 targetFile << *reinterpret_cast<unsigned long*>(copyBuffer);
214 charSrc +=
sizeof(int);
217 reverse_copy(charSrc, charSrc+
sizeof(
long), copyBuffer);
218 targetFile << *reinterpret_cast<long*>(copyBuffer);
219 charSrc +=
sizeof(int);
221 case CCfits::Tlonglong:
222 reverse_copy(charSrc, charSrc+
sizeof(
long long), copyBuffer);
223 targetFile << *reinterpret_cast<long long*>(copyBuffer);
224 charSrc +=
sizeof(
long long);
227 reverse_copy(charSrc, charSrc+
sizeof(
float), copyBuffer);
228 targetFile << *reinterpret_cast<float*>(copyBuffer);
229 charSrc +=
sizeof(float);
231 case CCfits::Tdouble:
232 reverse_copy(charSrc, charSrc+
sizeof(
double), copyBuffer);
233 targetFile << *reinterpret_cast<double*>(copyBuffer);
234 charSrc +=
sizeof(double);
238 case CCfits::Tlogical:
239 case CCfits::Tstring:
240 case CCfits::Tcomplex:
241 case CCfits::Tdblcomplex:
244 case CCfits::VTlogical:
245 case CCfits::VTushort:
246 case CCfits::VTshort:
249 case CCfits::VTulong:
251 case CCfits::VTlonglong:
252 case CCfits::VTfloat:
253 case CCfits::VTdouble:
254 case CCfits::VTcomplex:
255 case CCfits::VTdblcomplex:
256 Error(
"Data type not implemented yet.");
260 Error(
"THIS SHOULD NEVER BE REACHED");
map< string, CCfits::Column * > fColMap
map between the column names and their CCfits objects
int Error(const std::string &str)
vector< string > fDumpList
List of the column names to be dumped.
int fStreamPrecision
Precision of the ofstream. Used to output a given number of significant digits for floats or doubles...