# Filtering gates for each field for one nc file

**URL:** <https://openradar.discourse.group/t/filtering-gates-for-each-field-for-one-nc-file/648>\
**Category:** Corrections/Data Quality\
**Created:** [October 8, 2025, 6:13pm UTC](https://openradar.discourse.group/t/filtering-gates-for-each-field-for-one-nc-file/648 "2025-10-08T18:13:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashlee.ziegler](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@ashlee.ziegler](https://openradar.discourse.group/u/ashlee.ziegler)\
**Post date:** [October 8, 2025, 6:13pm UTC](https://openradar.discourse.group/t/filtering-gates-for-each-field-for-one-nc-file/648/1 "2025-10-08T18:13:01Z")

</div>

Hi all,

I am performing objective analysis using the Barnes2 method on some mobile radar files, including dual-pol fields like CC, Kdp, and Zdr. I was wondering if there was a way for the gate filtering to only be applied to the corresponding field rather than all five filters being applied to each field, or if I am just missing something. For example, if I exclude gates with reflectivity below -100 (trying to exclude the missing value fields), it only applies to reflectivity, and if I exclude CC values below -3 (once again getting rid of the missing value gates), those gates only apply to CC, not reflectivity, and so on. When I have all the filters included, it makes my reflectivity field really ugly, and that is a key piece I need for my analysis. However, I need to make sure the interpolation for the OA isn’t using the missing values in their respective fields, which are extreme in the calculations.

Here is a snippet of my code:

 ![Screenshot 2025-10-08 at 2.09.31 PM](https://global.discourse-cdn.com/free1/uploads/openradar/original/1X/d904c04f193eab0f119a3ca0a32de1a26d8eed3e.png)

---

<div class="post-metadata">

**Author:** ![DavidDufton](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@DavidDufton](https://openradar.discourse.group/u/DavidDufton)\
**Post date:** [October 9, 2025, 9:05am UTC](https://openradar.discourse.group/t/filtering-gates-for-each-field-for-one-nc-file/648/2 "2025-10-09T09:05:22Z")

</div>

Have you tried individually masking each field in place rather than using gatefilters?

Something like this:

```python
radar.fields['DBZ']['data'] = np.ma.masked_less_equal(radar.fields['DBZ']['data'],
                                                       -100)
radar.fields['RHOHV']['data'] = np.ma.masked_less_equal(radar.fields['RHOHV']['data'],
                                                       -3)

```

These may carry through to the gridding then, at least they have in my quick test run with some of our data [edit].

---

<div class="post-metadata">

**Author:** ![ashlee.ziegler](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@ashlee.ziegler](https://openradar.discourse.group/u/ashlee.ziegler)\
**Post date:** [October 9, 2025, 5:23pm UTC](https://openradar.discourse.group/t/filtering-gates-for-each-field-for-one-nc-file/648/3 "2025-10-09T17:23:41Z")

</div>

I will definitely give this a try! Thank you!
