79 nr_windows(nr_windows_),
81 window_length(win_len_),
82 result_windows_even(nr_windows_),
83 result_windows_odd(nr_windows_+1)
97 return std::max(1.0, (get_noise_even(mz)+get_noise_odd(mz))/2.0 );
103 int window_nr = (int)((mz - mz_start)/window_length);
104 assert(window_nr >= 0);
105 assert(window_nr < (
int)result_windows_even.size());
107 double noise = result_windows_even[window_nr];
114 int window_nr = (int)((mz - mz_start + window_length/2.0)/window_length);
115 assert(window_nr >= 0);
116 assert(window_nr < (
int)result_windows_odd.size());
118 double noise = result_windows_odd[window_nr];
125 window_length_(window_length)
135 return estimateNoise(spectrum->getMZArray()->data, spectrum->getIntensityArray()->data);
144 return estimateNoise(chrom->getTimeArray()->data, chrom->getIntensityArray()->data);
154 assert(mz_array.size() == int_array.size());
155 assert(mz_array.size() > 2);
157 int nr_windows = (int)((mz_array[mz_array.size()-1] - mz_array[0])/window_length_) + 1;
163 computeNoiseInWindows_(mz_array, int_array, eval.
result_windows_odd, mz_array[0] - window_length_/2.0);
175 void computeNoiseInWindows_(
const std::vector<double>& mz_array, std::vector<double> int_array, std::vector<double> & result,
double mz_start);
183 double computeMedian_(std::vector<double>::iterator & first, std::vector<double>::iterator & last);
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:130
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:210
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19