libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::FilterHighPassPercentage Class Reference

remove datapoints below a given intensity percentage (ratio) of the maximum intensity More...

#include <filterpass.h>

Inheritance diagram for pappso::FilterHighPassPercentage:
pappso::FilterInterface

Public Member Functions

 FilterHighPassPercentage (double y_ratio)
 
 FilterHighPassPercentage (const FilterHighPassPercentage &other)
 
virtual ~FilterHighPassPercentage ()
 
FilterHighPassPercentageoperator= (const FilterHighPassPercentage &other)
 
Tracefilter (Trace &data_points) const override
 
- Public Member Functions inherited from pappso::FilterInterface
virtual ~FilterInterface ()
 

Private Attributes

double m_ratioPassY = 0
 

Detailed Description

remove datapoints below a given intensity percentage (ratio) of the maximum intensity

Definition at line 75 of file filterpass.h.

Constructor & Destructor Documentation

◆ FilterHighPassPercentage() [1/2]

FilterHighPassPercentage::FilterHighPassPercentage ( double y_ratio)

Definition at line 106 of file filterpass.cpp.

107 : m_ratioPassY(ratio_pass_y)
108{
109}

◆ FilterHighPassPercentage() [2/2]

FilterHighPassPercentage::FilterHighPassPercentage ( const FilterHighPassPercentage & other)

Definition at line 111 of file filterpass.cpp.

114{
115}

◆ ~FilterHighPassPercentage()

virtual pappso::FilterHighPassPercentage::~FilterHighPassPercentage ( )
inlinevirtual

Definition at line 81 of file filterpass.h.

81{};

Member Function Documentation

◆ filter()

Trace & FilterHighPassPercentage::filter ( Trace & data_points) const
overridevirtual

Implements pappso::FilterInterface.

Definition at line 127 of file filterpass.cpp.

128{
129 auto it_max = maxYDataPoint(data_points.begin(), data_points.end());
130 if(it_max == data_points.end())
131 return data_points;
132 double pass = (it_max->y * m_ratioPassY);
133 Trace new_data_points;
134 for(auto &&data_point : data_points)
135 {
136 if(data_point.y > pass)
137 {
138 new_data_points.push_back(data_point);
139 }
140 }
141 data_points = std::move(new_data_points);
142 return data_points;
143}
A simple container of DataPoint instances.
Definition trace.h:148
std::vector< DataPoint >::const_iterator maxYDataPoint(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
Definition trace.cpp:180

References m_ratioPassY, and pappso::maxYDataPoint().

◆ operator=()

FilterHighPassPercentage & FilterHighPassPercentage::operator= ( const FilterHighPassPercentage & other)

Definition at line 118 of file filterpass.cpp.

119{
121
122 return *this;
123}

References m_ratioPassY.

Member Data Documentation

◆ m_ratioPassY

double pappso::FilterHighPassPercentage::m_ratioPassY = 0
private

Definition at line 89 of file filterpass.h.

Referenced by filter(), and operator=().


The documentation for this class was generated from the following files: