csv2Fits converts a file with comma-separated values to a binary FITS table.
More...
#include <csv2Fits.h>
|
| csv2Fits (const std::string infile, const char fsep=',') |
| Constructor.
|
|
void | cnvrt (const std::string typs) const |
| Scan all lines of the input file and generate the FITS file.
|
|
|
std::string | csvFil |
| The name of the input file.
|
|
char | fsep |
| The field separator .
|
|
|
std::vector< std::string > | strtok (const std::string lin) const |
| Decompose the CSV line by splitting it along commas.
|
|
std::vector< int > | colWidths (int &lineCnt) const |
| Determine the number of characters in the longest string in each column.
|
|
csv2Fits converts a file with comma-separated values to a binary FITS table.
csv2Fits::csv2Fits |
( |
const std::string |
infile, |
|
|
const char |
f = ',' |
|
) |
| |
Constructor.
- Parameters
-
[in] | infile | The name of the ASCII file in CSV format. |
[in] | f | The field separator. This is a single character (the comma by default) which separates adjacent fields in the input file. |
- Author
- Richard J. Mathar
- Since
- 2013-04-30
void csv2Fits::cnvrt |
( |
const std::string |
typs | ) |
const |
Scan all lines of the input file and generate the FITS file.
- Parameters
-
[in] | typs | A type string with letters a, d, f, b, i, k, and j indicating the FITS type of each column (each field in the CSV) |
- Author
- R. J. Mathar
- Since
- 2013-04-30
vector< string > csv2Fits::strtok |
( |
const std::string |
lin | ) |
const |
|
protected |
Decompose the CSV line by splitting it along commas.
- Parameters
-
[in] | lin | The input line with any number of field separators. |
- Returns
- The first field in the 0-th element, the 2nd field in the 1-st element etc.
vector< int > csv2Fits::colWidths |
( |
int & |
lineCt | ) |
const |
|
protected |
Determine the number of characters in the longest string in each column.
- Parameters
-
[out] | lineCt | On return this contains the number of lines in the input file. The header line with the prospective names of the columns is not counted. |
- Returns
- A vector of maximum character widths for columns 0, 1, 2, ... etc This summarizes the widths of the associated column along all lines of the input file.
- Author
- R. J. Mathar
- Since
- 2013-04-30
std::string csv2Fits::csvFil |
The name of the input file.
The field separator .
By default this is a comma. For many astronomical databases, the standard is the vertical bar (pipe symbol).
The documentation for this class was generated from the following files: