Filters (pyart.filters)

Classes for specifying what gates are included and excluded from routines.

Filtering radar data

GateFilter(radar[, exclude_based]) A class for building a boolean arrays for filtering gates based on a set of condition typically based on the values in the radar fields.
moment_based_gate_filter(radar[, ncp_field, …]) Create a filter which removes undesired gates based on moments.
moment_and_texture_based_gate_filter(radar) Create a filter which removes undesired gates based on texture of moments.
snr_based_gate_filter(radar[, snr_field, …]) Create a filter which removes undesired gates based on SNR.
visibility_based_gate_filter(radar[, …]) Create a filter which removes undesired gates based on visibility.
class_based_gate_filter(radar[, field, …]) Create a filter which removes undesired gates based on class values
temp_based_gate_filter(radar[, temp_field, …]) Create a filter which removes undesired gates based on temperature.
iso0_based_gate_filter(radar[, iso0_field, …]) Create a filter which removes undesired gates based height over the iso0.
birds_gate_filter(radar[, zdr_field, …]) Create a filter which removes data not suspected of being birds
class pyart.filters.GateFilter(radar, exclude_based=True)[source]

Bases: object

A class for building a boolean arrays for filtering gates based on a set of condition typically based on the values in the radar fields. These filter can be used in various algorithms and calculations within Py-ART.

See pyart.correct.GateFilter.exclude_below() for method parameter details.

Parameters:
radar : Radar

Radar object from which gate filter will be build.

exclude_based : bool, optional

True, the default and suggested method, will begin with all gates included and then use the exclude methods to exclude gates based on conditions. False will begin with all gates excluded from which a set of gates to include should be set using the include methods.

Examples

>>> import pyart
>>> radar = pyart.io.read('radar_file.nc')
>>> gatefilter = pyart.correct.GateFilter(radar)
>>> gatefilter.exclude_below('reflectivity', 10)
>>> gatefilter.exclude_below('normalized_coherent_power', 0.75)
Attributes:
gate_excluded : array, dtype=bool

Return a copy of the excluded gates.

gate_included : array, dtype=bool

Return a copy of the included gates.

Methods

copy(self) Return a copy of the gatefilter.
exclude_above(self, field, value[, …]) Exclude gates where a given field is above a given value.
exclude_all(self) Exclude all gates.
exclude_below(self, field, value[, …]) Exclude gates where a given field is below a given value.
exclude_equal(self, field, value[, …]) Exclude gates where a given field is equal to a value.
exclude_gates(self, mask[, exclude_masked, op]) Exclude gates where a given mask is equal True.
exclude_inside(self, field, v1, v2[, …]) Exclude gates where a given field is inside a given interval.
exclude_invalid(self, field[, …]) Exclude gates where an invalid value occurs in a field (NaNs or infs).
exclude_masked(self, field[, exclude_masked, op]) Exclude gates where a given field is masked.
exclude_none(self) Exclude no gates, include all gates.
exclude_not_equal(self, field, value[, …]) Exclude gates where a given field is not equal to a value.
exclude_outside(self, field, v1, v2[, …]) Exclude gates where a given field is outside a given interval.
exclude_transition(self[, trans_value, …]) Exclude all gates in rays marked as in transition between sweeps.
include_above(self, field, value[, …]) Include gates where a given field is above a given value.
include_all(self) Include all gates.
include_below(self, field, value[, …]) Include gates where a given field is below a given value.
include_equal(self, field, value[, …]) Include gates where a given field is equal to a value.
include_gates(self, mask[, exclude_masked, op]) Include gates where a given mask is equal True.
include_inside(self, field, v1, v2[, …]) Include gates where a given field is inside a given interval.
include_none(self) Include no gates, exclude all gates.
include_not_equal(self, field, value[, …]) Include gates where a given field is not equal to a value.
include_not_masked(self, field[, …]) Include gates where a given field in not masked.
include_not_transition(self[, trans_value, …]) Include all gates in rays not marked as in transition between sweeps.
include_outside(self, field, v1, v2[, …]) Include gates where a given field is outside a given interval.
include_valid(self, field[, exclude_masked, op]) Include gates where a valid value occurs in a field (not NaN or inf).
__class__

alias of builtins.type

__delattr__(self, name, /)

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'pyart.filters.gatefilter', '__doc__': "\n A class for building a boolean arrays for filtering gates based on\n a set of condition typically based on the values in the radar fields.\n These filter can be used in various algorithms and calculations within\n Py-ART.\n\n See :py:func:`pyart.correct.GateFilter.exclude_below` for method\n parameter details.\n\n Parameters\n ----------\n radar : Radar\n Radar object from which gate filter will be build.\n exclude_based : bool, optional\n True, the default and suggested method, will begin with all gates\n included and then use the exclude methods to exclude gates based on\n conditions. False will begin with all gates excluded from which\n a set of gates to include should be set using the include methods.\n\n Attributes\n ----------\n gate_excluded : array, dtype=bool\n Boolean array indicating if a gate should be excluded from a\n calculation. Elements marked True indicate the corresponding gate\n should be excluded. Those marked False should be included.\n This is read-only attribute, any changes to the array will NOT\n be reflected in gate_included and will be lost when the attribute is\n accessed again.\n gate_included : array, dtype=bool\n Boolean array indicating if a gate should be included in a\n calculation. Elements marked True indicate the corresponding gate\n should be include. Those marked False should be excluded.\n This is read-only attribute, any changes to the array will NOT\n be reflected in gate_excluded and will be lost when the attribute is\n accessed again.\n\n Examples\n --------\n >>> import pyart\n >>> radar = pyart.io.read('radar_file.nc')\n >>> gatefilter = pyart.correct.GateFilter(radar)\n >>> gatefilter.exclude_below('reflectivity', 10)\n >>> gatefilter.exclude_below('normalized_coherent_power', 0.75)\n\n ", '__init__': <function GateFilter.__init__>, 'copy': <function GateFilter.copy>, 'gate_included': <property object>, 'gate_excluded': <property object>, '_get_fdata': <function GateFilter._get_fdata>, '_merge': <function GateFilter._merge>, 'exclude_transition': <function GateFilter.exclude_transition>, 'exclude_below': <function GateFilter.exclude_below>, 'exclude_above': <function GateFilter.exclude_above>, 'exclude_inside': <function GateFilter.exclude_inside>, 'exclude_outside': <function GateFilter.exclude_outside>, 'exclude_equal': <function GateFilter.exclude_equal>, 'exclude_not_equal': <function GateFilter.exclude_not_equal>, 'exclude_all': <function GateFilter.exclude_all>, 'exclude_none': <function GateFilter.exclude_none>, 'exclude_masked': <function GateFilter.exclude_masked>, 'exclude_invalid': <function GateFilter.exclude_invalid>, 'exclude_gates': <function GateFilter.exclude_gates>, 'include_not_transition': <function GateFilter.include_not_transition>, 'include_below': <function GateFilter.include_below>, 'include_above': <function GateFilter.include_above>, 'include_inside': <function GateFilter.include_inside>, 'include_outside': <function GateFilter.include_outside>, 'include_equal': <function GateFilter.include_equal>, 'include_not_equal': <function GateFilter.include_not_equal>, 'include_all': <function GateFilter.include_all>, 'include_none': <function GateFilter.include_none>, 'include_not_masked': <function GateFilter.include_not_masked>, 'include_valid': <function GateFilter.include_valid>, 'include_gates': <function GateFilter.include_gates>, '__dict__': <attribute '__dict__' of 'GateFilter' objects>, '__weakref__': <attribute '__weakref__' of 'GateFilter' objects>})
__dir__(self, /)

Default dir() implementation.

__eq__(self, value, /)

Return self==value.

__format__(self, format_spec, /)

Default object formatter.

__ge__(self, value, /)

Return self>=value.

__getattribute__(self, name, /)

Return getattr(self, name).

__gt__(self, value, /)

Return self>value.

__hash__(self, /)

