7 #ifndef SPARROW_SPECTRUM_H
8 #define SPARROW_SPECTRUM_H
14 namespace RealTimeSpectroscopy {
17 const char* what()
const noexcept
final {
18 return "Incorrect number of data points in spectrum assignment.";
38 Spectrum(
const Eigen::VectorXd& xData,
const Eigen::VectorXd& yData) {
39 if (xData.size() != yData.size())
44 Spectrum(
const Eigen::VectorXd& xData,
const Eigen::VectorXd& yData, std::pair<std::string, std::string> labels)
46 labels_ = std::move(labels);
84 const std::pair<std::string, std::string>& getLabels()
const {
92 if (xData.size() != xData_.size())
102 if (yData.size() != yData_.size())
111 labels_.first = std::move(xLabel);
117 labels_.second = std::move(yLabel);
121 Eigen::VectorXd xData_;
122 Eigen::VectorXd yData_;
123 std::pair<std::string, std::string> labels_;
130 #endif // SPARROW_SPECTRUM_H
double getYData(int point) const
Gets the y data points in the spectrum.
Definition: Spectrum.h:80
const Eigen::VectorXd & getYData() const
Gets the y data points in the spectrum.
Definition: Spectrum.h:66
Spectrum(int size)
Constructor initializing the number of data points in the spectrum.
Definition: Spectrum.h:28
void setXLabel(std::string xLabel)
Changes the label of the x axis.
Definition: Spectrum.h:110
void setYLabel(std::string yLabel)
Changes the label of the y axis.
Definition: Spectrum.h:116
void setYData(const Eigen::VectorXd &yData)
Changes the y data points in the spectrum.
Definition: Spectrum.h:101
void setXData(const Eigen::VectorXd &xData)
Changes the x data points in the spectrum.
Definition: Spectrum.h:91
int size() const
Getter for the number of (x,y) points in the spectrum.
Definition: Spectrum.h:52
Spectrum(const Eigen::VectorXd &xData, const Eigen::VectorXd &yData)
Constructor initializing the x and y points.
Definition: Spectrum.h:38
Definition: Spectrum.h:16
const Eigen::VectorXd & getXData() const
Gets the x data points in the spectrum.
Definition: Spectrum.h:59
double getXData(int point) const
Gets the x data points in the spectrum.
Definition: Spectrum.h:73
Definition: Spectrum.h:22