Select Git revision
eisnoise.h
eisnoise.h 1015 B
#pragma once
#include <eisgenerator/eistype.h>
#include <vector>
#include <exception>
#include <string>
class EisNoise
{
private:
struct Noise
{
std::string name;
fvalue omegaMax;
fvalue omegaMin;
eis::EisSpectra spectra;
};
std::vector<Noise> noises;
static void addImpl(std::vector<eis::DataPoint>& spectra, const Noise& noise, fvalue intensity, bool ignFreq);
fvalue calcMaxIntensity(std::vector<eis::DataPoint>& spectra);
public:
class apply_err: public std::exception
{
std::string whatStr;
public:
apply_err(const std::string& whatIn): whatStr(whatIn)
{}
virtual const char* what() const noexcept override
{
return whatStr.c_str();
}
};
EisNoise(fvalue maxIntensity = -1);
~EisNoise() = default;
void add(std::vector<eis::DataPoint>& spectra, fvalue intensity = 1.0, bool ignFreq = false);
void addSpecific(std::vector<eis::DataPoint>& spectra, const std::string& name , fvalue intensity = 1.0, bool ignFreq = false);
std::vector<std::string> getAvailable();
};