Return hash(self).

__init__(self, radar, exclude_based=True)[source]

initialize

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(self, value, /)

Return self<=value.

__lt__(self, value, /)

Return self<value.

__module__ = 'pyart.filters.gatefilter'
__ne__(self, value, /)

Return self!=value.

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__(self, /)

Helper for pickle.

__reduce_ex__(self, protocol, /)

Helper for pickle.

__repr__(self, /)

Return repr(self).

__setattr__(self, name, value, /)

Implement setattr(self, name, value).

__sizeof__(self, /)

Size of object in memory, in bytes.

__str__(self, /)

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

_get_fdata(self, field)[source]

Check that the field exists and retrieve field data.

_merge(self, marked, op, exclude_masked)[source]

Merge an array of marked gates with the exclude array.

copy(self)[source]

Return a copy of the gatefilter.

exclude_above(self, field, value, exclude_masked=True, op='or', inclusive=False)[source]

Exclude gates where a given field is above a given value.

exclude_all(self)[source]

Exclude all gates.

exclude_below(self, field, value, exclude_masked=True, op='or', inclusive=False)[source]

Exclude gates where a given field is below a given value.

Parameters:
field : str

Name of field compared against the value.

value : float

Gates with a value below this value in the specified field will be marked for exclusion in the filter.

exclude_masked : bool, optional

True to filter masked values in the specified field if the data is a masked array, False to include any masked values.

op : {‘and’, ‘or’, ‘new’}

Operation to perform when merging the existing set of excluded gates with the excluded gates from the current operation. ‘and’ will perform a logical AND operation, ‘or’ a logical OR, and ‘new’ will replace the existing excluded gates with the one generated here. ‘or’, the default for exclude methods, is typically desired when building up a set of conditions for excluding gates where the desired effect is to exclude gates which meet any of the conditions. ‘and’, the default for include methods, is typically desired when building up a set of conditions where the desired effect is to include gates which meet any of the conditions. Note that the ‘and’ method MAY results in including gates which have previously been excluded because they were masked or invalid.

inclusive : bool

Indicates whether the specified value should also be excluded.

exclude_equal(self, field, value, exclude_masked=True, op='or')[source]

Exclude gates where a given field is equal to a value.

exclude_gates(self, mask, exclude_masked=True, op='or')[source]

Exclude gates where a given mask is equal True.

Parameters:
mask : numpy array

Boolean numpy array with same shape as a field array.

exclude_masked : bool, optional

True to filter masked values in the specified mask if it is a masked array, False to include any masked values.

op : {‘and’, ‘or’, ‘new’}

Operation to perform when merging the existing set of excluded gates with the excluded gates from the current operation. ‘and’ will perform a logical AND operation, ‘or’ a logical OR, and ‘new’ will replace the existing excluded gates with the one generated here. ‘or’, the default for exclude methods, is typically desired when building up a set of conditions for excluding gates where the desired effect is to exclude gates which meet any of the conditions. ‘and’, the default for include methods, is typically desired when building up a set of conditions where the desired effect is to include gates which meet any of the conditions. Note that the ‘and’ method MAY results in including gates which have previously been excluded because they were masked or invalid.

exclude_inside(self, field, v1, v2, exclude_masked=True, op='or', inclusive=True)[source]

Exclude gates where a given field is inside a given interval.

exclude_invalid(self, field, exclude_masked=True, op='or')[source]

Exclude gates where an invalid value occurs in a field (NaNs or infs).

exclude_masked(self, field, exclude_masked=True, op='or')[source]

Exclude gates where a given field is masked.

exclude_none(self)[source]

Exclude no gates, include all gates.

exclude_not_equal(self, field, value, exclude_masked=True, op='or')[source]

Exclude gates where a given field is not equal to a value.

exclude_outside(self, field, v1, v2, exclude_masked=True, op='or', inclusive=False)[source]

Exclude gates where a given field is outside a given interval.

exclude_transition(self, trans_value=1, exclude_masked=True, op='or')[source]

