Anomaly Detection and Removal (AnDRe)

Introduction

This section explains AnDRe, the set of anomaly detection and removal functions of Rack. A quick reference of all the commands is found in Anomaly detection and removal.

Background

Practically, echoes received by a weather radar originate not only from precipitating clouds but also from insects, birds, aircraft, ships, ground, sea clutter and electromagnetic emitters illustrated in the figure below.

Sources of anomalies.

These external factors – or anomalies from the meteorological point of view – affect radar data in various ways. Some of the anomalies appear as distinct, localized peaks, some form geometrical patterns and some affect the overall data. Examples of effects are shown in the image set below.

Samples containing several types of anomaly.

AnDRe commands

In AnDRe, the processing is divided into two stages: detecting anomalies and removing the anomalies from input data. In principle, these stages modify ODIM data independently so a user may combine Rack with other software performing anomaly detection (see Reading and combining quality data). The independence also means that anomalies can be detected using parallel computation in future versions of Rack (see Anomaly detection).

The following code is an example of applying both detection and removal in Rack :

rack volume.h5 --select 'elangle=0.3:1.5' \
--aEmitter '5,5,0.5' \
--aJamming '5,80,true' \
--aShip '25,15,1500,3' \
--aSpeckle '-20,16,false' \
--aGapFill '1500,5,0.1' \
--aRemover '0.5,nodata,false' \
-o volume-corrected.h5

By default, AnDRe commands apply to the full volume input. Each operator will look for quantities (typically DBZH) it needs as input. To decrease computation time, the processing can be limited using –select command, for example:

rack volume-anomalous.h5 --select 'dataset1:5/data1:3' <andre-cmds> ...
Definition: DataSelector.cpp:44

For details, see Selecting data .

The design of AnDRe detectors is based on Ropo , the operational anomaly detection C program applied in FMI since 2001.
Each detector has been fully rewritten as a respective C++ class (rack::BiometOp, rack::EmitterOp, rack::ShipOp, rack::SpeckleOp) which internally applies functions of the Drain library, for example segment size analysis, moving window filters and statistics. In development, emphasis has been on code re-usability, speed and stability; see implementation details further below.

Rack provides several detectors that compute detection fields ie. probablity images, explained next. The removal procedures are explained after that.

Detection

Currently, AnDRe supports detection the following anomalies:

  1. birds and insects ("biometeors")
  2. emitter lines
  3. widespread electromagnetic interference (jamming)
  4. ships
  5. speckle noise

Anomaly detection and removal start with '–a', and can be listed with

rack --help andre

Detecting birds and insects (single-pol)

Detects birds and insects. The idea behind bird and insect detector hence "biometeor" detector is very simple. It looks for intensities lower than threshold reflMax and altitudes lower than altitudeMax (metres). The thresholds have fuzzy steepness parameters: intensity steepness reflDev and altitude steepness altitudeDev. The steepness parameters determine "half-widths" of the fuzzy responses (Fuzzy functions ).

rack volume.h5 --aBiomet '-10,500,5,1000' -o aBiomet.h5
% reflMax=-10 [dBZ]
% maxAltitude=500 [m]
% reflDev=5 [dBZ]
% devAltitude=1000 [m]
Detection results of --aBiomet .

Detecting birds and insects (dual-pol)

There is also detectors for birds and insects using dual-pol data.

rack volume.h5 --aBird '0,0:3,0.72:0.8,1,2500,5' -o aBird.h5
% dbzPeak=0 [Typical reflectivity (DBZH)]
% vradDevMin=0:3 [Fuzzy threshold of Doppler speed (VRAD) deviation (m/s)]
% rhoHVmax=0.72:0.8 [Fuzzy threshold of maximum rhoHV value]
% zdrAbsMin=1 [Fuzzy threshold of absolute ZDR]
% windowWidth=2500 [window width, beam-directional (m)]
% windowHeight=5 [window width, azimuthal (deg)]
Detection results of --aBird .
rack volume.h5 --aInsect '-10,0:5,0.63:0.7,3,2500,5' -o aInsect.h5
% dbzPeak=-10 [Typical reflectivity (DBZH)]
% vradDevMax=0:5 [Fuzzy threshold of Doppler speed (VRAD) deviation (m/s)]
% rhoHVmax=0.63:0.7 [Fuzzy threshold of maximum rhoHV value]
% zdrAbsMin=3 [Fuzzy threshold of absolute ZDR]
% windowWidth=2500 [window width, beam-directional (m)]
% windowHeight=5 [window width, azimuthal (deg)]
Detection results of --aInsect .

Detecting ground clutter

Based on pre-computed clutter map, scales the clutter probability for desired sweeps. The scaling is a heuristic. The loaded map should contain quantity CLUTTER which in each bin represents the probability of contamination. Notice that the quantity does not describe the intensity of contamination, yet might be computed from accumulated dBZ values as described in cluttermaps .

  • alpha $ \alpha = \angle(b,c)$ : "sky angle",
rack volume.h5 --aClutter '0.5,1,CLUTTER,cluttermaps/cluttermap-${NOD}-${quantity}.h5' -o aClutter.h5
% decay=0.5 [per 1000m]
% gamma=1 [brightness]
% quantity=CLUTTER [CLUTTER|OBSTACLE|...]
% file=cluttermaps/cluttermap-${NOD}-${quantity}.h5 [path syntax]
Detection results of --aClutterMap .

Detecting variations in Doppler wind

Faster yet less accurate bird detection is available as aDopplerNoise which computes standard deviation much in the same way the corresponding meteorological motion product Doppler wind variation . It takes three parameters: speed threshold (m/s) as well as window width and height. The obtained deviation is converted to a detection probability by means of a fuzzy bell function.

rack volume.h5 --aDopplerNoise '3,1500,3' -o aDopplerNoise.h5
% speedDevThreshold=3 [Minimum of bin-to-bin Doppler speed (VRAD) deviation (m/s)]
% windowWidth=1500 [window width, beam-directional (m)]
% windowHeight=3 [window height, azimuthal (deg)]
Detection results of --aDopplerNoise .

Detecting emitters (electromagnetic interference)

AnDRe emitter detector takes four parameters: lengthMin (along the beam, kilometres), widthMax (azimuthal degrees) and sensitivity (between 0.0 and 1.0). The current implementation applies median filtering twice on the data: horizontally and vertically. Then, the vertical result is subtracted from the horizontal, revealing the horizontally elongated line segments. The computed medians are biased; instead of the conventional median position (at 0.5 of the cumulative distribution) one may lighten or darken the results with the sensitivity value. A high value darkens the vertical result and lightens the horizontal result, causing more line segments in the resulting detection field.

rack volume.h5 --aEmitter '5,5,0.5' -o aEmitter.h5
% lengthMin=5 [km]
% thicknessMax=5 [deg]
% sensitivity=0.5 [0...1]
Detection results of --aEmitter .

Detecting jamming

In presense of intensive nearby transmitters or receiver malfunction radar data can be contaminated by intensive overall noise. Rack models the shape of such intensity as a function of distance and applies curve fitting to distinguish between smoothly matching noise areas and pronounced meteorological targets.

rack volume.h5 --aJamming '5,80,true' -o aJamming.h5
% smoothnessThreshold=5 [dBZ]
% distanceMin=80 [km]
% refit=true [true|false]
Detection results of --aJamming .
Detection results of --aJamming .

Detecting sea clutter and other non-meteorogical targets

With the polarimetric quantity RhoHV one can easily detect some non-meteorological echoes such as sea clutter. For meteorological targets, RhoHV is close to 1.0 and below otherwise. For example, sea clutter can be detected with the following command:

