Loading...
Searching...
No Matches
QualityCombinerOp.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 QualityCombiner_SEGMENT_OP_H_
33#define QualityCombiner_SEGMENT_OP_H_
34
35#include <drain/util/Functor.h>
36
37#include "AndreOp.h"
38
39
40
41using namespace drain::image;
42
43namespace rack {
44
47
48public:
49
50 DataMarker() : drain::UnaryFunctor(__FUNCTION__), value(0.5) {
51
52 }
53
54 inline
55 void set(double value){
56 this->value = value;
57 //this->update();
58 }
59
60
61 inline
62 double operator()(double x) const {
63 return value;
64 }
65
66 double value;
67
68};
69
71/*
72class DefaultOp: public PolarProductOp { // VolumeOp<PolarODIM>
73
74public:
75
76 DefaultOp() :
77 PolarProductOp(__FUNCTION__,"Combines detection probabilities to overall quality field QIND (and CLASS).") // VolumeOp<PolarODIM>
78 {
79
80 }
81
82
83}
84*/
85
87class QualityCombinerOp: public AndreOp { // PolarProductOp {
88
89public:
90
92 //PolarProductOp(__FUNCTION__,"Combines detection probabilities to overall quality field QIND (and CLASS).") // VolumeOp<PolarODIM>
93 AndreOp(__FUNCTION__,"Combines detection probabilities to overall quality field QIND (and CLASS).") // VolumeOp<PolarODIM>
94 {
95 // dataSelector.path = "/da ta[0-9]+$";
96 //dataSelector.setQuantityRegExp("^DBZH$");
97 dataSelector.setQuantities("DBZH:DBZ");
98
100 }
101
102 inline
104
106 static
107 void updateOverallQuality(const PlainData<PolarSrc> & srcQind, const PlainData<PolarSrc> & srcClass, PlainData<PolarDst> & dstQind, PlainData<PolarDst> & dstClass); // const;
108
110
116 static
117 void updateOverallDetection(const drain::image::ImageFrame & srcProb, PlainData<PolarDst> & dstQind, PlainData<PolarDst> & dstClass, const std::string &label, unsigned short index); // const;
118 //void updateOverallDetection(const PlainData<PolarSrc> & srcProb, PlainData<PolarDst> & dstQind, PlainData<PolarDst> & dstClass, const std::string &label, unsigned short index); // const;
119
120 /*
121 static
122 void updateOverallDetection(const drain::image::ImageFrame & srcProb, drain::image::ImageFrame & dstQind, drain::image::ImageFrame & dstClass,
123 const std::string &label, unsigned short index); // const;
124 */
125
126
128 static
129 void updateLocalQuality(const DataSet<PolarSrc> & srcDataSet, Data<PolarDst> & dstData);
130
132 //static double DEFAULT_QUALITY;
133
134
138 static
139 //void initDstQuality(const PlainData<PolarSrc> & srcData, PlainData<PolarDst> & dstQuality, const std::string & quantity = "");
140 void initDstQuality(const PolarODIM & srcODIM, PlainData<PolarDst> & dstQuality, const std::string & quantity);
141
142protected:
143
144
145 virtual
146 void processDataSet(const DataSet<PolarSrc> & srcSweep, DataSet<PolarDst> & dstProduct) const;
147
148
149};
150
151} // rack::
152
153#endif
virtual void clear()
Removes all the elements of the map.
Definition ReferenceMap.h:390
Image with static geometry.
Definition ImageFrame.h:62
The base class for detector and removal operators.
Definition AndreOp.h:53
Simple class marking true data with a given constant value, typically a CLASS label.
Definition QualityCombinerOp.h:46
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:1275
Data structure consisting of plain data and an optional quality data.
Definition Data.h:1206
Essential class for storing radar data.
Definition Data.h:311
Metadata structure for single-radar data (polar scans, volumes and products).
Definition PolarODIM.h:45
drain::ReferenceMap allowedEncoding
Defines which encoding parameters can be changed by the user from command line.
Definition ProductBase.h:206
A quick QualityCombiner .
Definition QualityCombinerOp.h:87
static void updateOverallDetection(const drain::image::ImageFrame &srcProb, PlainData< PolarDst > &dstQind, PlainData< PolarDst > &dstClass, const std::string &label, unsigned short index)
Given probability data with class label, updates (?overall?) QIND.
Definition QualityCombinerOp.cpp:121
static void initDstQuality(const PolarODIM &srcODIM, PlainData< PolarDst > &dstQuality, const std::string &quantity)
Quality index value (0.5 by default) under which CLASS information is updated. Otherwise class is "me...
Definition QualityCombinerOp.cpp:60
static void updateLocalQuality(const DataSet< PolarSrc > &srcDataSet, Data< PolarDst > &dstData)
Updates QIND and QCLASS from global level (dataset) to local level (data). Conditional; checks if alr...
Definition QualityCombinerOp.cpp:404
static void updateOverallQuality(const PlainData< PolarSrc > &srcQind, const PlainData< PolarSrc > &srcClass, PlainData< PolarDst > &dstQind, PlainData< PolarDst > &dstClass)
Updates quality specific QIND and CLASS to dataset level. Conditional; checks if already done.
Definition QualityCombinerOp.cpp:236
virtual void processDataSet(const DataSet< PolarSrc > &srcSweep, DataSet< PolarDst > &dstProduct) const
Definition QualityCombinerOp.cpp:485
Namespace for images and image processing tools.
Definition AccumulationArray.cpp:45
Definition DataSelector.cpp:44
Definition Functor.h:116