Exclude all gates in rays marked as in transition between sweeps.

Exclude all gates in rays marked as “in transition” by the antenna_transition attribute of the radar used to construct the filter. If no antenna transition information is available no gates are excluded.

Parameters:
trans_value : int, optional

Value used in the antenna transition data to indicate that the instrument was between sweeps (in transition) during the collection of a specific ray. Typically a value of 1 is used to indicate this transition and the default can be used in these cases.

exclude_masked : bool, optional

True to filter masked values in antenna_transition if the data is a masked array, False to include any masked values.

op : {‘and’, ‘or’, ‘new’}

Operation to perform when merging the existing set of excluded gates with the excluded gates from the current operation. ‘and’ will perform a logical AND operation, ‘or’ a logical OR, and ‘new’ will replace the existing excluded gates with the one generated here. ‘or’, the default for exclude methods, is typically desired when building up a set of conditions for excluding gates where the desired effect is to exclude gates which meet any of the conditions. ‘and’, the default for include methods, is typically desired when building up a set of conditions where the desired effect is to include gates which meet any of the conditions. Note that the ‘and’ method MAY results in including gates which have previously been excluded because they were masked or invalid.

gate_excluded

Return a copy of the excluded gates.

gate_included

Return a copy of the included gates.

include_above(self, field, value, exclude_masked=True, op='and', inclusive=False)[source]

Include gates where a given field is above a given value.

include_all(self)[source]

Include all gates.

include_below(self, field, value, exclude_masked=True, op='and', inclusive=False)[source]

Include gates where a given field is below a given value.

include_equal(self, field, value, exclude_masked=True, op='and')[source]

Include gates where a given field is equal to a value.

include_gates(self, mask, exclude_masked=True, op='and')[source]

Include gates where a given mask is equal True.

Parameters:
mask : numpy array

Boolean numpy array with same shape as a field array.

exclude_masked : bool, optional

True to filter masked values in the specified mask if it is a masked array, False to include any masked values.

op : {‘and’, ‘or’, ‘new’}

Operation to perform when merging the existing set of excluded gates with the excluded gates from the current operation. ‘and’ will perform a logical AND operation, ‘or’ a logical OR, and ‘new’ will replace the existing excluded gates with the one generated here. ‘or’, the default for exclude methods, is typically desired when building up a set of conditions for excluding gates where the desired effect is to exclude gates which meet any of the conditions. ‘and’, the default for include methods, is typically desired when building up a set of conditions where the desired effect is to include gates which meet any of the conditions. Note that the ‘or’ method MAY results in excluding gates which have previously been included.

include_inside(self, field, v1, v2, exclude_masked=True, op='and', inclusive=True)[source]

Include gates where a given field is inside a given interval.

include_none(self)[source]

Include no gates, exclude all gates.

include_not_equal(self, field, value, exclude_masked=True, op='and')[source]

Include gates where a given field is not equal to a value.

include_not_masked(self, field, exclude_masked=True, op='and')[source]

Include gates where a given field in not masked.

include_not_transition(self, trans_value=0, exclude_masked=True, op='and')[source]

Include all gates in rays not marked as in transition between sweeps.

Include all gates in rays not marked as “in transition” by the antenna_transition attribute of the radar used to construct the filter. If no antenna transition information is available all gates are included.

Parameters:
trans_value : int, optional

Value used in the antenna transition data to indicate that the instrument is not between sweeps (in transition) during the collection of a specific ray. Typically a value of 0 is used to indicate no transition and the default can be used in these cases.

exclude_masked : bool, optional

True to filter masked values in antenna_transition if the data is a masked array, False to include any masked values.

op : {‘and’, ‘or’, ‘new’}

Operation to perform when merging the existing set of excluded gates with the excluded gates from the current operation. ‘and’ will perform a logical AND operation, ‘or’ a logical OR, and ‘new’ will replace the existing excluded gates with the one generated here. ‘or’, the default for exclude methods, is typically desired when building up a set of conditions for excluding gates where the desired effect is to exclude gates which meet any of the conditions. ‘and’, the default for include methods, is typically desired when building up a set of conditions where the desired effect is to include gates which meet any of the conditions. Note that the ‘or’ method MAY results in excluding gates which have previously been included.