rack volume.h5 --aNonMet '0.2:0.6,0,0,0.95' -o aNonMet.h5
% threshold=0.2:0.6 [0...1[:0...1]]
% windowWidth=0 [metres]
% windowHeight=0 [degrees]
% medianPos=0.95 [0...1]
Detection results of --aNonMet .

Detecting ships

The ship detector takes four parameters: minDBZ (minimum reflectance), devDBZ (minimum reflectance difference in a neighborhood), windowWidth (neighbourhood's beam-directional width, metres), windowHeight (neighbourhood's azimuthal width, degrees). First, the detector function computes two separate fields: a fuzzy remapping of minDBZ and field resulting from high-pass filtering with given neighbourhood. Basically, the result is a fuzzy multiplication of those.
In addition, artificial vertical "ship sidelobes" are computed for the latter field, modelling the radar echoes of highly reflective point targets. If the sidelobes also appear in the fuzzy intensity field, they become included in the final result.

rack volume.h5 --aShip '25,15,1500,3' -o aShip.h5
% reflMin=25 [dBZ]
% reflDev=15 [dBZ]
% windowWidth=1500 [m]
% windowHeight=3 [deg]
Detection results of --aShip .

Detecting speckle noise

Speckle detection needs two parameters: threshold (in dBZ) and area (fuzzy maximal speck size). This detector focuses on distinct, small specks, giving maximum value to single-pixel segments, and progressively smaller values for larger segments. The speckle detector applies a semi-recursive flood-fill type function in computing segment sizes: the image is traversed and each segment having intensity of at least threshold becomes analyzed. The size of each segment fuzzily converted to an intensity of equally shaped segment in the result image.

rack volume.h5 --aSpeckle '-20,16,false' -o aSpeckle.h5
% threshold=-20 [dBZ]
% area=16 [bins]
% invertPolar=false [bins]
Detection results of --aSpeckle .

The speck areas are optionally scaled to Cartesian coordinate system. Unscaled areas are better for detecting for non-physical, range independent anomalies like noise whereas scaled mode should be used if physical targets are focused.

Detection results of --aSpeckle without and with polar coordinate inversion.

"Detecting" the Sun

This detector calculates the position of the Sun and marks its with sector of given width and intensity. The detector does not analyse the data itself; sectors will be marked also inside precipitation.

rack volume.h5 --aSun '1,0.95' -o aSun.h5
% beamWidth=1 [deg]
% sensitivity=0.95 [0...1]
Detection results of --aSun .

Cumulating quality fields

Typically, user wants to detect several different types of anomalies. In the ODIM structure, Rack creates new data arrays for storing detection results:

  1. An overall result (maximum) of all the detection operators executed, stored in /dataset??/data??/quality1, with what:quantity=QIND
  2. If –store INTERMEDIATE has been called, all the intermediate detection results
    in /dataset??/data??/quality{N} where {N} is an index starting from 2, with what:quantity=PROB-xxx (non-standard)

Universality. Some detectors like –aSpeckle are universal , they apply not only for the quantity they have been computed on (like DBZH) but also other quantities (like VRAD). The resulting quality information is stored respectively to dataset level or data level. This policy can be toggled with –aUniversal .

The resulting cumulative field with what:quantity=QIND is inverted, reflecting the probability of meteorological echoes, ie. quality of the data. In parallel, the classification field with what:quantity=CLASS is updated. The fields are updated automatically after every detection command. They reside on the dataset level or data level, depending on detector universality described above.

In the removal stage, AnDRe combines the QIND and CLASS fields automatically. One may also combine the fields with –aCombine .

Cumulative field (top window) and distinct detection results (underlying windows).

Anomaly removal

After applying preferred detectors, original data in the volume can be enhanced with the help of the overall quality field, /dataset1/quality/data .

There are three techniques available for the removal:

  1. erasing: replacing values with nodata
  2. damping: turning values down
  3. gap filling: replacing values with surrounding values having better quality

The –aRemover command simply replaces data values with nodata in locations where the quality (anomaly probability) is lower than a threshold:

