Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to obtain a smooth pseudo-two-dimensional model? #800

Open
shdlovezxm opened this issue Dec 18, 2024 · 1 comment
Open

How to obtain a smooth pseudo-two-dimensional model? #800

shdlovezxm opened this issue Dec 18, 2024 · 1 comment

Comments

@shdlovezxm
Copy link

shdlovezxm commented Dec 18, 2024

Problem description

when i use “showStitchedModels”,i can not obtian a smooth pseudo-two-dimensional model. please help me. thank you very mush.

Your environment

Please provide the output of print(pygimli.Report()) here. If that does not
work, please give provide some additional information on your:

Operating system: e.g. Windows, Linux or Mac?
Windows
Python version: e.g. 3.9, 3.10, etc.?
3.9
pyGIMLi version: Output of print(pygimli.__version__)
1.5.0
Way of installation: e.g. Conda package, manual compilation from source, etc.
Conda package

Steps to reproduce

Tell us how to reproduce this issue. Ideally, you could paste the code that produces the error:
invModel = array([[2.50193293e-01, 3.56337073e-01, 3.13799558e-01, 2.61000166e-01,
2.85383570e-01, 3.75246433e-01, 4.73710369e-01, 5.48784141e-01,
6.41915479e-01, 7.52754538e-01, 8.57564269e-01, 9.48566418e-01,
1.02794202e+00, 1.09808430e+00, 1.16233340e+00, 1.22591199e+00,
1.29429576e+00, 1.37165118e+00, 1.46049162e+00, 1.56208585e+00,
1.67701782e+00, 1.80562472e+00, 1.94826267e+00, 2.10543397e+00,
2.27782735e+00, 2.46631482e+00, 2.67193434e+00, 2.89587326e+00,
3.13945840e+00, 8.45259606e+02, 2.31685630e+01, 9.25109881e+01,
7.22767559e+01, 4.68236864e+01, 3.42073115e+01, 3.59702715e+01,
5.29661467e+01, 8.04729165e+01, 1.05269999e+02, 1.17972727e+02,
1.22082288e+02, 1.25491374e+02, 1.33045579e+02, 1.46361734e+02,
1.65324444e+02, 1.88972689e+02, 2.15912612e+02, 2.44582549e+02,
2.73485682e+02, 3.01382393e+02, 3.27403695e+02, 3.51067527e+02,
3.72215039e+02, 3.90906827e+02, 4.07319534e+02, 4.21668065e+02,
4.34160430e+02, 4.44979322e+02, 3.04330879e+02],
[2.50189201e-01, 3.56338832e-01, 3.13799708e-01, 2.61000052e-01,
2.85383536e-01, 3.75246511e-01, 4.73710552e-01, 5.48784350e-01,
6.41915668e-01, 7.52754698e-01, 8.57564403e-01, 9.48566531e-01,
1.02794211e+00, 1.09808438e+00, 1.16233347e+00, 1.22591204e+00,
1.29429580e+00, 1.37165121e+00, 1.46049164e+00, 1.56208586e+00,
1.67701783e+00, 1.80562473e+00, 1.94826267e+00, 2.10543397e+00,
2.27782735e+00, 2.46631482e+00, 2.67193434e+00, 2.89587325e+00,
3.13945838e+00, 8.45256205e+02, 2.31683446e+01, 9.25106504e+01,
7.22766111e+01, 4.68236211e+01, 3.42072712e+01, 3.59702339e+01,
5.29661017e+01, 8.04728650e+01, 1.05269949e+02, 1.17972685e+02,
1.22082254e+02, 1.25491347e+02, 1.33045556e+02, 1.46361714e+02,
1.65324425e+02, 1.88972671e+02, 2.15912596e+02, 2.44582534e+02,
2.73485668e+02, 3.01382380e+02, 3.27403683e+02, 3.51067516e+02,
3.72215029e+02, 3.90906818e+02, 4.07319526e+02, 4.21668058e+02,
4.34160424e+02, 4.44979317e+02, 3.04330863e+02],
[2.50196055e-01, 3.56337795e-01, 3.13799665e-01, 2.61000082e-01,
2.85383562e-01, 3.75246563e-01, 4.73710650e-01, 5.48784471e-01,
6.41915788e-01, 7.52754808e-01, 8.57564502e-01, 9.48566618e-01,
1.02794219e+00, 1.09808445e+00, 1.16233352e+00, 1.22591208e+00,
1.29429583e+00, 1.37165123e+00, 1.46049166e+00, 1.56208588e+00,
1.67701784e+00, 1.80562473e+00, 1.94826268e+00, 2.10543397e+00,
2.27782734e+00, 2.46631482e+00, 2.67193433e+00, 2.89587325e+00,
3.13945837e+00, 8.45262054e+02, 2.31685430e+01, 9.25108136e+01,
7.22766389e+01, 4.68236213e+01, 3.42072647e+01, 3.59702225e+01,
5.29660832e+01, 8.04728396e+01, 1.05269921e+02, 1.17972659e+02,
1.22082232e+02, 1.25491327e+02, 1.33045539e+02, 1.46361698e+02,
1.65324411e+02, 1.88972657e+02, 2.15912582e+02, 2.44582521e+02,
2.73485655e+02, 3.01382368e+02, 3.27403672e+02, 3.51067506e+02,
3.72215020e+02, 3.90906810e+02, 4.07319519e+02, 4.21668052e+02,
4.34160419e+02, 4.44979312e+02, 3.04330848e+02],
[2.50223466e-01, 3.56331801e-01, 3.13799282e-01, 2.61000355e-01,
2.85383688e-01, 3.75246579e-01, 4.73710617e-01, 5.48784456e-01,
6.41915803e-01, 7.52754843e-01, 8.57564546e-01, 9.48566664e-01,
1.02794223e+00, 1.09808449e+00, 1.16233356e+00, 1.22591211e+00,
1.29429586e+00, 1.37165125e+00, 1.46049168e+00, 1.56208589e+00,
1.67701785e+00, 1.80562474e+00, 1.94826268e+00, 2.10543397e+00,
2.27782734e+00, 2.46631481e+00, 2.67193433e+00, 2.89587324e+00,
3.13945836e+00, 8.45285347e+02, 2.31694964e+01, 9.25118546e+01,
7.22769598e+01, 4.68237301e+01, 3.42073126e+01, 3.59702526e+01,
5.29661059e+01, 8.04728540e+01, 1.05269926e+02, 1.17972657e+02,
1.22082226e+02, 1.25491320e+02, 1.33045531e+02, 1.46361689e+02,
1.65324401e+02, 1.88972647e+02, 2.15912572e+02, 2.44582511e+02,
2.73485645e+02, 3.01382358e+02, 3.27403662e+02, 3.51067497e+02,
3.72215012e+02, 3.90906803e+02, 4.07319512e+02, 4.21668046e+02,
4.34160413e+02, 4.44979307e+02, 3.04330832e+02],
[2.50259090e-01, 3.56324190e-01, 3.13798796e-01, 2.61000691e-01,
2.85383843e-01, 3.75246597e-01, 4.73710578e-01, 5.48784438e-01,
6.41915821e-01, 7.52754883e-01, 8.57564595e-01, 9.48566715e-01,
1.02794228e+00, 1.09808453e+00, 1.16233359e+00, 1.22591214e+00,
1.29429588e+00, 1.37165128e+00, 1.46049169e+00, 1.56208590e+00,
1.67701786e+00, 1.80562475e+00, 1.94826268e+00, 2.10543397e+00,
2.27782734e+00, 2.46631481e+00, 2.67193432e+00, 2.89587323e+00,
3.13945835e+00, 8.45315694e+02, 2.31707178e+01, 9.25131696e+01,
7.22773600e+01, 4.68238643e+01, 3.42073711e+01, 3.59702887e+01,
5.29661326e+01, 8.04728702e+01, 1.05269931e+02, 1.17972654e+02,
1.22082219e+02, 1.25491311e+02, 1.33045521e+02, 1.46361680e+02,
1.65324391e+02, 1.88972637e+02, 2.15912561e+02, 2.44582500e+02,
2.73485635e+02, 3.01382348e+02, 3.27403653e+02, 3.51067488e+02,
3.72215003e+02, 3.90906795e+02, 4.07319505e+02, 4.21668039e+02,
4.34160407e+02, 4.44979302e+02, 3.04330815e+02],
[2.50281060e-01, 3.56319897e-01, 3.13798541e-01, 2.61000865e-01,
2.85383933e-01, 3.75246648e-01, 4.73710640e-01, 5.48784529e-01,
6.41915926e-01, 7.52754989e-01, 8.57564695e-01, 9.48566806e-01,
1.02794236e+00, 1.09808460e+00, 1.16233365e+00, 1.22591219e+00,
1.29429592e+00, 1.37165130e+00, 1.46049172e+00, 1.56208592e+00,
1.67701787e+00, 1.80562475e+00, 1.94826269e+00, 2.10543398e+00,
2.27782734e+00, 2.46631480e+00, 2.67193431e+00, 2.89587322e+00,
3.13945834e+00, 8.45334439e+02, 2.31714359e+01, 9.25138961e+01,
7.22775616e+01, 4.68239241e+01, 3.42073914e+01, 3.59702951e+01,
5.29661290e+01, 8.04728563e+01, 1.05269910e+02, 1.17972632e+02,
1.22082198e+02, 1.25491292e+02, 1.33045504e+02, 1.46361663e+02,
1.65324375e+02, 1.88972621e+02, 2.15912546e+02, 2.44582485e+02,
2.73485620e+02, 3.01382334e+02, 3.27403640e+02, 3.51067476e+02,
3.72214992e+02, 3.90906785e+02, 4.07319496e+02, 4.21668031e+02,
4.34160400e+02, 4.44979296e+02, 3.04330795e+02],
[2.50301947e-01, 3.56316372e-01, 3.13798348e-01, 2.61000982e-01,
2.85384002e-01, 3.75246727e-01, 4.73710774e-01, 5.48784698e-01,
6.41916098e-01, 7.52755149e-01, 8.57564837e-01, 9.48566931e-01,
1.02794247e+00, 1.09808469e+00, 1.16233373e+00, 1.22591225e+00,
1.29429597e+00, 1.37165134e+00, 1.46049174e+00, 1.56208594e+00,
1.67701788e+00, 1.80562476e+00, 1.94826269e+00, 2.10543398e+00,
2.27782734e+00, 2.46631480e+00, 2.67193430e+00, 2.89587321e+00,
3.13945833e+00, 8.45352399e+02, 2.31720671e+01, 9.25144702e+01,
7.22776957e+01, 4.68239535e+01, 3.42073935e+01, 3.59702850e+01,
5.29661062e+01, 8.04728214e+01, 1.05269870e+02, 1.17972594e+02,
1.22082165e+02, 1.25491264e+02, 1.33045479e+02, 1.46361640e+02,
1.65324354e+02, 1.88972601e+02, 2.15912527e+02, 2.44582466e+02,
2.73485602e+02, 3.01382318e+02, 3.27403624e+02, 3.51067461e+02,
3.72214979e+02, 3.90906773e+02, 4.07319485e+02, 4.21668022e+02,
4.34160392e+02, 4.44979288e+02, 3.04330771e+02],
[2.50334673e-01, 3.56309518e-01, 3.13797893e-01, 2.61001268e-01,
2.85384122e-01, 3.75246705e-01, 4.73710668e-01, 5.48784594e-01,
6.41916023e-01, 7.52755097e-01, 8.57564801e-01, 9.48566905e-01,
1.02794245e+00, 1.09808468e+00, 1.16233372e+00, 1.22591224e+00,
1.29429596e+00, 1.37165134e+00, 1.46049174e+00, 1.56208594e+00,
1.67701788e+00, 1.80562476e+00, 1.94826269e+00, 2.10543398e+00,
2.27782734e+00, 2.46631480e+00, 2.67193430e+00, 2.89587321e+00,
3.13945832e+00, 8.45380401e+02, 2.31731723e+01, 9.25156465e+01,
7.22780542e+01, 4.68240764e+01, 3.42074500e+01, 3.59703241e+01,
5.29661416e+01, 8.04728530e+01, 1.05269895e+02, 1.17972611e+02,
1.22082176e+02, 1.25491272e+02, 1.33045485e+02, 1.46361645e+02,
1.65324357e+02, 1.88972604e+02, 2.15912529e+02, 2.44582468e+02,
2.73485604e+02, 3.01382318e+02, 3.27403624e+02, 3.51067461e+02,
3.72214979e+02, 3.90906772e+02, 4.07319485e+02, 4.21668021e+02,
4.34160391e+02, 4.44979288e+02, 3.04330768e+02],
[2.50376767e-01, 3.56299600e-01, 3.13797215e-01, 2.61001751e-01,
2.85384321e-01, 3.75246624e-01, 4.73710396e-01, 5.48784312e-01,
6.41915804e-01, 7.52754939e-01, 8.57564686e-01, 9.48566819e-01,
1.02794238e+00, 1.09808463e+00, 1.16233368e+00, 1.22591222e+00,
1.29429594e+00, 1.37165132e+00, 1.46049173e+00, 1.56208593e+00,
1.67701788e+00, 1.80562476e+00, 1.94826269e+00, 2.10543398e+00,
2.27782734e+00, 2.46631480e+00, 2.67193430e+00, 2.89587321e+00,
3.13945833e+00, 8.45416207e+02, 2.31746954e+01, 9.25173995e+01,
7.22786382e+01, 4.68242935e+01, 3.42075599e+01, 3.59704086e+01,
5.29662266e+01, 8.04729357e+01, 1.05269963e+02, 1.17972661e+02,
1.22082211e+02, 1.25491296e+02, 1.33045503e+02, 1.46361659e+02,
1.65324369e+02, 1.88972614e+02, 2.15912538e+02, 2.44582476e+02,
2.73485611e+02, 3.01382324e+02, 3.27403630e+02, 3.51067466e+02,
3.72214983e+02, 3.90906776e+02, 4.07319488e+02, 4.21668024e+02,
4.34160393e+02, 4.44979290e+02, 3.04330774e+02],
[2.50412118e-01, 3.56291903e-01, 3.13796703e-01, 2.61002100e-01,
2.85384469e-01, 3.75246590e-01, 4.73710248e-01, 5.48784165e-01,
6.41915698e-01, 7.52754868e-01, 8.57564638e-01, 9.48566785e-01,
1.02794236e+00, 1.09808461e+00, 1.16233367e+00, 1.22591221e+00,
1.29429594e+00, 1.37165132e+00, 1.46049173e+00, 1.56208593e+00,
1.67701787e+00, 1.80562476e+00, 1.94826269e+00, 2.10543398e+00,
2.27782734e+00, 2.46631480e+00, 2.67193430e+00, 2.89587321e+00,
3.13945833e+00, 8.45446443e+02, 2.31759156e+01, 9.25187389e+01,
7.22790635e+01, 4.68244450e+01, 3.42076326e+01, 3.59704613e+01,
5.29662763e+01, 8.04729810e+01, 1.05269999e+02, 1.17972684e+02,
1.22082226e+02, 1.25491306e+02, 1.33045510e+02, 1.46361665e+02,
1.65324374e+02, 1.88972618e+02, 2.15912541e+02, 2.44582478e+02,
2.73485613e+02, 3.01382326e+02, 3.27403631e+02, 3.51067467e+02,
3.72214984e+02, 3.90906777e+02, 4.07319489e+02, 4.21668024e+02,
4.34160394e+02, 4.44979290e+02, 3.04330775e+02]])

xx = [ 0. 232.75461499 432.46834052 639.06297756 844.85345536
1026.61434152 1226.61434152 1444.35046474 1608.42002348 1792.74331924]
zz = [28.6756 26.3896 21.6216 21.1196 24.4406 28.1786 25.2286 19.9866 17.3696
14.8726]

thk = np.logspace(-0.5, 0.5, 29)

showStitchedModels(invModel, ax=ax, x=xx, cMap='Spectral_r', cMin=1, cMax=300, topo=zz,
logScale=False, title='stichmodel (Ohm.m)')

Expected behavior

I want obtain a smooth two-dimensional model。

Actual behavior

Tell us what happens instead and/or provide the output of your script.

Snipaste_2024-12-17_14-35-33

If possible, please add one or more labels to your issue, e.g. if you expect that your issue is rather a question than a problem with the code, please add the label "question".

@halbmy
Copy link
Contributor

halbmy commented Dec 18, 2024

So you want to interpolate your 1D models into a 2D model? I guess you could

  • create such a 2D model, e.g. by a triangular grid following your topography,
  • create arrays of x, z, res for the individual soundings
  • adding them together in a long array
  • use pg.interpolate() to interpolate them from points to the mesh cells

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants