Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _distance_tesseroid_point(
coordinates, tesseroid
): # pylint: disable=too-many-locals
"""
Distance between a computation point and the center of a tesseroid
"""
# Get center of the tesseroid
w, e, s, n, bottom, top = tesseroid[:]
longitude_p = (w + e) / 2
latitude_p = (s + n) / 2
radius_p = (bottom + top) / 2
# Get distance between computation point and tesseroid center
distance = distance_spherical(coordinates, (longitude_p, latitude_p, radius_p))
return distance
def greens_func_spherical(
longitude, latitude, radius, point_longitude, point_latitude, point_radius
):
"""
Green's function for the equivalent layer in spherical coordinates
Uses Numba to speed up things.
"""
distance = distance_spherical(
(longitude, latitude, radius), (point_longitude, point_latitude, point_radius)
)
return 1 / distance