# How to filter spectrum width from ppi files?

**URL:** <https://openradar.discourse.group/t/how-to-filter-spectrum-width-from-ppi-files/253>\
**Category:** Corrections/Data Quality\
**Tags:** py-art, data\
**Created:** [June 20, 2023, 6:42am UTC](https://openradar.discourse.group/t/how-to-filter-spectrum-width-from-ppi-files/253 "2023-06-20T06:42:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehzooz](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Mehzooz](https://openradar.discourse.group/u/Mehzooz)\
**Post date:** [June 20, 2023, 6:42am UTC](https://openradar.discourse.group/t/how-to-filter-spectrum-width-from-ppi-files/253/1 "2023-06-20T06:42:05Z")

</div>

I have a ppi file and i need the spectrum width data for the 16th sweep(85 degree elevation).I am getting spectrum width data above 7 km but there are no clouds above that height(verified with reflectivity and doppler velocity). How to filter these false data?  
I am attaching the spectrum width and reflectivity plot respectively.  
 ![image](https://global.discourse-cdn.com/free1/uploads/openradar/original/1X/99d5f7ce52b632e04cc56d403068d2cb30708ff3.png)

![image](https://global.discourse-cdn.com/free1/uploads/openradar/original/1X/a456defbe46c3f093a9c58c568e9c7e523dc3eb2.png)

Thank you in advance

---

<div class="post-metadata">

**Author:** ![rcjackson](https://yyz2.discourse-cdn.com/free1/user_avatar/openradar.discourse.group/rcjackson/32/14_2.png) [@rcjackson](https://openradar.discourse.group/u/rcjackson)\
**Post date:** [June 20, 2023, 2:00pm UTC](https://openradar.discourse.group/t/how-to-filter-spectrum-width-from-ppi-files/253/2 "2023-06-20T14:00:43Z")

</div>

Hi, Py-ART provides a GateFilter functionality for just that!

[https://arm-doe.github.io/pyart/API/generated/pyart.filters.GateFilter.html](https://arm-doe.github.io/pyart/API/generated/pyart.filters.GateFilter.html)

What you would need to do is exclude all points where the reflectivity is masked.

A sample code for that given a `radar` is:

```auto
gatefilter = pyart.filters.GateFilter(radar)
gatefilter.exclude_invalid('DBZH')

```

You can then specify that gatefilter in your plotting routines, and use the `gatefilter.gate_excluded` array as your mask for any calculations with the data.

Hope this helps,  
Bobby
