polartoolkit.filter_grid

Contents

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 (DataArray) – grid to filter the values of

  • filter_width (float | None) – width of the filter in meters for high and low pass filtering, by default None

  • filter_type (str) – type of filter to use from ‘lowpass’, ‘highpass’ ‘up_deriv’, ‘easting_deriv’, ‘northing_deriv’, or ‘total_gradient’ by default “lowpass”

  • filt_type (str) – deprecated, use filter_type instead, by default “lowpass”

  • pad_width_factor (int) – 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) – mode of padding, can be “linear”, by default “linear_ramp”

  • pad_constant (float | None) – constant value to use for padding, by default None

  • pad_end_values (float | None) – value to use for end of padding if pad_mode is “linear_ramp”, by default None

Returns:

a filtered grid

Return type:

DataArray