DamperOp.h
1 /*
2 
3 MIT License
4 
5 Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 
14 The above copyright notice and this permission notice shall be included in all
15 copies or substantial portions of the Software.
16 
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 SOFTWARE.
24 
25 */
26 /*
27 Part of Rack development has been done in the BALTRAD projects part-financed
28 by the European Union (European Regional Development Fund and European
29 Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30 */
31 /*
32  * DamperOp.h
33  *
34  * Created on: Aug 7, 2011
35  * Author: mpeura
36  */
37 
38 #ifndef DamperOP_H_
39 #define DamperOP_H_
40 
41 #include <drain/image/ImageFile.h>
42 #include <limits>
43 
44 #include "drain/util/Fuzzy.h"
45 #include "drain/image/Intensity.h"
46 #include "hi5/Hi5.h"
47 #include "radar/Geometry.h"
48 
49 #include "RemoverOp.h"
50 
51 using namespace drain::image;
52 
53 namespace rack {
54 
59 class DamperOp: public RemoverOp {
60 
61 public:
62 
68  //DamperOp(double threshold=0.5, double undetectThreshold=0.1, double minVal = -std::numeric_limits<double>::max()) : // double slope=0.0,
69  DamperOp(double threshold=0.5, double undetectThreshold=0.1, double minValue = NAN) : // double slope=0.0,
70  RemoverOp(__FUNCTION__,"Removes anomalies with fuzzy deletion operator."){
71 
72  dataSelector.setQuantities("^DBZH$");
73 
74  parameters.link("threshold", this->threshold = threshold);
75  parameters.link("undetectThreshold", this->undetectThreshold = undetectThreshold);
76  parameters.link("minValue", this->minValue = minValue);
77 
78  };
79 
80 
81  double threshold;
82  double undetectThreshold;
83  double minValue;
84 
85 protected:
86 
87 
88  // Main method. Like RemoverOp. remains dstQuality intact.
94  void processData(const PlainData<PolarSrc> & srcData, const PlainData<PolarSrc> & srcQuality,
95  PlainData<PolarDst> & dstData, PlainData<PolarDst> & dstQuality) const;
96 
97 
98 };
99 
100 
101 }
102 
103 #endif /* ERASEROP_H_ */
104 
105 // Rack
Definition: DamperOp.h:59
DamperOp(double threshold=0.5, double undetectThreshold=0.1, double minValue=NAN)
Definition: DamperOp.h:69
Essential class for storing radar data.
Definition: Data.h:302
The simplest possible anomaly removal operator and the base class for more complex ones.
Definition: RemoverOp.h:53
Namespace for images and image processing tools.
Definition: AccumulationArray.cpp:45
Definition: DataSelector.cpp:44