28 lines
872 B
C++
28 lines
872 B
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#include "XrayFluorescenceSpectrum.h"
|
|
|
|
#include "JFJochException.h"
|
|
|
|
XrayFluorescenceSpectrum::XrayFluorescenceSpectrum(const std::vector<float> &energy_eV, const std::vector<float> &data) {
|
|
if (energy_eV.size() != data.size()) {
|
|
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
|
"Mismatch between # of energies and data points for fluorescence spectrum");
|
|
}
|
|
this->energy_eV = energy_eV;
|
|
this->data = data;
|
|
}
|
|
|
|
const std::vector<float> & XrayFluorescenceSpectrum::GetEnergy_eV() const {
|
|
return energy_eV;
|
|
}
|
|
|
|
const std::vector<float> & XrayFluorescenceSpectrum::GetData() const {
|
|
return data;
|
|
}
|
|
|
|
bool XrayFluorescenceSpectrum::empty() const {
|
|
return data.empty();
|
|
}
|