Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | List of all members
JammingOp Class Reference

A detector for widespread electromagnetic interference. More...

#include <JammingOp.h>

Inheritance diagram for JammingOp:
Inheritance graph
[legend]
Collaboration diagram for JammingOp:
Collaboration graph
[legend]

Public Member Functions

 JammingOp (double smoothnessThreshold=5.0, double distanceMin=80.0, double refit=true, int debugRow=-1)
 
- Public Member Functions inherited from DetectorOp
 DetectorOp (const std::string &name=__FUNCTION__, const std::string &description="", const std::string &echoClass="")
 
 DetectorOp (const DetectorOp &op)
 
virtual const std::string & getOutputQuantity (const std::string &inputQuantity="") const
 Returns the quantity name, by default the name of the class in upper case letters.
 
virtual void computeProducts (const DataSetMap< PolarSrc > &srcVolume, DataSetMap< PolarDst > &dstVolume) const
 
virtual void runDetection (const DataSetMap< PolarSrc > &srcVolume, DataSetMap< PolarDst > &dstVolume) const
 
virtual void runDetection (const DataSet< PolarSrc > &srcDataSet, PlainData< PolarDst > &dstProb, DataSet< PolarDst > &aux) const
 Process as sweep (data in one elevation angle)
 
virtual void processData (const Data< src_t > &srcData, Data< dst_t > &dstData) const
 
- Public Member Functions inherited from VolumeTraversalOp
 VolumeTraversalOp (const std::string &name, const std::string &description="")
 
virtual void traverseVolume (const Hi5Tree &src, Hi5Tree &dst) const
 Base class for radar data processors.
 
- Public Member Functions inherited from PolarProductOp
 PolarProductOp (const std::string &name=__FUNCTION__, const std::string &description="")
 
 PolarProductOp (const PolarProductOp &op)
 
- Public Member Functions inherited from VolumeOp< PolarODIM >
 VolumeOp (const std::string &name, const std::string &description="")
 
virtual Hi5Tree & processVolume (const Hi5Tree &srcRoot, Hi5Tree &dstRoot) const final
 Traverse through given volume and create new, processed data (volume or polar product).
 
- Public Member Functions inherited from RadarProductOp< MS, MD >
 RadarProductOp (const std::string &name, const std::string &description)
 Default constructor.
 
 RadarProductOp (const RadarProductOp &product)
 
virtual void processH5 (const Hi5Tree &src, Hi5Tree &dst) const
 
virtual void computeSingleProduct (const DataSetMap< src_t > &srcSweeps, DataSet< dst_t > &dstProduct) const
 Traverse the data applicable for this product and create new, processed data (volume or polar product).
 
virtual void processDataSet (const DataSet< src_t > &srcSweep, DataSet< DstType< MD > > &dstProduct) const
 Process the data of a single sweep and and write the result to given product.
 
- Public Member Functions inherited from ProductBase
const std::string & getLastArguments () const
 
virtual ~ProductBase ()
 Destructor.
 
void setDataSelector (const DataSelector &selector)
 Copies the conditions of another selector.
 
const DataSelectorgetDataSelector () const
 Returns the data selector of this operator.
 
DataSelectorgetDataSelector ()
 Returns the data selector of this operator.
 
void help (std::ostream &ostr=std::cout, bool showDescription=true) const
 Dumps the help of this operator.
 
const drain::ReferenceMapgetAllowedEncoding () const
 Returns a map of encoding parameters that can be changed by the user.
 
virtual void setEncodingRequest (const std::string &p)
 Set encoding parameters for the result: type,gain,offset,undetect,nodata.
 
void setAllowedEncoding (const std::string &keys)
 
- Public Member Functions inherited from ProductConf
 ProductConf ()
 Default constructor.
 
 ProductConf (const ProductConf &conf)
 Copy constructor.
 
