Isis 3 Programmer Reference
LoadCSV.h
Go to the documentation of this file.
1 #ifndef LoadCSV_h
2 #define LoadCSV_h
3 
26 #include <cmath>
27 #include <string>
28 #include <vector>
29 
30 #include "IString.h"
31 #include "HiCalTypes.h"
32 #include "HiCalUtil.h"
33 #include "HiCalConf.h"
34 #include "CSVReader.h"
35 
36 namespace Isis {
37 
38  class iException;
39 
66  class LoadCSV {
67 
68  public:
69  // Constructors and Destructor
70  LoadCSV();
71  LoadCSV(const QString &base, const HiCalConf &conf,
72  const DbProfile &profile);
73 
75  virtual ~LoadCSV() { }
76 
77  void load(const QString &base, const HiCalConf &conf,
78  const DbProfile &profile);
79 
80  QString filename() const;
81  int size() const;
82 
83  bool validateSize(const int &expected,
84  const bool &throw_on_error = false)
85  const;
86 
87  HiVector getVector() const;
88  HiMatrix getMatrix() const;
89 
90  void History(HiHistory &history) const;
91 
92  private:
93  QString _base;
94  DbProfile _csvSpecs;
95  HiMatrix _data;
96  std::vector<QString> _history;
97 
98  void init(const QString &base, const HiCalConf &conf,
99  const DbProfile &profile);
100  void addHistory(const QString &element, const QString &desc);
101  void getKeyList(const QString &base, std::vector<QString> &keys)
102  const;
103  DbProfile ResolveKeys(const QString &base, const HiCalConf &conf,
104  const DbProfile &prof) const;
105  QString ParsedKey(const QString &key, const HiCalConf &conf,
106  const DbProfile &prof) const;
107  QString makeKey(const QString &ksuffix = "") const;
108  QString getValue(const QString &ksuffix = "") const;
109  HiMatrix extract (const CSVReader &csv);
110  int getAxisIndex(const QString &name,
111  const CSVReader::CSVAxis &header) const;
112 
113  };
114 
115 } // namespace Isis
116 #endif
117 
A DbProfile is a container for access parameters to a database.
Definition: DbProfile.h:65
virtual ~LoadCSV()
Destructor.
Definition: LoadCSV.h:75
Parser::TokenList CSVAxis
Row/Column token list.
Definition: CSVReader.h:263
Reads strings and parses them into tokens separated by a delimiter character.
Definition: CSVReader.h:255
Provides generalized access to HiRISE calibration CSV files.
Definition: LoadCSV.h:66
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
TNT::Array2D< double > HiMatrix
2-D buffer
Definition: HiCalTypes.h:41
TNT::Array1D< double > HiVector
1-D Buffer
Definition: HiCalTypes.h:40