How to use the harmonica.forward.utils.distance_spherical function in harmonica

To help you get started, we’ve selected a few harmonica examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fatiando / harmonica / harmonica / forward / tesseroid.py View on Github external
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
github fatiando / harmonica / harmonica / equivalent_layer / harmonic.py View on Github external
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