31 #ifndef RACK_ANALYSIS_DOPPLER_H
32 #define RACK_ANALYSIS_DOPPLER_H
34 #include <drain/Log.h>
37 #include "drain/util/Fuzzy.h"
41 #include "drain/util/Functor.h"
42 #include "drain/util/FunctorBank.h"
44 #include "drain/image/Window.h"
45 #include "drain/image/SlidingWindow.h"
49 #include "RadarWindows.h"
70 sumI(0.0), sumI2(0.0), sumJ(0.0), sumJ2(0.0), count(0){};
104 this->setImageLimits();
105 this->setLoopLimits();
106 this->setRangeNorm();
109 this->NI = this->odimSrc.getNyquist(LOG_WARNING);
110 if (this->NI == 0.0){
112 mout.
error(
"Could not derive Nyquist velocity (NI) from metadata." );
113 radialSpeedConv = 1.0;
114 radialSpeedConvInv = 1.0;
117 radialSpeedConv = M_PI / this->NI;
118 radialSpeedConvInv = this->NI / M_PI;
139 x *= radialSpeedConv;
152 x *= radialSpeedConv;
168 return atan2(sumJ, sumI);
177 double c = 1.0/
static_cast<double>(count);
178 return ::sqrt((sumI2+sumJ2 - (sumI*sumI+sumJ*sumJ)*c)*c);
190 return ::sqrt(sumI*sumI + sumJ*sumJ) /
static_cast<double>(count);
214 if (count > countMin){
217 this->dst.putScaled(this->location.x, this->location.y, averageR() * M_1_PI);
219 this->dst.putScaled(this->location.x, this->location.y, averageR() * this->radialSpeedConvInv);
231 this->dst.put(this->location, this->odimSrc.undetect);
256 double confidence = this->myFunctor(this->eccentricity());
258 if (count > countMin){
261 this->dst.putScaled(this->location.x, this->location.y, averageR() * M_1_PI);
263 this->dst.putScaled(this->location.x, this->location.y, averageR() * this->radialSpeedConvInv);
265 this->dstWeight.putScaled(this->location.x, this->location.y, confidence);
271 this->dst.put(this->location, this->odimSrc.undetect);
272 this->dstWeight.put(this->location, 0.0);
295 if (count > countMin){
298 this->dst.putScaled(this->location.x, this->location.y, this->myFunctor(stdDevR()));
302 this->dst.putScaled(this->location.x, this->location.y, this->myFunctor(NI * stdDevR()) );
342 if (count > countMin){
343 this->dst.putScaled(this->location.x, this->location.y, this->myFunctor(this->eccentricity()));
346 this->dst.put(this->location, this->odimSrc.undetect);
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition: Log.h:308
Logger & error(const TT &... args)
Echoes.
Definition: Log.h:412
Logger & warn(const TT &... args)
Possible error, but execution can continue.
Definition: Log.h:426
Smoothens Doppler field, providing quality computed as eccentricity.
Definition: Doppler.h:238
virtual void write()
Write the result in the target image.
Definition: Doppler.h:251
Definition: Doppler.h:196
virtual void write()
Write the result in the target image.
Definition: Doppler.h:210
Definition: Doppler.h:280
virtual void write()
Write the result in the target image.
Definition: Doppler.h:293
Computes eccentrity of Doppler speeds mapped on a Nyquist-normalized unit window.
Definition: Doppler.h:322
virtual void write()
Write the result in the target image.
Definition: Doppler.h:335
double radialSpeedConv
Speed scaled to radians [-M_PI, M_PI]: radialSpeedConv = M_PI/this->conf.odimSrc.NI.
Definition: Doppler.h:74
virtual double stdDevR()
Returns the radial speed variance [rad] defined as the variance of the cloud of velocity points on un...
Definition: Doppler.h:176
virtual void initialize()
Sets class-specific initial values. Does not change general window state (e.g. location)....
Definition: Doppler.h:100
virtual void removeTrailingValue(double x)
Handles the converted (natural-scaled) value.
Definition: Doppler.h:138
virtual void addLeadingValue(double x)
Handles the converted (natural-scaled) value.
Definition: Doppler.h:151
virtual double averageR()
Returns direction [rad] of the dominant speed.
Definition: Doppler.h:167
double radialSpeedConvInv
Inverse of radialSpeedConv.
Definition: Doppler.h:89
virtual void clear()
Clears the applied statistics. Redefined in derived classes.
Definition: Doppler.h:127
virtual double eccentricity()
Returns the eccentricity of the velocity points on unit circle.
Definition: Doppler.h:189
Definition: RadarWindows.h:112
bool relativeScale
If true, use speed up to -1.0...+1.0 instead of -Vnyq...+Vnyq.
Definition: RadarWindows.h:123
Definition: RadarWindows.h:311
Namespace for images and image processing tools.
Definition: AccumulationArray.cpp:45
Definition: DataSelector.cpp:44