rack volume-anomalous.h5 <...detection commands...> --aRemover 0.5 -o andre-removed.h5

By default, aRemover applies to practically all quantities (DBZH,TH,VRAD,RHOHV,...). This behaviour can be changed with –select command.

A sweep corrected by --aRemover with threshold 0.25 (left) and 0.75 (right).

A smooth erasure function is implemented as –aDamper which decreases intensity proportionally to the quality index. It applies to reflectivity data (DBZH) only. The lower the quality index, the more intensity will be decreased. An example of the erasing approach:

rack volume-anomalous.h5 <...detection commands...> --aDamper 0.5 -o andre-damped.h5

The parameter defines the threshold quality. The bin values below the quality threshold will be smoothly erased.

A sweep corrected by --aDamper with threshold 0.25 (left) and 0.5 (right).

Gap filling means replacing single values with neighboring, more reliable values. An example of the gap filling approach:

rack volume-anomalous.h5 <...detection commands...> --aGapFill 2000m,5deg -o andre-gapfilled.h5

The parameters of aGapFill are window width and height as metres and azimuthal degrees, respectively. Internally, this operator is implemented using 8-directional distance transform.

A sweep corrected with gap fill parameters 1500m,3deg (left) and 2500m,7deg (right).

Another, experimental gap filling operator –aGapFillRec is recursive and produces spline-like correction fields. The result is smoother but slower to compute. Internally, this operator is implemented by repeating a weighted averaging window.

The removal command can be applied together, for example:

rack volume-anomalous.h5 <...detection commands...> --aDamper 0.5,0.1 --aGapFill 1500m,7deg -o andre-corrected.h5

Other quality fields

Detection based quality fields like the ones explained above describe the probability of signals originating from other than desired targets (other than precipitation, typically). In addition to those, Rack provides two operators that describe the quality.

Attenuation in rain

Radar signal attenuates in heavy rain. The amount of attenuation in liquid rain can be approximated from dBZ data using formula proposed by Ulrich Blahak:

\[ k(Z) = 1.12\cdot10^{-4} Z_e^{0.62} \]

rack volume.h5 --aAttenuation '3,1.12e-07,0.62,0,0' -o aAttenuation.h5
% reflHalfWidth=3 [dBZ limit of 50% quality]
% c=1.12e-07 [coeff]
% p=0.62 [coeff]
% c2=0 [coeff]
% p2=0 [coeff]
Detection results of --aAttenuation .
Detection results of --aAttenuation .

Note that this field should NOT be used for removing echoes; the radar has already cleaned data in signal processor. However, this operator should be computed after removal operators (if applied). The resulting (total) quality field can be used in further production, like quality based compositing in which input bins of lower quality will be overridden by other, overlapping bins of higher quality.

Using Doppler filtering result

If both the total reflectivity (TH ) and Doppler filtered reflectivity are available, their difference provides information where the radar has detected static i.e. suspicious targets. The CCor operator computes the diffence between these and fuzzifies the result such that at the given threshold reflecitivy difference the probability of anomaly is 0.5.

rack volume.h5 --aCCor '10:30,false' -o aCCor.h5
% threshold=10:30 [dBZ range]
% mask=false [Doppler-cleared only]
Detection results of --aCCor .

Note that this field should NOT be used for removing echoes; the radar has already cleaned data in signal processor. However, this operator should be computed after removal operators (if applied). The resulting (total) quality field can be used in further production, like quality based compositing in which input bins of lower quality will be overridden by other, overlapping bins of higher quality.

Timing based quality

Likewise, we can associate timing based quality field that describes the extent in which each measurement bin is representative of the nomimal time of the volume or some other desired time, like the nominal time of a composite.

rack volume.h5 --aTime 'NOMINAL,1,-1' -o aTime.h5
% time=NOMINAL [NOMINAL,NOW,<YYYYmmddMMHH>]
% decayPast=1 [mins]
% decayFuture=-1 [mins]
'Detection' results of --aTime .