API Reference

Gravity Corrections

bouguer_correction(topography[, ...])

Gravitational effect of topography using a Bouguer plate approximation

For the Normal Earth correction, see package boule.

Grid Transformations

Apply well known transformations regular gridded potential fields data.

derivative_upward(grid[, order])

Calculate the derivative of a potential field grid in the upward direction

Frequency domain filters

Define filters in the frequency domain.

filters.derivative_upward_kernel(fft_grid[, ...])

Filter for upward derivative in frequency domain

Use xrft.xrft.fft and xrft.xrft.ifft to apply Fast-Fourier Transforms and its inverse on xarray.DataArray.

Equivalent Sources

EquivalentSources([damping, points, depth, ...])

Equivalent sources for generic harmonic functions (gravity, magnetics).

EquivalentSourcesGB([damping, points, ...])

Gradient-boosted equivalent sources for generic harmonic functions.

EquivalentSourcesSph([damping, points, ...])

Equivalent sources for generic harmonic functions in spherical coordinates

Forward modelling

point_gravity(coordinates, points, masses, field)

Compute gravitational fields of point masses.

prism_gravity(coordinates, prisms, density, ...)

Gravitational fields of right-rectangular prisms in Cartesian coordinates

tesseroid_gravity(coordinates, tesseroids, ...)

Compute gravitational field of tesseroids on computation points.

prism_layer(coordinates, surface, reference)

Create a layer of prisms of equal size


Defines dataset accessor for layer of prisms

Isostatic Moho

isostatic_moho_airy(basement[, layers, ...])

Calculate the isostatic Moho depth using Airy's hypothesis.

isostasy_airy(topography[, density_crust, ...])

Calculate the isostatic Moho depth from topography using Airy's hypothesis.


The harmonica.isostasy_airy function will be deprecated in Harmonica v0.6. Please use harmonica.isostatic_moho_airy instead.

Input and Output

load_icgem_gdf(fname, **kwargs)

Reads data from an ICGEM .gdf file.


visualization.prism_to_pyvista(prisms[, ...])

Create a pyvista.UnstructuredGrid out of prisms

Synthetic models and surveys


The harmonica.synthetic module will be deprecated in Harmonica v0.6.0

synthetic.airborne_survey([region, data_region])

Create measurement locations for a synthetic airborne survey

synthetic.ground_survey([region, data_region])

Create measurement locations for a synthetic ground survey



The harmonica.datasets module and every sample dataset a will be deprecated in Harmonica v0.6.0. The examples and the user guide will transition to using Ensaio (https://www.fatiando.org/ensaio/) instead.


The harmonica.datasets module will be deprecated in Harmonica v0.6.0


The absolute path to the sample data storage location on disk.


Fetch a global grid of Earth gravity.


Fetch a global grid of the geoid height.


Fetch a global grid of Earth relief (topography and bathymetry).


Fetch total-field magnetic anomaly data of Great Britain.


Fetch gravity station data from South Africa


test([doctest, verbose, coverage, figures])

Run the test suite.