Loading...
Searching...
No Matches
ClutterOp.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#ifndef ClutterMapOP_H_
32#define ClutterMapOP_H_
33
34#include <andre/DetectorOp.h>
35#include "data/Data.h"
36#include "data/DataSelector.h"
37#include <hi5/Hi5.h>
38#include <drain/util/ReferenceMap.h>
39#include <string>
40
41using namespace drain::image;
42
43namespace rack {
44
46
55class ClutterOp: public DetectorOp {
56
57public:
58
60
68 inline
69 ClutterOp(double decay=0.5, double gamma=1.0, const std::string & quantity ="CLUTTER", const std::string & file = "cluttermaps/cluttermap-${NOD}-${quantity}.h5") :
70 DetectorOp(__FUNCTION__, "Reads a ground clutter map and scales it to sweeps.", "nonmet.clutter.ground"){ // Optional postprocessing: morphological closing.
71 // dataSelector.path = ". */da ta[0-9]+/?$";
73 UNIVERSAL = true;
74
75 dataSelector.setQuantities(""); // or FREQ?
76 // dataSelector.setMaxCount(1);
77
78 parameters.link("decay", this->decay = decay, "per 1000m");
79 parameters.link("gamma", this->gamma = gamma, "brightness");
80 parameters.link("quantity", this->quantity = quantity, "CLUTTER|OBSTACLE|...");
81 parameters.link("file", this->file = file, "path syntax");
82 // parameters.link("pathSyntax", this->pathSyntax = pathSyntax);
83 // parameters.link("filename", this->filename, filename);
84 };
85
86
87 double decay;
88 double gamma;
89 std::string quantity;
90 std::string file;
91
93 void setClutterMap(const std::string & filename) const;
94
95 // Dev trial
96 const Hi5Tree & getClutterMap(const PolarODIM & odim) const;
97
98
99 virtual
100 void runDetection(const DataSet<PolarSrc> & src, PlainData<PolarDst> & dst, DataSet<PolarDst> & aux) const;
101
102protected:
103
104 mutable Hi5Tree clutterMap;
105
106
107
108
109
110};
111
112
113}
114
115#endif
116
117// Rack
Based on pre-computed clutter map, scales the clutter probability for desired sweeps.
Definition ClutterOp.h:55
ClutterOp(double decay=0.5, double gamma=1.0, const std::string &quantity="CLUTTER", const std::string &file="cluttermaps/cluttermap-${NOD}-${quantity}.h5")
Default constructor.
Definition ClutterOp.h:69
virtual void runDetection(const DataSet< PolarSrc > &src, PlainData< PolarDst > &dst, DataSet< PolarDst > &aux) const
Process as sweep (data in one elevation angle)
Definition ClutterOp.cpp:116
void setClutterMap(const std::string &filename) const
Loads a clutter map.
Definition ClutterOp.cpp:54
void setQuantities(const std::string &s)
Sets basic quantities and quality quantities. These sets are separated by '/'.
Definition DataSelector.cpp:282
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition Data.h:1215
Base class for anomaly detectors.
Definition DetectorOp.h:49
bool REQUIRE_STANDARD_DATA
Set to true if operator expects fixed background intensities instead of "nodata" defined by the Polar...
Definition DetectorOp.h:216
bool UNIVERSAL
If true, applies also to quantities str than the one used in detection. The detection and the accumul...
Definition DetectorOp.h:181
Essential class for storing radar data.
Definition Data.h:300
Metadata structure for single-radar data (polar scans, volumes and products).
Definition PolarODIM.h:45
MD odim
The default data parameters for encoding output (the product).
Definition RadarProductOp.h:101
Namespace for images and image processing tools.
Definition AccumulationArray.cpp:45
Definition DataSelector.cpp:44