- Public Member Functions inherited from BeanLike
 BeanLike (const BeanLike &b)
 
 BeanLike (const std::string &name, const std::string &description="")
 
virtual const std::string & getName () const
 Return the name of an instance.
 
virtual const std::string & getDescription () const
 Return a brief description.
 
bool hasParameters () const
 
template<class F >
getParameter (const std::string &p) const
 Gets a single parameter.
 
const map_tgetParameters () const
 
map_tgetParameters ()
 
template<class F >
void setParametersFromEntries (const F &args)
 
void setParameters (std::initializer_list< Variable::init_pair_t > args)
 Grants access to (if above hidden)
 
virtual void setParameters (const std::string &p, char assignmentSymbol='=', char separatorSymbol=0)
 Sets comma-separated parameters in a predetermined order "a,b,c" or by specifing them "b=2".
 
template<class T >
void setParameters (const std::map< std::string, T > &args)
 Set parameters.
 
template<class T >
void setParameters (const SmartMap< T > &args)
 Set parameters.
 
void setParameter (const std::string &p, const Castable &value)
 Sets a single parameter.
 
template<class T >
void setParameter (const std::string &p, const VariableT< T > &value)
 
template<class F >
void setParameter (const std::string &p, const F &value)
 Sets a single parameter.
 
template<class F >
void setParameter (const std::string &p, std::initializer_list< F > value)
 Sets a single parameter.
 
BeanLikeoperator= (const BeanLike &b)
 
virtual std::ostream & toStream (std::ostream &ostr, bool compact=true) const
 

Static Public Member Functions

static double modelledEmitter (double dBZ0, double distance)
 Model for radar amplification of an external emitter.
 
- Static Public Member Functions inherited from ProductBase
static void completeEncoding (ODIM &productODIM, const std::string &targetEncoding)
 Modifies encoding. If type is changed, resets scaling first.
 
static void applyODIM (ODIM &productODIM, const ODIM &srcODIM, bool applyDefaults=false)
 Sets target quantity and encoding, if unset. If input odim.
 
static void setRackVersion (drain::VariableMap &metadata)
 

Public Attributes

double smoothnessThreshold
 
double distanceMin
 
bool refit
 
int debugRow
 
- Public Attributes inherited from DetectorOp
const drain::image::Palette::value_type & classEntry
 Index applied in the legend of the classification results.
 
bool UNIVERSAL = false
 If true, applies also to quantities str than the one used in detection. The detection and the accumulation will be stored one step upwards (dataset-N level).
 
- Public Attributes inherited from RadarProductOp< MS, MD >
MD odim
 The default data parameters for encoding output (the product).
 
- Public Attributes inherited from ProductConf
DataSelector dataSelector
 
std::string targetEncoding
 How the (main) output is encoded.
 
ODIMPathElem appendResults
 If set, appends outputs in an hdf5 structure instead of overwriting.
 
OutputFlagger outputDataVerbosity = DEFAULT
 

Protected Member Functions

virtual void runDetector (const PlainData< PolarSrc > &srcData, PlainData< PolarDst > &dstProb) const
 Process as sweep (data in one elevation angle)
 
- Protected Member Functions inherited from DetectorOp
virtual void initDataDst (const PlainData< PolarSrc > &srcData, PlainData< PolarDst > &dstData, const std::string &quantity="") const
 If raised, make template? Cf. Volume::initDst ?
 
void storeDebugData (int debugLevel, const ImageFrame &srcImage, const std::string &label) const
 
void storeDebugData (const ImageFrame &srcImage, PlainData< PolarDst > &dstData, const std::string &quantityLabel) const
 
virtual void writeHow (PlainData< PolarDst > &dstData) const
 After running a cmd, write execution details.
 
void _enhanceDirectionally (Image &data, float medianPos, int windowWidth) const
 Enhances the detection result by reinforcing sectors of strong response, attenuating others. Optional utility for derived classes.
 
