Closed GGDRriedel closed 4 years ago
I guess the error occurs in the ttinv.invert()
step? So we can focus on that part. Can you attach the data file (data.save(filename, 's g t')
) and the mesh (or code for generating it), so that we can try to reproduce it? Maybe it has already been solved in a more recent version.
Indeed! crosshole.py.txt datafile.#dt.txt dtreader.py.txt thefile.sgt.txt
I am generating the data from the #dt file, the .sgt is the one generated by dat.save.
Code is a bit messy since I am iteratively working from your example
I cannot run the code due to missing dependencies (dtreader), and it is indeed too messy. Can you please just attach the mesh (`mesh.save() or the x and y vectors) so that we can just use the last 5 lines of the code and not the messy part at the beginning.
dtreader is in the files but nevertheless here is the mesh themesh.bms.txt
I noticed that in my setup the scheme has 804 data points while the data coming out of the simulation has 777
can you add a screenshot of how the synthetic model looks like?
No idea whether there are some invalid data reducing the number of data. Anyway, the following script
import matplotlib as mpl
import pygimli as pg
from pygimli.physics.traveltime import TravelTimeManager as Refraction # pg 1.1
# from pygimli.physics.traveltime import Refraction # pg1.0
mpl.rcParams['image.cmap'] = 'inferno_r'
data = pg.DataContainer('thefile.sgt', "s g")
mesh = pg.Mesh('themesh.bms')
ttinv = Refraction()
ttinv.setData(data)
ttinv.setMesh(mesh, secNodes=5)
invmodel = ttinv.invert(lam=1100, vtop=2000, vbottom=2000,
zWeight=1.0, maxIter=1, verbose=True)
ax, _ = ttinv.showResult()
works (using Python 3.7 from Anaconda on Windows) using pyGIMLi 1.1: but not in pyGIMLi 1.0.12.1 (leading to the mentioned PhiD error) I'll check that in detail.
Mesh and sensors.
It's probably fixed in a later version since most errors I get seem to be of numerical nature.
I'll try to update to the branch and come back with info.
EDIT: Just noticed that it's not released yet and I do not have the time to go through compilation and so on so I'll have to wait it out. Thanks anyway, maybe there's still something funky going on with the data.
@GGDRriedel Release candidates of pygimli 1.1 are available in the test channel: https://anaconda.org/gimli/pygimli/files?version=1.1.0rc5
conda install -c gimli/label/test -c conda-forge pygimli=1.1.0rc5
Unlike in the crosshole traveltime example https://www.pygimli.org/_examples_auto/seismics/plot_3_crosshole_tomography.html your sensors are no nodes in the mesh. While in pyGIMLi 1.1 this seems to be accounted for by choosing the nearest node, in version 1.0 this seems to lead to inaccurate Jacobian matrix. We will not fix this for v1.0 anymore.
Anyway, I guess node-free meshes will lead to inaccuracies also in v1.1. Therefore we recommend (particularly for real-world cases) creating a triangular mesh with all sensor positions in a box instead of a rectangular mesh. This works for both v1.0 and v1.1.
A reasonable synthetic model should have some structure (otherwise an infinite regularization parameter will lead to a constant model that fits the data) and also some Gaussian noise (with its std used as error) so that the regularization parameter can be chosen accordingly. I see nothing more to do here and close the issue.
What do you mean by "in a box" ?
A box is a rectangle bounding the domain like in the crosshole example https://www.pygimli.org/_examples_auto/seismics/plot_3_crosshole_tomography.html where all sensors are added as nodes. Please have a look at that.
Problem description
Loaded in my own S/G Geometry for a crosshole tomography Forward simulation works fairly well.
Trying to set picked times in crosshole tomography
Your environment
Operating system: Win 7 Python version: 3.6 pyGIMLi version: 0.11 Way of installation: Conda Wheel
Steps to reproduce
Tell us how to reproduce this issue. Ideally, you could paste the code that produces the error:
Expected behavior
Inversion running with new t values
Actual behavior
Throws an error