Code Monkey home page Code Monkey logo

swung-research / 3d-csem-open-source-landscape Goto Github PK

View Code? Open in Web Editor NEW
10.0 4.0 5.0 119.62 MB

Werthmüller, D., R. Rochlitz, O. Castillo-Reyes, and L. Heagy, 2021, Towards an open-source landscape for 3-D CSEM modelling: Geophysical Journal International, 227(1), 644--659

Home Page: https://doi.org/10.1093/gji/ggab238

License: Creative Commons Attribution Share Alike 4.0 International

Python 1.34% Jupyter Notebook 95.28% TeX 3.04% GLSL 0.34%
csem 3d-modelling electromagnetics manuscript

3d-csem-open-source-landscape's Introduction

Towards an open-source landscape for 3-D CSEM modelling

Werthmüller, D., R. Rochlitz, O. Castillo-Reyes, and L. Heagy, 2021, Towards an open-source landscape for 3-D CSEM modelling: Geophysical Journal International, 227(1), 644--659; DOI: 10.1093/gji/ggab238.

This repository contains the LaTeX source of the manuscript as well as the necessary codes to reproduce all the results and figures.

Repository structure

├── environment.yml  # Python environment file
├── LICENSE          # CC-BY-SA-4.0 License
├── README.md        # this file
├── manuscript/      # LaTeX-files
│   └── figures/     # figures used in manuscript
├── model-{MODEL}/   # for MODEL in {block, marlim}
│   ├── README.md    # info about MODEL
│   ├── {CODE}/      # for CODE in {custEM, emg3d, PETGEM, SimPEG}
│   └── results/     # results of the different codes
└── presentation/    # talk given at the AGU 2020

Each model-{MODEL}/-directory contains a README.md with more information about the particular model.

History

  1. 2020-10-23: Submitted to Geophysical Journal International.
  2. 2021-02-15: Revision I submitted.
  3. 2021-04-15: Revision II submitted.
  4. 2021-06-08: Revision III submitted.
  5. 2021-06-16: Accepted.

Data

The information in this repo is enough to reproduce all results and figures shown in the manuscript. Our results are available at 10.5281/zenodo.4535602.

Environment

The environment.yml file generates a conda-environment (see Anaconda Python Distribution) with all the required dependencies. To create the environment simply run

conda env create -f environment.yml

This will create a new conda environment called csem.

To activate the environment run

conda activate csem

and to deactivate it run

conda deactivate

To use this environment in the Jupyter notebook, you have to register it first:

python -m ipykernel install --user --name csem

Then, in the Jupyter notebook (or Jupyter lab), you can select it by going to Kernel->Change kernel and select csem.

To completely remove the environment run

conda remove --name csem --all

You need at least Python 3.7 to run (at least some of) the codes.

Dependencies

Dependencies are a difficult topic, and no-one can guarantee that the scripts will still work a few years down to road with many new releases of all dependencies. We list here therefore the most important dependencies that were used when creating the results.

Note that all notebooks (data creation, results, and computation of emg3d and SimPEG) have a scooby-report at the end, listing the most important dependencies and their version.

emg3d

The following is the emg3d-scooby report. You can get your own either in Python via emg3d.Report() or in the terminal via emg3d --report.

--------------------------------------------------------------------------------
  Date: Thu Jun 17 14:50:50 2021 CEST

                OS : Linux
            CPU(s) : 4
           Machine : x86_64
      Architecture : 64bit
               RAM : 15.5 GB
       Environment : Python

  Python 3.8.0 | packaged by conda-forge | (default, Nov 22 2019, 19:11:38)
  [GCC 7.3.0]

             numpy : 1.19.5
             scipy : 1.6.0
             numba : 0.52.0
             emg3d : 0.16.0
           empymod : 2.0.4
            xarray : 0.16.2
        discretize : 0.6.2
              h5py : 3.1.0
        matplotlib : 3.3.3
           IPython : 7.19.0

  Intel(R) Math Kernel Library Version 2020.0.4 Product Build 20200917 for
  Intel(R) 64 architecture applications