include_outside(self, field, v1, v2, exclude_masked=True, op='and', inclusive=False)[source]

Include gates where a given field is outside a given interval.

include_valid(self, field, exclude_masked=True, op='and')[source]

Include gates where a valid value occurs in a field (not NaN or inf).

pyart.filters.birds_gate_filter(radar, zdr_field=None, rhv_field=None, refl_field=None, vel_field=None, max_zdr=3.0, max_rhv=0.9, min_refl=0.0, max_refl=20.0, vel_lim=1.0, rmin=2000.0, rmax=25000.0, elmin=1.0, elmax=85.0)[source]

Create a filter which removes data not suspected of being birds

Creates a gate filter in which the following gates are excluded:

  • Gates where the instrument is transitioning between sweeps.
  • Gates where the reflectivity is beyond min_refl and max_refl
  • Gates where the co-polar correlation coefficient is above max_rhv
  • Gates where the differential reflectivity is above max_zdr
  • Gates where the Doppler velocity is within the interval given by +-vel_lim
  • Gates where any of the above fields are masked or contain invalid values (NaNs or infs).
  • Gates outside the range given by range min and range max
  • If any of these three fields do not exist in the radar that fields filter criteria is not applied.
Parameters:
radar : Radar

Radar object from which the gate filter will be built.

refl_field, zdr_field, rhv_field, vel_field : str

Names of the radar fields which contain the reflectivity, differential reflectivity, co-polar correlation coefficient, and Doppler velocity from which the gate filter will be created using the above criteria. A value of None for any of these parameters will use the default field name as defined in the Py-ART configuration file.

max_zdr, max_rhv : float

Maximum values for the differential reflectivity and co-polar correlation coefficient. Gates in these fields above these limits as well as gates which are masked or contain invalid values will be excluded and not used in calculation which use the filter. A value of None will disable filtering based upon the given field including removing masked or gates with an invalid value. To disable the thresholding but retain the masked and invalid filter set the parameter to a value above the highest value in the field.

min_refl, max_refl : float

Minimum and maximum values for the reflectivity. Gates outside of this interval as well as gates which are masked or contain invalid values will be excluded and not used in calculation which use this filter. A value or None for one of these parameters will disable the minimum or maximum filtering but retain the other. A value of None for both of these values will disable all filtering based upon the reflectivity including removing masked or gates with an invalid value. To disable the interval filtering but retain the masked and invalid filter set the parameters to values above and below the lowest and greatest values in the reflectivity field.

rmin, rmax : float

Minimum and maximum ranges [m]

elmin, elmax : float

Minimum and maximum elevations [deg]

Returns:
gatefilter : GateFilter

A gate filter based upon the described criteria. This can be used as a gatefilter parameter to various functions in pyart.correct.

pyart.filters.class_based_gate_filter(radar, field=None, kept_values=None)[source]

Create a filter which removes undesired gates based on class values

Parameters:
radar : Radar

Radar object from which the gate filter will be built.

field : str

Name of the radar field which contains the classification. A value of None for will use the default field name for the hydrometeor classification as defined in the Py-ART configuration file.

kept_values : list of ints or none

The class values to keep

Returns:
gatefilter : GateFilter

A gate filter based upon the described criteria. This can be used as a gatefilter parameter to various functions in pyart.correct.

pyart.filters.iso0_based_gate_filter(radar, iso0_field=None, max_h_iso0=0.0, thickness=400.0, beamwidth=None)[source]

Create a filter which removes undesired gates based height over the iso0. Used primarily to filter out the melting layer and gates above it.

Parameters:
radar : Radar

Radar object from which the gate filter will be built.

iso0_field : str

Name of the radar field which contains the height relative to the iso0. A value of None for will use the default field name as defined in the Py-ART configuration file.

max_h_iso0 : float

