polartoolkit.filter_grid#
- filter_grid(grid, filter_width=None, filter_type='lowpass', filt_type='lowpass', pad_width_factor=3, pad_mode='linear_ramp', pad_constant=None, pad_end_values=None)[source]#
Apply a spatial filter to a grid.
- Parameters:
grid (xarray.DataArray) – grid to filter the values of
filter_width (float | None, optional) – width of the filter in meters for high and low pass filtering, by default None
filter_type (str, optional) – type of filter to use from ‘lowpass’, ‘highpass’ ‘up_deriv’, ‘easting_deriv’, ‘northing_deriv’, or ‘total_gradient’ by default “lowpass”
filt_type (str, optional) – deprecated, use filter_type instead, by default “lowpass”
pad_width_factor (int, optional) – factor of grid width to pad the grid by, by default 3, which equates to a pad with a width of 1/3 of the grid width.
pad_mode (str, optional) – mode of padding, can be “linear”, by default “linear_ramp”
pad_constant (float | None, optional) – constant value to use for padding, by default None
pad_end_values (float | None, optional) – value to use for end of padding if pad_mode is “linear_ramp”, by default None
- Returns:
a filtered grid
- Return type: