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.
See also
- Attributes:
boundariesBoundaries of the layer.
dimsReturn the dims tuple of the prism layer.
shapeReturn the number of tesseroids on each directions.
sizeReturn the total number of tesseroids on the layer.
spacingSpacing between center of tesseroids.
Methods
get_tesseroid(indices)Return the boundaries of the chosen tesseroid.
gravity(coordinates, field[, progressbar, ...])Compute 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.
- DatasetAccessorTesseroidLayer.gravity(coordinates, field, progressbar=False, density_name='density', **kwargs)[source]#
Compute the gravity generated by the layer of tesseroids.
- Parameters:
- coordinates
listofarrays List of arrays containing the
longitude,latitudeandradiuscoordinates of the computation points, defined on a spherical geocentric coordinate system. Bothlongitudeandlatitudeshould be in degrees andradiusin meters.- field
str 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_progressto be installed. Default toFalse.- density_name
str(optional) Name of the property layer (or
data_varof thexarray.Dataset) that will be used for the density of each tesseroid in the layer. Default to"density"
- coordinates
- Returns:
- result
array 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.
- result
See also
- DatasetAccessorTesseroidLayer.update_top_bottom(surface, reference)[source]#
Update top and bottom boundaries of the layer.
Change the values of the
topandbottomcoordinates based on the passedsurfaceandreference. Thetopandbottomboundaries of every tesseroid will be equal to the correspondingsurfaceandreferencevalues, respectively, ifsurfaceis above thereferenceon that point. Otherwise thetopandbottomboundaries of the tesseroid will be equal to its correspondingreferenceandsurface, 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
surfaceis belowreference, thesurfacevalue will be used to set thebottomboundary of that tesseroid, while thereferencevalue will be used to set thetopboundary 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.
Attributes#
- DatasetAccessorTesseroidLayer.boundaries#
Boundaries of the layer.
- Returns:
- boundaries
tuple Boundariesofthelayeroftesseroidsinthefollowingorder:longitude_w,longitude_e,latitude_s,latitude_n
- boundaries
- DatasetAccessorTesseroidLayer.dims#
Return the dims tuple of the prism layer.
The tuple follows the xarray order:
"latitude","longitude".
- DatasetAccessorTesseroidLayer.shape#
Return the number of tesseroids on each directions.
- DatasetAccessorTesseroidLayer.size#
Return the total number of tesseroids on the layer.
- Returns:
- size
int Total number of tesseroids in the layer.
- size
- DatasetAccessorTesseroidLayer.spacing#
Spacing between center of tesseroids.