NAPISD
PAHdb website C++ backend
Loading...
Searching...
No Matches
SpectralFitter.h
1#ifndef SPECTRALFITTER_H_
2#define SPECTRALFITTER_H_
3
4#include "Exception.h"
5#include "NNLS.h"
6#include <iostream>
7#include <vector>
8
10
11public:
12 SpectralFitter() = default;
13
14 SpectralFitter(std::vector<double> &spectrum,
15 std::vector<std::vector<double>> &pool);
16
17 void setSpectrum(std::vector<double> &spectrum);
18
19 void setUncertainties(std::vector<double> &uncertainties);
20
21 void setPool(std::vector<std::vector<double>> &pool);
22
23 void fitSpectrum();
24
25 const std::vector<double> &getWeights() const;
26
27 const std::vector<unsigned int> &getNonZeroIndices();
28
29 const double &getNorm() const;
30
31private:
32 std::vector<double> _spectrum;
33
34 std::vector<double> _uncertainties;
35
36 std::vector<std::vector<double>> _pool;
37
38 std::vector<double> _weights;
39
40 std::vector<unsigned int> _indices;
41
42 double _norm;
43};
44
45inline void SpectralFitter::setSpectrum(std::vector<double> &spectrum) {
46
47 _spectrum = spectrum;
48}
49
50inline void
51SpectralFitter::setUncertainties(std::vector<double> &uncertainties) {
52
53 _uncertainties = uncertainties;
54}
55
56inline void SpectralFitter::setPool(std::vector<std::vector<double>> &pool) {
57
58 _pool = pool;
59}
60
61inline const std::vector<double> &SpectralFitter::getWeights() const {
62
63 return _weights;
64}
65
66inline const double &SpectralFitter::getNorm() const { return _norm; }
67
68#endif /* SPECTRALFITTER_H_ */

Since FY2019 the NASA Ames PAH IR Spectroscopic Database is being supported through a directed Work Package at NASA Ames titled: "Laboratory Astrophysics - The NASA Ames PAH IR Spectroscopic Database".
Since FY2023 the NASA Ames PAH IR Spectroscopic Database is being supported through the Laboratory Astrophysics Rd 2 directed Work Package at NASA Ames.
© Copyright 2021-2025, Christiaan Boersma