harmonica.DatasetAccessorTesseroidLayer#

class harmonica.DatasetAccessorTesseroidLayer(xarray_obj)[source]#

Define dataset accessor for layer of tesseroids

Warning

This class in not intended to be initialized. Use the tesseroid_layer accessor for accessing the methods and attributes of this class.

Attributes:
boundaries

Boundaries of the layer

dims

Return the dims tuple of the prism layer

shape

Return the number of tesseroids on each directions

size

Return the total number of tesseroids on the layer

spacing

Spacing between center of tesseroids

Methods

get_tesseroid(indices)

Return the boundaries of the chosen tesseroid

gravity(coordinates, field[, progressbar, ...])

Computes the gravity generated by the layer of tesseroids

update_top_bottom(surface, reference)

Update top and bottom boundaries of the layer

DatasetAccessorTesseroidLayer.get_tesseroid(indices)[source]#

Return the boundaries of the chosen tesseroid

Parameters:
indicestuple

Indices of the desired tesseroid of the layer in the following order: (index_northing, index_easting).

Returns:
tesseroidtuple

Boundaries of the prisms in the following order: longitude_w, longitude_e, latitude_s, latitude_n, bottom, top.

DatasetAccessorTesseroidLayer.gravity(coordinates, field, progressbar=False, density_name='density', **kwargs)[source]#

Computes the gravity generated by the layer of tesseroids

Parameters:
coordinateslist of arrays

List of arrays containing the longitude, latitude and radius coordinates of the computation points, defined on a spherical geocentric coordinate system. Both longitude and latitude should be in degrees and radius in meters.

fieldstr

Gravitational field that wants to be computed. The variable fields are: - Gravitational potential: potential - Downward acceleration: g_z

progressbarbool (optional)

If True, a progress bar of the computation will be printed to standard error (stderr). Requires numba_progress to be installed. Default to False.

density_namestr (optional)

Name of the property layer (or data_var of the xarray.Dataset) that will be used for the density of each tesseroid in the layer. Default to "density"

Returns:
resultarray

Gravitational field generated by the tesseroid on the computation point. Gravitational potential will be returned in SI units, while acceleration components will be in mGal.

DatasetAccessorTesseroidLayer.update_top_bottom(surface, reference)[source]#

Update top and bottom boundaries of the layer

Change the values of the top and bottom coordinates based on the passed surface and reference. The top and bottom boundaries of every tesseroid will be equal to the corresponding surface and reference values, respectively, if surface is above the reference on that point. Otherwise the top and bottom boundaries of the tesseroid will be equal to its corresponding reference and surface, respectively.

Parameters:
surface2d-array

Array used to create the uppermost boundary of the tesseroid layer. All heights should be in meters. On every point where surface is below reference, the surface value will be used to set the bottom boundary of that tesseroid, while the reference value will be used to set the top boundary of the tesseroid.

reference2d-array or float

Reference surface used to create the lowermost boundary of the tesseroid layer. It can be either a plane or an irregular surface passed as 2d array. Height(s) must be in meters.