void _infect (Image &data, int windowWidth, int windowHeight, double enhancement) const
 
- Protected Member Functions inherited from AndreOp
 AndreOp (const std::string &name, const std::string &description)
 Generally, the whole data structure can be traversed.
 
virtual void setGeometry (const PolarODIM &srcODIM, PlainData< PolarDst > &dstData) const
 
- Protected Member Functions inherited from VolumeTraversalOp
void collect (const Hi5Tree &src, Hi5Tree &dst) const
 
- Protected Member Functions inherited from PolarProductOp
void copyPolarGeometry (const PolarODIM &srcODIM, PlainData< PolarDst > &dstData) const
 
virtual void deriveDstGeometry (const DataSetMap< PolarSrc > &srcSweeps, PolarODIM &dstOdim, bool MINIMISE_RSCALE=false) const
 Based on input data, find geometry that maximises range and ray count.
 
virtual void determineMetadata (const DataSetMap< PolarSrc > &srcSweeps, PolarODIM &dstOdim) const
 Update timestamps etc.
 
- Protected Member Functions inherited from RadarProductOp< MS, MD >
virtual void setGeometry (const MS &srcODIM, PlainData< dst_t > &dstData) const =0
 Sets automagically the suitable dst parameters.
 
virtual void initDst (const MS &srcODIM, PlainData< dst_t > &dstData) const
 initialises dst data by setting suitable ODIM metadata and geometry.
 
virtual void setEncoding (const ODIM &srcODIM, PlainData< dst_t > &dstData) const
 Sets applicable encoding parametes (type, gain, offset, undetect, nodata) for this product.
 
void setEncodingNEW (PlainData< dst_t > &dstData, const std::string quantity="", const std::string type="") const
 Sets applicable encoding parametes (type, gain, offset, undetect, nodata) for this product.
 
- Protected Member Functions inherited from ProductBase
 ProductBase (const std::string &name, const std::string &description)
 Default constructor.
 
 ProductBase (const ProductBase &product)
 
void storeLastArguments (const std::string &p) override
 Called after setParameters()
 
- Protected Member Functions inherited from BeanLike
virtual void updateBean () const
 Called after setParameters()
 

Static Protected Member Functions

static double derivativeDBZ (const PolarODIM &odimIn, const Image &src, int i, int j, int span=10)
 Returns the beam-oriented derivative of the dBZ field. In case of no-data, returns std::numeric_limits<double>::max().
 
static double derivativeDBZ_Modelled (double yModelBase, double range, double rangeDifference)
 
- Static Protected Member Functions inherited from ProductBase
static void setODIMspecials (ODIM &productODIM)
 Sets target encoding.
 

Additional Inherited Members

- Public Types inherited from RadarProductOp< MS, MD >
typedef SrcType< MS const > src_t
 Type of input, that is, source.
 
typedef DstType< MD > dst_t
 Type of output, that is, destination.
 
- Public Types inherited from ProductConf
enum  OutputDataVerbosity { DEFAULT =0 , INTERMEDIATE =1 , DEBUG =2 , QUALITY =4 }
 Determines if also intermediate results (1) are saved. See –store.
 
typedef drain::EnumFlagger< drain::MultiFlagger< OutputDataVerbosity > > OutputFlagger
 
- Public Types inherited from BeanLike
typedef ReferenceMap map_t
 
- Static Public Attributes inherited from DetectorOp
static bool SUPPORT_UNIVERSAL
 
- Static Public Attributes inherited from PolarProductOp
static const CoordinatePolicy polarCoordPolicy
 
- Protected Attributes inherited from DetectorOp
std::string upperCaseName
 
bool REQUIRE_STANDARD_DATA = false
 Set to true if operator expects fixed background intensities instead of "nodata" defined by the PolarODIM. Affects getValidData().
 
- Protected Attributes inherited from PolarProductOp
bool aboveSeaLevel
 