Maximum height relative to the iso0 in m. Gates below this limits as well as gates which are masked or contain invalid values will be excluded and not used in calculation which use the filter. A value of None will disable filtering based upon the field including removing masked or gates with an invalid value. To disable the thresholding but retain the masked and invalid filter set the parameter to a value below the lowest value in the field.

thickness : float

The estimated thickness of the melting layer in m.

beamwidth : float

The radar antenna 3 dB beamwidth [deg].

Returns:
gatefilter : GateFilter

A gate filter based upon the described criteria. This can be used as a gatefilter parameter to various functions in pyart.correct.

pyart.filters.moment_and_texture_based_gate_filter(radar, zdr_field=None, rhv_field=None, phi_field=None, refl_field=None, textzdr_field=None, textrhv_field=None, textphi_field=None, textrefl_field=None, wind_size=7, max_textphi=20.0, max_textrhv=0.3, max_textzdr=2.85, max_textrefl=8.0, min_rhv=0.6)[source]

Create a filter which removes undesired gates based on texture of moments.

Creates a gate filter in which the following gates are excluded: * Gates where the instrument is transitioning between sweeps. * Gates where RhoHV is below min_rhv * Gates where the PhiDP texture is above max_textphi. * Gates where the RhoHV texture is above max_textrhv. * Gates where the ZDR texture is above max_textzdr * Gates where the reflectivity texture is above max_textrefl * If any of the thresholds is not set or the field (RhoHV, ZDR, PhiDP, reflectivity) do not exist in the radar the filter is not applied.

Parameters:
radar : Radar

Radar object from which the gate filter will be built.

zdr_field, rhv_field, phi_field, refl_field : str

Names of the radar fields which contain the differential reflectivity, cross correlation ratio, differential phase and reflectivity from which the textures will be computed. A value of None for any of these parameters will use the default field name as defined in the Py-ART configuration file.

textzdr_field, textrhv_field, textphi_field, textrefl_field : str

Names of the radar fields given to the texture of the differential reflectivity, texture of the cross correlation ratio, texture of differential phase and texture of reflectivity. A value of None for any of these parameters will use the default field name as defined in the Py-ART configuration file.

wind_size : int

Size of the moving window used to compute the ray texture.

max_textphi, max_textrhv, max_textzdr, max_textrefl : float

Maximum value for the texture of the differential phase, texture of RhoHV, texture of Zdr and texture of reflectivity. Gates in these fields above these limits as well as gates which are masked or contain invalid values will be excluded and not used in calculation which use the filter. A value of None will disable filtering based upon the given field including removing masked or gates with an invalid value. To disable the thresholding but retain the masked and invalid filter set the parameter to a value above the highest value in the field.

min_rhv : float

Minimum value for the RhoHV. Gates below this limits as well as gates which are masked or contain invalid values will be excluded and not used in calculation which use the filter. A value of None will disable filtering based upon the given field including removing masked or gates with an invalid value. To disable the thresholding but retain the masked and invalid filter set the parameter to a value below the lowest value in the field.

Returns:
gatefilter : GateFilter

A gate filter based upon the described criteria. This can be used as a gatefilter parameter to various functions in pyart.correct.

pyart.filters.moment_based_gate_filter(radar, ncp_field=None, rhv_field=None, refl_field=None, min_ncp=0.5, min_rhv=None, min_refl=-20.0, max_refl=100.0)[source]

Create a filter which removes undesired gates based on moments.

Creates a gate filter in which the following gates are excluded:

  • Gates where the instrument is transitioning between sweeps.
  • Gates where the reflectivity is outside the interval min_refl, max_refl.
  • Gates where the normalized coherent power is below min_ncp.
  • Gates where the cross correlation ratio is below min_rhi. Using the default parameter this filtering is disabled.
  • Gates where any of the above three fields are masked or contain invalid values (NaNs or infs).
  • If any of these three fields do not exist in the radar that fields filter criteria is not applied.
Parameters:
radar : Radar

Radar object from which the gate filter will be built.

refl_field, ncp_field, rhv_field : str

