pyart icon indicating copy to clipboard operation
pyart copied to clipboard

Add a method to apply a gatefilter to fields to mask the data

Open scollis opened this issue 7 years ago • 1 comments
trafficstars

At the moment the way I apply a gatefilter to mask (ie when I want to save) data is as follows:

gf.exclude_below('reflectivity', 10)
nf = deepcopy(radar.fields['reflectivity'])
nf['data'] = np.ma.masked_where(gf.gate_excluded, nf['data'])
radar.add_field('filtered_refectivity', nf, replace_existing=True)```

It would be great to have a method that automates this...

something like:

radar.apply_filter(gatefilter, replace=False, fields=None)

If replace = False it will append 'filtered_'+field with areas where gatefilter.gate_exluded set to _FillValue
if replace = True it does it in-place
if fields = None it does it to all fields 

Inspired by Brenda Dolan

scollis avatar Aug 23 '18 14:08 scollis

Self assigned, will look into this.

zssherman avatar May 07 '19 18:05 zssherman

Working on this now

zssherman avatar Nov 08 '22 20:11 zssherman