Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def kernel_g_easting_cartesian(
easting, northing, upward, easting_p, northing_p, upward_p
):
"""
Kernel function for easting component of gravitational gradient in
Cartesian coordinates
"""
distance = distance_cartesian(
(easting, northing, upward), (easting_p, northing_p, upward_p)
)
return -(easting - easting_p) / distance ** 3
def greens_func_cartesian(east, north, upward, point_east, point_north, point_upward):
"""
Green's function for the equivalent layer in Cartesian coordinates
Uses Numba to speed up things.
"""
distance = distance_cartesian(
(east, north, upward), (point_east, point_north, point_upward)
)
return 1 / distance
def kernel_potential_cartesian(
easting, northing, upward, easting_p, northing_p, upward_p
):
"""
Kernel function for gravitational potential field in Cartesian coordinates
"""
distance = distance_cartesian(
(easting, northing, upward), (easting_p, northing_p, upward_p)
)
return 1 / distance
def kernel_g_northing_cartesian(
easting, northing, upward, easting_p, northing_p, upward_p
):
"""
Kernel function for northing component of gravitational gradient in
Cartesian coordinates
"""
distance = distance_cartesian(
(easting, northing, upward), (easting_p, northing_p, upward_p)
)
return -(northing - northing_p) / distance ** 3
def kernel_g_z_cartesian(easting, northing, upward, easting_p, northing_p, upward_p):
"""
Kernel for downward component of gravitational gradient in Cartesian coords
"""
distance = distance_cartesian(
(easting, northing, upward), (easting_p, northing_p, upward_p)
)
# Remember that the ``g_z`` field returns the downward component of the
# gravitational acceleration. As a consequence, it is multiplied by -1.
# Notice that the ``g_z`` does not have the minus signal observed at the
# compoents ``g_northing`` and ``g_easting``.
return (upward - upward_p) / distance ** 3