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

Stabilize derivatives in fatiando.gravmag #196

Merged
merged 15 commits into from May 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions cookbook/gravmag_transform_deriv.py
Expand Up @@ -33,40 +33,40 @@
mpl.subplot(2, 3, 1)
mpl.title("x deriv (contour) + true (color map)")
mpl.axis('scaled')
levels = mpl.contourf(xp, yp, gxz_true, shape, 12)
levels = mpl.contourf(yp, xp, gxz_true, shape, 12)
mpl.colorbar(shrink=0.7)
mpl.contour(xp, yp, gxz, shape, 12, color='k')
mpl.contour(yp, xp, gxz, shape, 12, color='k')
mpl.m2km()
mpl.subplot(2, 3, 2)
mpl.title("y deriv (contour) + true (color map)")
mpl.axis('scaled')
levels = mpl.contourf(xp, yp, gyz_true, shape, 12)
levels = mpl.contourf(yp, xp, gyz_true, shape, 12)
mpl.colorbar(shrink=0.7)
mpl.contour(xp, yp, gyz, shape, 12, color='k')
mpl.contour(yp, xp, gyz, shape, 12, color='k')
mpl.m2km()
mpl.subplot(2, 3, 3)
mpl.title("z deriv (contour) + true (color map)")
mpl.axis('scaled')
levels = mpl.contourf(xp, yp, gzz_true, shape, 8)
levels = mpl.contourf(yp, xp, gzz_true, shape, 8)
mpl.colorbar(shrink=0.7)
mpl.contour(xp, yp, gzz, shape, levels, color='k')
mpl.contour(yp, xp, gzz, shape, levels, color='k')
mpl.m2km()
mpl.subplot(2, 3, 4)
mpl.title("Difference x deriv")
mpl.axis('scaled')
mpl.pcolor(xp, yp, (gxz_true - gxz), shape)
mpl.pcolor(yp, xp, (gxz_true - gxz), shape)
mpl.colorbar(shrink=0.7)
mpl.m2km()
mpl.subplot(2, 3, 5)
mpl.title("Difference y deriv")
mpl.axis('scaled')
mpl.pcolor(xp, yp, (gyz_true - gyz), shape)
mpl.pcolor(yp, xp, (gyz_true - gyz), shape)
mpl.colorbar(shrink=0.7)
mpl.m2km()
mpl.subplot(2, 3, 6)
mpl.title("Difference z deriv")
mpl.axis('scaled')
mpl.pcolor(xp, yp, (gzz_true - gzz), shape)
mpl.pcolor(yp, xp, (gzz_true - gzz), shape)
mpl.colorbar(shrink=0.7)
mpl.m2km()
mpl.show()
4 changes: 2 additions & 2 deletions cookbook/grid_surfer.py
Expand Up @@ -8,8 +8,8 @@
# Will download the archive and save it with the default name
archive = datasets.fetch_bouguer_alps_egm()

# Load the GRD file and convert in three numpy-arrays (y, x, bouguer)
y, x, bouguer, shape = gridder.load_surfer(archive, fmt='ascii')
# Load the GRD file and convert in three numpy-arrays (x, y, bouguer)
x, y, bouguer, shape = gridder.load_surfer(archive, fmt='ascii')

mpl.figure()
mpl.axis('scaled')
Expand Down
2 changes: 1 addition & 1 deletion doc/api/gravmag.transform.rst
@@ -1,6 +1,6 @@
.. _fatiando_gravmag_transform:

Space domain processing (``fatiando.gravmag.transform``)
Potential field transformations (``fatiando.gravmag.transform``)
============================================================================

.. automodule:: fatiando.gravmag.transform
Expand Down
14 changes: 14 additions & 0 deletions doc/changelog.rst
Expand Up @@ -10,6 +10,20 @@ Version (development)

**Changes**:

* **IMPORTANT BUG FIX**: ``fatiando,gridder.regular`` and many other places in
Fatiando where using the wrong convention for x, y dimensions.
x should point North and y East. Thus, a data matrix (regular grid) should
have x varying in the lines and y varying in the columns. This is **oposite**
what we had. This fix also changes the ``shape`` argument to be ``(nx, ny)``
instead of ``(ny, nx)``. **Users should be aware of this and double check
their code.**
(`PR 196 <https://github.com/fatiando/fatiando/pull/196>`__)
* More stable derivatives in ``fatiando.gravamag.transform``. The horizontal
derivatives default to central finite-differences for greater stability. The
FFT based derivatives use a grid padding to avoid edge effects.
Thanks to `Matteo Niccoli <https://mycarta.wordpress.com/>`__ for suggesting
this fix.
(`PR 196 <https://github.com/fatiando/fatiando/pull/196>`__)
* **Renamed** ``fatiando.gravmag.fourier.ansig`` to
``fatiando.gravmag.transform.tga``
(`PR 186 <https://github.com/fatiando/fatiando/pull/186>`__)
Expand Down
4 changes: 2 additions & 2 deletions fatiando/gravmag/__init__.py
Expand Up @@ -43,8 +43,8 @@
* :mod:`~fatiando.gravmag.normal_gravity`: Compute normal gravity and
reductions.
* :mod:`~fatiando.gravmag.eqlayer`: Equivalent layer processing
* :mod:`~fatiando.gravmag.transform`: Space domain potential field
transformations, like upward continuation
* :mod:`~fatiando.gravmag.transform`: Potential field transformations,
like upward continuation, derivatives, etc
* :mod:`~fatiando.gravmag.imaging`: Imaging methods for potential fields for
estimating physical property distributions
* :mod:`~fatiando.gravmag.tensor`: Utilities for operating on the gradient
Expand Down