Names of the radar fields which contain the reflectivity, normalized coherent power (signal quality index) and cross correlation ratio (RhoHV) from which the gate filter will be created using the above criteria. A value of None for any of these parameters will use the default field name as defined in the Py-ART configuration file.

min_ncp, min_rhv : float

Minimum values for the normalized coherence power and cross correlation ratio. Gates in these fields below these limits as well as gates which are masked or contain invalid values will be excluded and not used in calculation which use the filter. A value of None will disable filtering based upon the given field including removing masked or gates with an invalid value. To disable the thresholding but retain the masked and invalid filter set the parameter to a value below the lowest value in the field.

min_refl, max_refl : float

Minimum and maximum values for the reflectivity. Gates outside of this interval as well as gates which are masked or contain invalid values will be excluded and not used in calculation which use this filter. A value or None for one of these parameters will disable the minimum or maximum filtering but retain the other. A value of None for both of these values will disable all filtering based upon the reflectivity including removing masked or gates with an invalid value. To disable the interval filtering but retain the masked and invalid filter set the parameters to values above and below the lowest and greatest values in the reflectivity field.

Returns:
gatefilter : GateFilter

A gate filter based upon the described criteria. This can be used as a gatefilter parameter to various functions in pyart.correct.

pyart.filters.snr_based_gate_filter(radar, snr_field=None, min_snr=10.0, max_snr=None)[source]

Create a filter which removes undesired gates based on SNR.

Parameters:
radar : Radar

Radar object from which the gate filter will be built.

snr_field : str

Name of the radar field which contains the signal to noise ratio. A value of None for will use the default field name as defined in the Py-ART configuration file.

min_snr : float

Minimum value for the SNR. Gates below this limits as well as gates which are masked or contain invalid values will be excluded and not used in calculation which use the filter. A value of None will disable filtering based upon the field including removing masked or gates with an invalid value. To disable the thresholding but retain the masked and invalid filter set the parameter to a value below the lowest value in the field.

max_snr : float

Maximum value for the SNR

Returns:
gatefilter : GateFilter

A gate filter based upon the described criteria. This can be used as a gatefilter parameter to various functions in pyart.correct.

pyart.filters.temp_based_gate_filter(radar, temp_field=None, min_temp=0.0, thickness=400.0, beamwidth=None)[source]

Create a filter which removes undesired gates based on temperature. Used primarily to filter out the melting layer and gates above it.

Parameters:
radar : Radar

Radar object from which the gate filter will be built.

temp_field : str

Name of the radar field which contains the temperature. A value of None for will use the default field name as defined in the Py-ART configuration file.

min_temp : float

Minimum value for the temperature in degrees. Gates below this limits as well as gates which are masked or contain invalid values will be excluded and not used in calculation which use the filter. A value of None will disable filtering based upon the field including removing masked or gates with an invalid value. To disable the thresholding but retain the masked and invalid filter set the parameter to a value below the lowest value in the field.

thickness : float

The estimated thickness of the melting layer in m.

beamwidth : float

The radar antenna 3 dB beamwidth [deg].

Returns:
gatefilter : GateFilter

A gate filter based upon the described criteria. This can be used as a gatefilter parameter to various functions in pyart.correct.

pyart.filters.visibility_based_gate_filter(radar, vis_field=None, min_vis=10.0)[source]

Create a filter which removes undesired gates based on visibility.

Parameters:
radar : Radar

Radar object from which the gate filter will be built.

vis_field : str

Name of the radar field which contains the visibility. A value of None for will use the default field name as defined in the Py-ART configuration file.

min_vis : float

Minimum value for the visibility. Gates below this limits as well as gates which are masked or contain invalid values will be excluded and not used in calculation which use the filter. A value of None will disable filtering based upon the field including removing masked or gates with an invalid value. To disable the thresholding but retain the masked and invalid filter set the parameter to a value below the lowest value in the field.

Returns:
gatefilter : GateFilter

A gate filter based upon the described criteria. This can be used as a gatefilter parameter to various functions in pyart.correct.