- Protected Attributes inherited from ProductBase
std::string lastArguments
 
drain::ReferenceMap allowedEncoding
 Defines which encoding parameters can be changed by the user from command line.
 
- Protected Attributes inherited from BeanLike
const std::string name
 
const std::string description
 
map_t parameters
 
- Static Protected Attributes inherited from DetectorOp
static unsigned short int _count
 

Detailed Description

A detector for widespread electromagnetic interference.

Detects smooth, widespread interference. Based on fitting a function that models how radar receives external emitters:

\[
  dbz = b_1 + b_1x + b_2*\log(x);
\]

Constructor & Destructor Documentation

◆ JammingOp()

JammingOp ( double  smoothnessThreshold = 5.0,
double  distanceMin = 80.0,
double  refit = true,
int  debugRow = -1 
)
inline

Default constructor.

Parameters
smoothnessThreshold- maximum standard deviation in a 5x3 sliding window
distanceMin- minimum sampling distance [km] for curve fitting
weightLower- if not 1.0, refit the curve, weighting samples lower the initial curve with this.
debugRow-
sampleContent- minimum percentage of valid (detected) bins along the beam
maxCurvature- b2 in fitting dbz = b0 + b1*x + b2*x*x;

5.0,0.25,2.0,0.001,40

Member Function Documentation

◆ modelledEmitter()

static double modelledEmitter ( double  dBZ0,
double  distance 
)
inlinestatic

Model for radar amplification of an external emitter.

Parameters
distance- distance in metres

◆ runDetector()

void runDetector ( const PlainData< PolarSrc > &  srcData,
PlainData< PolarDst > &  dstProb 
) const
protectedvirtual

Process as sweep (data in one elevation angle)

Parameters
srcDataSet- input data of one elevation; possibly several quantities (measurement parameters).
dstProb- probability field ie. the result of the detection algorithm
aux- auxialiary DatasetDst for keeping a copy of normalized data. Process using single data only (no quality "involved", because it is created here...)
srcData- input data of one elevation; possibly several quantities (measurement parameters).
dstProb- output data, typically in the same dataset as srcData.

STEP 1: Compute the standard-deviation in a 3x5 window

STEP 1b: Convert std.deviation to fuzzy smoothness value. The largest response is around undetectValue deviation.

Measure of fit between original dBZ data and matched curve.

Similarity measure of slopes of the smoothed dBZ and matched curve.

Horizonal coordinate (i) in double precision

Distance from radar

Original data value

Smoothness (fuzzified stdDev)

Modelled constant-power transmitter curve, in dBZ

Step 1: fi

Step 2: refit

Derive probability from fuzzy difference measure and fuzzy smoothness measure

Range

dBZ

Reimplemented from DetectorOp.

Member Data Documentation

◆ debugRow

int debugRow

Curvature is computed as a maximum difference between the fitted 2nd order polynomial curve

\[
   \hat{y_2}(x) = b_0 + b_1x + b_2x^2
 \]

and the direct line crossing its point values, $(0,b_0)$ and $(w,\hat{y_2}(w))$ where $w$ is the maximum of $x$. Denote $d_y=\hat{y_2}(w)-\hat{y_2}(0)$. Then, the line is

\[
   \hat{y_1}(x) = b_0 + \frac{x}{w}d_y
 \]

and the difference

\[
   d(x) = \hat{y_2}(x) - \hat{y_1}(x) = x(b_1 - \frac{d_y}{w}) + b_2x^2
 \]

and its derivative is

\[
   d'(x) = b_1 - \frac{d_y}{w} + 2b_2x .
 \]

Setting $d'(x)=0$ we get

\[
   x = (\frac{d_y}{w}-b_1)/2b_2
 \]

$(0,b_0)$ and $(x_w,b_0 + b_1x_w + b_2x_w^2)$ where $x_w$ is the maximum of x.


The documentation for this class was generated from the following files: