Isis Developer Reference
LoadCSV.h
Go to the documentation of this file.
1#ifndef LoadCSV_h
2#define LoadCSV_h
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include <cmath>
13#include <string>
14#include <vector>
15
16#include "IString.h"
17#include "HiCalTypes.h"
18#include "HiCalUtil.h"
19#include "HiCalConf.h"
20#include "CSVReader.h"
21
22namespace Isis {
23
24 class iException;
25
52 class LoadCSV {
53
54 public:
55 // Constructors and Destructor
56 LoadCSV();
57 LoadCSV(const QString &base, const HiCalConf &conf,
58 const DbProfile &profile);
59
61 virtual ~LoadCSV() { }
62
63 void load(const QString &base, const HiCalConf &conf,
64 const DbProfile &profile);
65
66 QString filename() const;
67 int size() const;
68
69 bool validateSize(const int &expected,
70 const bool &throw_on_error = false)
71 const;
72
73 HiVector getVector() const;
74 HiMatrix getMatrix() const;
75
76 void History(HiHistory &history) const;
77
78 private:
79 QString _base;
80 DbProfile _csvSpecs;
81 HiMatrix _data;
82 std::vector<QString> _history;
83
84 void init(const QString &base, const HiCalConf &conf,
85 const DbProfile &profile);
86 void addHistory(const QString &element, const QString &desc);
87 void getKeyList(const QString &base, std::vector<QString> &keys)
88 const;
89 DbProfile ResolveKeys(const QString &base, const HiCalConf &conf,
90 const DbProfile &prof) const;
91 QString ParsedKey(const QString &key, const HiCalConf &conf,
92 const DbProfile &prof) const;
93 QString makeKey(const QString &ksuffix = "") const;
94 QString getValue(const QString &ksuffix = "") const;
95 HiMatrix extract (const CSVReader &csv);
96 int getAxisIndex(const QString &name,
97 const CSVReader::CSVAxis &header) const;
98
99 };
100
101} // namespace Isis
102#endif
Reads strings and parses them into tokens separated by a delimiter character.
Definition CSVReader.h:239
Parser::TokenList CSVAxis
Row/Column token list.
Definition CSVReader.h:247
A DbProfile is a container for access parameters to a database.
Definition DbProfile.h:51
Definition HiCalTypes.h:30
Provides generalized access to HiRISE calibration CSV files.
Definition LoadCSV.h:52
QString filename() const
Definition LoadCSV.cpp:176
virtual ~LoadCSV()
Destructor.
Definition LoadCSV.h:61
int size() const
Definition LoadCSV.cpp:180
LoadCSV()
Definition LoadCSV.cpp:24
bool validateSize(const int &expected, const bool &throw_on_error=false) const
Definition LoadCSV.cpp:184
HiMatrix getMatrix() const
Definition LoadCSV.cpp:201
void load(const QString &base, const HiCalConf &conf, const DbProfile &profile)
Definition LoadCSV.cpp:32
void History(HiHistory &history) const
Definition LoadCSV.cpp:206
HiVector getVector() const
Definition LoadCSV.cpp:196
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
TNT::Array2D< double > HiMatrix
2-D buffer
Definition HiCalTypes.h:28
TNT::Array1D< double > HiVector
1-D Buffer
Definition HiCalTypes.h:27