2019 was quite a busy year. I changed my job from the Mexican Petroleum Institute IMP to TU Delft already in 2018, but it was only this February when we finally moved physically to the Netherlands. Here a quick rundown of 2019 in terms of open-source things, mostly in Python and generally related to geophysics. As usual, most my open-source stuff can be found either on my GitHub or the GitHub of empymod.
emg3d
The highlight this year was definitely the release of emg3d
, released under
the Apache License, Version 2.0.
It is a three-dimensional electromagnetic modeller for geophysical exploration
(controlled-source electromagnetics CSEM), written completely in Python. The
core functionality is written in just-in-time (jit) compiled functions using
numba. From the description of emg3d
: «The
modeller emg3d is a multigrid solver for 3D EM diffusion with tri-axial
electrical anisotropy. The matrix-free solver can be used as main solver or as
preconditioner for Krylov subspace methods, and the governing equations are
discretized on a staggered Yee grid.» Multigrid methods scale linearly in both
CPU and RAM usage, and as such you can run quite big models on standard
computers, no need for huge clusters (see the manual for more in this regard).
You can find emg3d
and all information around it (manual, code, examples,
benchmarks, and more) together with empymod
at
empymod.github.io:
Installation is easy using either pip
$ pip install emg3d
or conda
$ conda install -c conda-forge emg3d
Reference (open access):
Werthmüller, D., W. A. Mulder, and E. C. Slob, 2019, emg3d: A multigrid solver for 3D electromagnetic diffusion: Journal of Open Source Software, 4(39), 1463, 10.21105/joss.01463.
empymod
Not too much happened with regards to empymod
. Some notable changes:
- Our article A tool for designing digital filters for the Hankel and Fourier
transforms in potential, diffusive, and wavefield modeling (featured in the
2018 roundup) got highlighted under Geophysics Bright Spots in The Leading
Edge, see 10.1190/tle38050402.1.
- Sphinx-Gallery is now used for the
examples.
- Besides wavenumber-frequency domain, space-frequency domain, and space-time
domain you can now calculate EM responses in the space-Laplace domain.
- There were many improvements for loops (TEMs), have a look at the examples.
empymod
also moved from my own conda channelprisae
to the channelconda-forge
.
Varia
- Scooby: I used to have a
Versions()
function at the end of my notebooks to keep track of what versions I was using for the main packages, what Python environment, the date and other info. I had that implemented inempymod
andemg3d
, and also brought it toSimPEG
. Bane Sullivan expanded on my code and made a self-standing package out of it,scooby
(available viapip
andconda-forge
). Here you can seescooby
in action:
In a notebook it shows a nicely rendered html-table, in a console it prints a plain-text version of it. - It took some work, but with the help of Joseph Dellinger (BP), Ted Bakamjian
(SEG), and Philipp Witte (Georgia Institute of Technology) we managed to get
finally a proper open-source license attached to the
SEG/EAGE Salt and Overthrust Models,
and you can download it directly from the SEG wiki.
- Cubic spline interpolation in three dimensions is not implemented in an
easy, user-facing routine in SciPy. However, interpolating linearly can
introduce significant errors with, for instance, electromagnetic responses
that cover many orders of magnitude. I made some comparisons in this
direction in 2D to show the importance:
You can find the corresponding notebook here: Interpolation-Comparison-2D.ipynb.
There is now 3D cubic spline interpolation included inemg3d
using SciPy, see the functionemg3d.utils._interp3d
. It uses a combination ofscipy.interpolate.interp1d
andscipy.ndimage.map_coordinates
to get it working with 3D data (credit to Joe Kington for helping with that).