TestOp.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 #ifndef ANDRE_TEST_OP_H_
32 #define ANDRE_TEST_OP_H_
33 
34 // #include "RemoverOp.h"
35 #include "DetectorOp.h"
36 
37 using namespace drain::image;
38 
39 namespace rack {
40 
44 class TestOp: public DetectorOp {
45 
46 public:
47 
49 
54  inline
55  TestOp(double value=0.0, double prob=1.0) :
56  DetectorOp(__FUNCTION__, "Create rectangular fake anomaly (value) and 'detect' it with desired probability (prob).", "nonmet.clutter"){
57  //RemoverOp(__FUNCTION__, "Create rectangular fake anomaly (value) and 'detect' it with desired probability (prob)."){ // Optional postprocessing: morphological closing.
58 
59  dataSelector.setQuantities("^DBZH$");
60  REQUIRE_STANDARD_DATA = false;
61  UNIVERSAL = true;
62 
63  parameters.link("value", this->value = value, "value");
64  parameters.link("prob", this->prob = prob, "prob");
65 
66  parameters.link("i", this->iRange.tuple() = {200,230}, "coord range"); // ~500m
67  parameters.link("j", this->jRange.tuple() = {240,300}, "coord range"); // deg
68 
69  // TODO: classEntry.code (final code derived from numeric or (partial) string)
70  // parameters.link("code", this->code = "clutter.test", "class code"); // deg
71 
72  };
73 
74  double value;
75  double prob;
76  drain::Range<int> iRange;
77  drain::Range<int> jRange;
78 
79 
80  void runDetection(const DataSet<PolarSrc> & srcDataSet, PlainData<PolarDst> & dstProb, DataSet<PolarDst> & cache) const;
81 
82 protected:
83 
84  /*
85  virtual
86  void runDetector(const PlainData<PolarSrc> & srcData, const PlainData<PolarSrc> & srcQuality,
87  PlainData<PolarDst> & dstData, PlainData<PolarDst> & dstProb) const;
88  */
90  // virtual void processDataSet(const DataSet<PolarSrc> & src, PlainData<PolarDst> & dst, DataSet<PolarDst> & aux) const; // DataSetDst & dst) const;
91 
92 };
93 
94 
95 }
96 
97 #endif
98 // Rack
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition: Data.h:1213
Base class for anomaly detectors.
Definition: DetectorOp.h:49
Essential class for storing radar data.
Definition: Data.h:302
Definition: TestOp.h:44
TestOp(double value=0.0, double prob=1.0)
Create rectangular fake anomaly (value) and 'detect' it with desired probability (prob)
Definition: TestOp.h:55
Namespace for images and image processing tools.
Definition: AccumulationArray.cpp:45
Definition: DataSelector.cpp:44