Loading...
Searching...
No Matches
RemoverOp.h
1/*
2
3MIT License
4
5Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26/*
27Part of Rack development has been done in the BALTRAD projects part-financed
28by the European Union (European Regional Development Fund and European
29Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30*/
31
32#ifndef RACK_RemoverOP_H_
33#define RACK_RemoverOP_H_
34
35
36#include <drain/image/ImageFile.h>
37#include <drain/util/Fuzzy.h>
38#include <drain/image/Intensity.h>
39#include "hi5/Hi5.h"
40#include "data/Data.h"
41#include "AndreOp.h"
42
43using namespace drain::image;
44
45namespace rack {
46
48
53class RemoverOp: public AndreOp {
54
55public:
56
60 inline
61 RemoverOp(double threshold = 0.5): AndreOp("Remover", "Simple anomaly removal operator."){
62 parameters.link("threshold", this->threshold = threshold, "probability");
63 parameters.link("replace", this->replace = "nodata", "nodata|undetect|<physical_value>");
64 parameters.link("clearQuality", this->clearQuality = true);
65 // dataSelector.path = ".*da ta[0-9]+/?$";
66 dataSelector.setQuantities("^DBZH$"); //|TV|VRAD|RHOHV|LDR|PHIDP|KDP";
67 };
68
70 virtual
71 void processDataSets(const DataSetMap<PolarSrc> & srcVolume, DataSetMap<PolarDst> & dstVolume) const;
72
74
79 virtual
80 void processDataSet(const DataSet<PolarSrc> & srcDataSet, DataSet<PolarDst> & dstDataSet) const;
81
82 //Practically, qualityRoot == dstDataRoot
83 // void filterGroup(const Hi5Tree &qualityRoot, const std::string &path, Hi5Tree &dstDataRoot) const;
84
86
90 //
91 virtual
92 void processData(const Data<PolarSrc> & srcData, Data<PolarDst> & dstData) const;
93
94 virtual
95 void processData(const PlainData<PolarSrc> & srcData, const PlainData<PolarSrc> & srcQuality,
96 PlainData<PolarDst> & dstData, PlainData<PolarDst> & dstQIND) const;
97
98
99protected:
100
103 RemoverOp(const std::string &name, const std::string & description) :
104 AndreOp(name, description), threshold(0.5), clearQuality(false){
105 dataSelector.setQuantities("^[A-Z_]+");
106 };
107
108private:
109
110 double threshold;
111 std::string replace;
112 bool clearQuality;
113
114};
115
116
117}
118
119#endif /* CorrectoROP_H_ */
120
121// Rack
The base class for detector and removal operators.
Definition AndreOp.h:55
void setQuantities(const std::string &s)
Sets basic quantities and quality quantities. These sets are separated by '/'.
Definition DataSelector.cpp:282
Definition Data.h:1370
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition Data.h:1215
Data structure consisting of plain data and an optional quality data.
Definition Data.h:1146
Essential class for storing radar data.
Definition Data.h:300
The simplest possible anomaly removal operator and the base class for more complex ones.
Definition RemoverOp.h:53
virtual void processDataSets(const DataSetMap< PolarSrc > &srcVolume, DataSetMap< PolarDst > &dstVolume) const
NEW POLICY => DetectorOpNEW.
Definition RemoverOp.cpp:48
virtual void processData(const Data< PolarSrc > &srcData, Data< PolarDst > &dstData) const
Cleaning a the data array of one quantity (measurement parameter). Called by processDataSet.
Definition RemoverOp.cpp:131
RemoverOp(double threshold=0.5)
Definition RemoverOp.h:61
virtual void processDataSet(const DataSet< PolarSrc > &srcDataSet, DataSet< PolarDst > &dstDataSet) const
Process as sweep (data in one elevation angle)
Definition RemoverOp.cpp:78
RemoverOp(const std::string &name, const std::string &description)
Definition RemoverOp.h:103
Namespace for images and image processing tools.
Definition AccumulationArray.cpp:45
Definition DataSelector.cpp:44