--------------------------------------------------------------------------------

custEM

custEM     1.0.0
fenics     2019.1
pygimli    1.1.0
tetgen     1.51

PETGEM

petgem     0.8
petsc      3.7
petsc4py   3.7
python     3.6.1
numpy      1.18.3
scipy      1.5.2
gmsh       4.5.4

SimPEG

The following an excerpt from the SimPEG-scooby report. You can get your own either in Python via SimPEG.Report() or in the terminal via python -c 'import SimPEG; print(SimPEG.Report())'.

                OS : Linux
            CPU(s) : 8
           Machine : x86_64
      Architecture : 64bit
               RAM : 413.4 GB
       Environment : Python
  Python 3.7.9 | packaged by conda-forge | (default, Dec  9 2020, 21:08:20)
  [GCC 9.3.0]
            SimPEG : 0.14.3
        discretize : 0.6.2
       pymatsolver : 0.1.2
        vectormath : 0.2.2
        properties : 0.6.1
             numpy : 1.19.2
             scipy : 1.2.1
        matplotlib : 3.3.4

3d-csem-open-source-landscape's People

Contributors

lheagy avatar moouuzi avatar ocastilloreyes avatar prisae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

3d-csem-open-source-landscape's Issues

3D Model

3D Model

You can find the 3D model in the notebook notebooks/MarlimR3D.ipynb.

Questions:

  • We have to define our survey. The model is very extensive, and I think we should just have one line or so.
  • The paper only presents the data as is; they do not compare the model with and without hydrocarbons in the reservoir. I wonder how big the difference would be.
  • How feasible is this model for everyone? The original model has some 466 million cells, for the calculation they reduced it to 90 million cells, if we just do a line or two then we can reduce that much further I think.
  • The model is VTI, OK for everyone?

Any inputs on this model @Moouuzi, @ocastilloreyes, @lheagy ?

That is how the horizontal resistivities look like:

Selection_001

Marlim R3D

Papers

DATA

Model and survey lines

... TODO Model and Survey...

3D block model

... TODO Results ...

(Related to #4.)

Scripting language

I started with the Geophysics-LaTeX format, as I had that at hand.

But thinking about it, I guess it would be better if we make a Sphinx-doc using .rst-files. This way, a lot would already be rendered simply on GitHub (except math, but there won't be too much of that in this article), and we could link it to rtfd.org to have it compiled properly each time. I think this would be nicer to collaborate on GitHub.

The biggest advantage would be, that at the end we could easily include it, or part of it, into our code documentations for each project (except MARE3DEM, I don't think you use Sphinx for documentation, right?).

The only downside is that at the end we'll have to copy-paste-transfer it to the journal format. But that is a one-time thing and should not take a lot of time.

What do you think? (@lheagy, @Moouuzi, @ocastilloreyes, @kerrykey)

Public repository

I started the paper-repo in a private repo on my GitHub. However, in the spirit of open-source, and given that nobody can takes us away our codes anyway (no-one will steal our paper idea), we should probably do the whole thing in the open.

I thought about making a public repo

However, if you prefer a neutral space we could also do it at

What do you think? (@lheagy, @Moouuzi, @ocastilloreyes, @kerrykey)

Block model embedded in 1D VTI background

1D Model

You can find the 1D model in the notebook notebooks/BlockModel.ipynb.

Please have a look and give your feedback (@lheagy, @Moouuzi, @ocastilloreyes). If everybody is fine with it then we can fix this, so everyone can try to model it with their codes.

I used a rather coarse grid now for testing, so precision is not overwhelming right now (but with roughly 2 minutes reasonably fast to calculate). I might refine this for emg3d once we agree on the model.

Questions:

  • How do you need the data? Is this notebook sufficient?
  • Should we make it VTI? Can all the codes handle VTI resistivity?
  • Currently x-directed dipole, 200 m long. Could make that an arbitrary rotated dipole - can all codes handle arbitrary rotated dipoles?

Model and survey lines

Peek 2019-10-21 10-31
Peek 2019-10-21 10-12

1D background, compared to empymod

1dbackground

3D block model

3dblockmodel

(Related to #4.)

Now I will try to get the Marlim R3D model working...

Scope

I think this paper can get easily too long, as we are potentially including five different codes. So I would personally limit it to

  • code description; which should include;
    • Equation system it solves;
    • the used discretization possibilities;
    • domains (frequency, time);
    • details (anisotropy; el. perm. and mag. perm.);
    • other things (inversion; other methods);
    • speed and memory estimation;
    • plans for next features.
  • forward modelling with numerical results (see #4)
  • discussion about the landscape, where which model excels and why, etc.

So in this scenario, the inversion capabilities fall under Code Description. Input by mail from others:

Lindsey:

One thing that would be nice to speak about (though examples might be out of scope) would be the inversion side of things. This has enough scope that it could be a follow-up paper later on, but giving a few thoughts on how to move forward on inverting data might be a worthwhile addition. This might fit under a more generic heading along the lines of "Moving forward" or similar that would give a bit of space to also talk about future plans for each project.

Raphael:

I agree to Lindsey that discussing and working on 3D CSEM inversion is the next step. Nevertheless, I tend to Dieter’s primary idea to focus on modeling only for now. Maybe we could add a few comments on the potential of our modeling codes for inversion.

Paper Title

The current working title is

Status of the open-source landscape for 3D CSEM modeling

but we can probably come up with something better. Please put your ideas here.

Models

Which numerical models should we show?

I suggest:

  1. layered model, comparing it to semi-analytical solution, e.g., empymod; the canonical model; we don't have to explain a lot for this, simple to show they all calculate the same and also the same as semi-analytical solutions.
  2. complex marine case, e.g., the SEG/EAGE salt model (https://nbviewer.jupyter.org/github/empymod/emg3d-examples/blob/master/2a_SEG-EAGE_3D-Salt-Model.ipynb)
  3. complex land case with a non-block model.

(2) will probably favour regular meshes, as the model is in a regular mesh. To equalize that, (3) should be a complex model, where the regular meshes will have to do some interpolation.

I don't think in this paper we have to show the latest and greatest of modelling; but rather things which ALL modellers can do, and mention if some modellers can do more in one direction or in another etc.

For the above reason I would also limit it to the frequency-domain at the moment, but mention which codes have time-domain built in as well etc.

Raphael:

Before we start, we should agree about the reference model setups, i.e., the CSEM environment (marine, land etc.), transmitter types (HED, real 3D sources , etc.), layers, anisotropy, frequencies, anomalies... If the idea is that all codes calculate all models, there are probably restrictions about the model design. This is in principle no problem, but I think our reference models should distinguish from something like HED Tx in blocky geometries. I’m rather flexible with custEM, so I’m open to any suggestions. Moreover, in my opinion it would be great to have at least one model related to a currently challenging scenario in the field of exploration geophysics.

Journal

Where shall we submit?

  • Geophysical Prospecting
  • Geophysics
  • Computers and Geosciences
  • ?

I am thinking of GP at the moment, but I am very open to suggestions.

Other codes

There exists probably at least a dozen or more open-source EM 3D modelling codes outside of geophysics, which could also be used to model CSEM data. This is obviously outside of the scope of this paper, but we should have a paragraph mentioning it, and citing a few.

Authors (how many, order)

Things to discuss:

  • Author order (probably to be discussed at the end)
  • How many authors per code?

I thought about one author per code, which would give five authors. But then some of the projects are bigger and might have more contributors, so we could think about max. 2 authors per code, which then would give max. 10 authors? Opinions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.