malcolmw / pykonal

Travel-time calculator based on the fast-marching method solution to the Eikonal equation.
https://malcolmw.github.io/pykonal-docs/
GNU General Public License v3.0
154 stars 55 forks source link

Spherical solver doesn't work for a certain range of src_phi values. #8

Closed hanbao-ucla closed 4 years ago

hanbao-ucla commented 4 years ago

Hi Malcolm,

I'm having a problem with the 'spherical solver' that when src_phi is assigned a range of values, the solver cannot be properly solved.

I attached a jupyter notebook file and a python code for your convenience. Archive.zip

You may first look at line 97, when src_phi is smaller than pi (3.1415926...), the solver works, but when src_phi is larger than pi (you may uncomment line 98)m the solver doesn't work.

Thanks a lot for your help!

Best, Han

malcolmw commented 4 years ago

Thanks for opening this issue, @baobaohan. It looks like there are a few data files that I need to run the notebook you attached: (a) iasp91.npz and (b) Vp_model.dat. Will you attach those please?

Thanks, Malcolm

hanbao-ucla commented 4 years ago

Hi Malcolm,

Oh! My bad! Sorry about that. Please ignore the previous attachment and use the following one. Thanks!

Archive.zip

malcolmw commented 4 years ago

Got it. Thanks, @baobaohan. I will try to debug this today or tomorrow.

hanbao-ucla commented 4 years ago

Thanks a lot Malcolm!

malcolmw commented 4 years ago

Hi, @baobaohan. This turned out to be caused by an internal inconsistency in the range of φ—i.e. [-π, π) versus [0, 2π). I just published a new release (v0.2.3b2) that resolves this, at least for the example you attached above. Give it a try and let me know if you find any other issues.

Thanks again!

hanbao-ucla commented 4 years ago

Hi Melcolm,

Thanks a lot! I will try to test it with a range of sources's location and let you know if there is any other issues!

Best, Han

malcolmw commented 4 years ago

Hi, @baobaohan,

I am going to close this issue as fixed. Please feel free to reopen if you come across any other issues. Thanks again for helping to debug!

hanbao-ucla commented 4 years ago

Hi Malcolm,

No problem! And sorry for the late confirmation. It now works without any problem for all sorts of source locations I used.

Again, thanks for all the help so far. This is a great package that I wish I can explore and exploit more and more. Thanks!

Best, Han