harmonica.derivative_easting#
- harmonica.derivative_easting(grid, *, order=1, method='finite-diff', pad=True, pad_kwargs=None)[source]#
Calculate the derivative of a regular grid in the easting direction.
Compute the spatial derivative in the easting direction of regular gridded data. It can compute using accurate central differences using
xarray.differentiateor through frequency domain calculations through Fast Fourier Transform.Important
Choosing the finite differences option produces more accurate results without border effects.
- Parameters:
- grid
xarray.DataArray A two dimensional
xarray.DataArraywhose coordinates are evenly spaced (regular grid). Its dimensions should be in the following order: northing, easting. Its coordinates should be defined in the same units.- order
int,optional The order of the derivative. Default to 1.
- method
str,optional Method that will be used for computing the easting derivative. It can be either
"finite-diff", for computing usingxarray.differentiate, or"fft", for using FFT-based filters. Default"finite-diff".- padbool,
optional If True, will add padding to the grid before taking the Fourier Transform and applying the filter and remove it after the inverse Fourier Transform. Adding padding usually helps reduce edge effects from signal truncation. Default is True.
- pad_kwargs
dictorNone,optional Any additional keyword arguments that should be passed to the
xarray.DataArray.padfunction in the form of a dictionary. If none are given, the default padding of 25% the dimensions of the grid will be added using the “edge” method.
- grid
- Returns:
- derivative
xarray.DataArray A
xarray.DataArraywith the easting derivatives of the passedgrid. Its units are the same units of thegridper units of its coordinates to the power of the passedorder.
- derivative
References