Comments (6)
Thanks for reporting @jingxu94 . The entire construct_mesh()
-functionality is very new, so unfortunately it is possible that there are bugs, even though I tried to avoid them ;-)
As I explained in our earlier discussion, I can currently not reproduce the problem, so I cannot do debugging myself. I will therefore ask some questions, it would be great if you could help me with that. Hopefully we will get to the bottom of it.
Could you try to run the following and post the output?
import emg3d
z0, hz = emg3d.meshes.get_origin_widths(
frequency=1.0,
min_width_limits=100.0,
properties=[0.3, 2, 100],
center=-1000,
seasurface=0.0,
domain=[-2500, 0],
verb=2,
)
Just to ensure if the issue is in construct_mesh
or in get_origin_widths
.
from emg3d.
Similar error as follows:
Traceback (most recent call last):
File "c:/Users/JingXu/Desktop/code/start_emg3d/model_property_mapping/test_issue.py", line 9, in <module>
verb=2,
File "D:\Anaconda3\envs\tdem\lib\site-packages\emg3d\meshes.py", line 626, in get_origin_widths
thxr = hx[-1]*sa**np.arange(nx)
IndexError: index -1 is out of bounds for axis 0 with size 0
from emg3d.
That is really strange, I get the following without any issues:
Skin depth [m] : 276 / 712 / 5033 [corresponding to `properties`]
Survey domain DS [m] : -2500 - 0
Comp. domain DC [m] : -6974 - 31623
Final extent [m] : -8729 - 32628
Cell widths [m] : 100 / 100 / 9085 [min(DS) / max(DS) / max(DC)]
Number of cells : 48 (25 / 23 / 0) [Total (DS/DC/remain)]
Max stretching : 1.000 (1.000) / 1.380 [DS (seasurface) / DC]
I even recreated an environment fixing all the package versions to match yours, but I do not encounter the problem. I also tried it with pip
and with conda
, both work fine. The only difference that remains between your system and mine is Windows/Linux.
I will try and get hold of a Windows machine to test it.
from emg3d.
OK, I found the problem, it is a Windows issue. Int's default to 64 on Linux/Mac, but on Windows they default to 32. This caused an overflow problem in emg3d.meshes.good_mg_cell_nr
.
If you change line 780 (emg3d v0.14.1) from
primes = np.array([2, 3, 5, 7, 11, 13, 17, 19])
to
primes = np.array([2, 3, 5, 7, 11, 13, 17, 19], dtype=np.int64)
the problem will be fixed.
I will push an update shortly.
Thanks for reporting!
from emg3d.
Thinks, it works. That's a helpful tip for programming!
from emg3d.
(With #144 I will hopefully start to also test on Windows and Mac machines, which should avoid these sort of issues in the future, hopefully.)
from emg3d.
Related Issues (20)
- Include gallery
- Simulation: Reduce memory footprint for parallel execution HOT 1
- hdf5 sorting
- Improve jvec/jtvec
- BUG: Issues with `numba>=0.54.0` HOT 1
- ENH: Add option to remove empty Tx-Rx-f-pairs
- Set-up monthly cron job
- Improve save/load
- Improve build / install
- An issue to keep track of deprecations
- Improve / monitor CLI load time HOT 1
- CLI on Windows HOT 1
- ENH: Split misfit / gradient
- DOC: Improve documentation
- Docs down HOT 2
- `emg3d.TxMagneticDipole` shows wrong coordinates.
- Magnetic Sources HOT 3
- License HOT 1
- 'Survey' object has no attribute '_data' HOT 2
- Inversion
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emg3d.