Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Commit

Permalink
Use finite diff derivatives by default
Browse files Browse the repository at this point in the history
For the horizontal derivatives, the finite difference solutions are much
more stable than the FFT ones. They underestimate the derivative a bit
where the gradient is high but otherwise behave in a more consistent
manner and are safer to use.
  • Loading branch information
leouieda committed Apr 30, 2015
1 parent 2cf1dc9 commit 9b8760a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fatiando/gravmag/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def upcontinue(gz, height, xp, yp, dims):
return gzcont


def tga(x, y, data, shape, method='fft'):
def tga(x, y, data, shape, method='fd'):
"""
Calculate the total gradient amplitude.
Expand Down Expand Up @@ -118,7 +118,7 @@ def tga(x, y, data, shape, method='fft'):
return res


def derivx(x, y, data, shape, order=1, method='fft'):
def derivx(x, y, data, shape, order=1, method='fd'):
"""
Calculate the derivative of a potential field in the x direction.
Expand Down Expand Up @@ -174,7 +174,7 @@ def derivx(x, y, data, shape, order=1, method='fft'):
return deriv.ravel()


def derivy(x, y, data, shape, order=1, method='fft'):
def derivy(x, y, data, shape, order=1, method='fd'):
"""
Calculate the derivative of a potential field in the y direction.
Expand Down

0 comments on commit 9b8760a

Please sign in to comment.