harmonica.tesseroid_gravity

harmonica.tesseroid_gravity(coordinates, tesseroids, density, field, distance_size_ratii=None, glq_degrees=(2, 2, 2), stack_size=100, max_discretizations=100000, radial_adaptive_discretization=False, dtype=<class 'numpy.float64'>, disable_checks=False)[source]

Compute gravitational field of tesseroids on computation points.

Warning

The g_z field returns the downward component of the gravitational acceleration on the local North oriented coordinate system. It is equivalent to the opposite of the radial component, therefore it’s positive if the acceleration vector points inside the spheroid.

Parameters
  • coordinates (list or 1d-array) – List or array containing longitude, latitude and radius of the computation points defined on a spherical geocentric coordinate system. Both longitude and latitude should be in degrees and radius in meters.

  • tesseroids (list or 1d-array) – List or array containing the coordinates of the tesseroid: w, e, s, n, bottom, top under a geocentric spherical coordinate system. The longitudinal and latitudinal boundaries should be in degrees, while the radial ones must be in meters.

  • density (list or array) – List or array containing the density of each tesseroid in kg/m^3.

  • field (str) –

    Gravitational field that wants to be computed. The available fields are:

    • Gravitational potential: potential

    • Downward acceleration: g_z

  • distance_size_ratio (dict or None (optional)) – Dictionary containing distance-size ratii for each gravitational field used on the adaptive discretization algorithm. Values must be the available fields and keys should be the desired distance-size ratio. The greater the distance-size ratio, more discretizations will occur, increasing the accuracy of the numerical approximation but also the computation time. If None, the default values of distance-size ratii will be used: D = 1 for the potential and D = 2.5 for the gradient. Default to None.

  • glq_degrees (tuple (optional)) – List containing the GLQ degrees used on each direction: glq_degree_longitude, glq_degree_latitude, glq_degree_radius. The GLQ degree specifies how many point masses will be created along each direction. Increasing the GLQ degree will increase the accuracy of the numerical approximation, but also the computation time. Default [2, 2, 2].

  • stack_size (int (optional)) – Size of the tesseroid stack used on the adaptive discretization algorithm. If the algorithm will perform too many splits, please increase the stack size.

  • max_discretizations (int (optional)) – Maximum number of splits made by the adaptive discretization algorithm. If the algorithm will perform too many splits, please increase the maximum number of splits.

  • radial_adaptive_discretization (bool (optional)) – If False, the adaptive discretization algorithm will split the tesseroid only on the horizontal direction. If True, it will perform a three dimensional adaptive discretization, splitting the tesseroids on every direction. Default False.

  • dtype (data-type (optional)) – Data type assigned to the resulting gravitational field. Default to np.float64.

  • disable_checks (bool (optional)) – Flag that controls whether to perform a sanity check on the model. Should be set to True only when it is certain that the input model is valid and it does not need to be checked. Default to False.

Returns

result (array) – Gravitational field generated by the tesseroids on the computation points.

Examples

>>> # Get WGS84 ellipsoid from the Boule package
>>> import boule
>>> ellipsoid = boule.WGS84
>>> # Define tesseroid of 1km of thickness with top surface on the mean
>>> # Earth radius
>>> thickness = 1000
>>> top = ellipsoid.mean_radius
>>> bottom = top - thickness
>>> w, e, s, n = -1.0, 1.0, -1.0, 1.0
>>> tesseroid = [w, e, s, n, bottom, top]
>>> # Set a density of 2670 kg/m^3
>>> density = 2670.0
>>> # Define computation point located on the top surface of the tesseroid
>>> coordinates = [0, 0, ellipsoid.mean_radius]
>>> # Compute radial component of the gravitational gradient in mGal
>>> tesseroid_gravity(coordinates, tesseroid, density, field="g_z")
array(112.54539933)

Examples using harmonica.tesseroid_gravity