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/image/ImageFile.h>
36#include <drain/util/Functor.h>
37
38#include "product/PolarProductOp.h" // why
39#include "AndreOp.h"
40
41
42
43using namespace drain::image;
44
45namespace rack {
46
49
50public:
51
52 DataMarker() : drain::UnaryFunctor(__FUNCTION__), value(0.5) {
53
54 }
55
56 inline
57 void set(double value){
58 this->value = value;
59 //this->update();
60 }
61
62
63 inline
64 double operator()(double x) const {
65 return value;
66 }
67
68 double value;
69
70};
71
73/*
74class DefaultOp: public PolarProductOp { // VolumeOp<PolarODIM>
75
76public:
77
78 DefaultOp() :
79 PolarProductOp(__FUNCTION__,"Combines detection probabilities to overall quality field QIND (and CLASS).") // VolumeOp<PolarODIM>
80 {
81
82 }
83
84
85}
86*/
87
89class QualityCombinerOp: public AndreOp { // PolarProductOp {
90
91public:
92
94 //PolarProductOp(__FUNCTION__,"Combines detection probabilities to overall quality field QIND (and CLASS).") // VolumeOp<PolarODIM>
95 AndreOp(__FUNCTION__,"Combines detection probabilities to overall quality field QIND (and CLASS).") // VolumeOp<PolarODIM>
96 {
97 // dataSelector.path = "/da ta[0-9]+$";
98 //dataSelector.setQuantityRegExp("^DBZH$");
99 dataSelector.setQuantities("DBZH:DBZ");
100
102 }
103
104 inline
106
108 static
109 void updateOverallQuality(const PlainData<PolarSrc> & srcQind, const PlainData<PolarSrc> & srcClass, PlainData<PolarDst> & dstQind, PlainData<PolarDst> & dstClass); // const;
110
112
118 static
119 void updateOverallDetection(const drain::image::ImageFrame & srcProb, PlainData<PolarDst> & dstQind, PlainData<PolarDst> & dstClass, const std::string &label, unsigned short index); // const;
120 //void updateOverallDetection(const PlainData<PolarSrc> & srcProb, PlainData<PolarDst> & dstQind, PlainData<PolarDst> & dstClass, const std::string &label, unsigned short index); // const;
121
122 /*
123 static
124 void updateOverallDetection(const drain::image::ImageFrame & srcProb, drain::image::ImageFrame & dstQind, drain::image::ImageFrame & dstClass,
125 const std::string &label, unsigned short index); // const;
126 */
127
128
130 static
131 void updateLocalQuality(const DataSet<PolarSrc> & srcDataSet, Data<PolarDst> & dstData);
132
134 //static double DEFAULT_QUALITY;
135
136
140 static
141 //void initDstQuality(const PlainData<PolarSrc> & srcData, PlainData<PolarDst> & dstQuality, const std::string & quantity = "");
142 void initDstQuality(const PolarODIM & srcODIM, PlainData<PolarDst> & dstQuality, const std::string & quantity);
143
144protected:
145
146
147 virtual
148 void processDataSet(const DataSet<PolarSrc> & srcSweep, DataSet<PolarDst> & dstProduct) const;
149
150
151};
152
153} // rack::
154
155#endif
virtual void clear()
Removes all the elements of the map.
Definition ReferenceMap.h:374
Image with static geometry.
Definition ImageFrame.h:67
The base class for detector and removal operators.
Definition AndreOp.h:55
Simple class marking true data with a given constant value, typically a CLASS label.
Definition QualityCombinerOp.h:48
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
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
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:205
A quick QualityCombiner .
Definition QualityCombinerOp.h:89
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:125
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:64
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:403
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:239
virtual void processDataSet(const DataSet< PolarSrc > &srcSweep, DataSet< PolarDst > &dstProduct) const
Definition QualityCombinerOp.cpp:466
Namespace for images and image processing tools.
Definition AccumulationArray.cpp:45
Definition DataSelector.cpp:44
Definition Functor.h:116