harmonica.derivative_easting

harmonica.derivative_easting#

harmonica.derivative_easting(grid, order=1, method='finite-diff')[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.differentiate or through frequency domain calculations through Fast Fourier Transform.

Important

Choosing the finite differences option produces more accurate results without border effects.

Parameters:
gridxarray.DataArray

A two dimensional xarray.DataArray whose 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.

orderint

The order of the derivative. Default to 1.

methodstr (optional)

Method that will be used for computing the easting derivative. It can be either "finite-diff", for computing using xarray.differentiate, or "fft", for using FFT-based filters. Default "finite-diff".

Returns:
derivativexarray.DataArray

A xarray.DataArray with the easting derivatives of the passed grid. Its units are the same units of the grid per units of its coordinates to the power of the passed order.

References

[Blakely1995]