Closed pan3rock closed 12 months ago
Hi @pan3rock, it looks like you uncovered a bug in the way that pykonal identifies neighbouring grid nodes near the pole... In the example above, there are actually 64 nodes at the north pole (i.e., all nodes with $\rho=\theta=0$) but only those with i_phi in [1, 63]
are considered neighbours to that with i_phi = 0
. Furthermore, the distance between these nodes is zero, which probably creates a divide by zero error I never handled properly.
If you set the traveltime to zero for all the nodes at the north pole, the example should work as expected.
for i_phi in range(solver.velocity.npts[2]):
src_idx = (0, 0, i_phi)
solver.traveltime.values[src_idx] = 0
solver.unknown[src_idx] = False
solver.trial.push(*src_idx)
solver.solve()
The above work around is obviously a hack and should be resolved properly within the pykonal package but I don't have time to work on this right now.
You're right. After the above corrections, the value of traveltime matches distances along great circle. Thanks a lot.
I thought the index 0 is R, index 1 is 90 - latitude and index 2 is longitude. However, I run the Spherical 2D example and then solver.traveltime.values[0, 1, :] show different values. I can't understand it the source is put at [0, 0, 0] (the North Pole), why are the values different for the same latitude? The values in the figure of that page seems the same. Thanks!
The code is below:
solver.traveltime.value
shows the same conclusion: different values are obtained for the same longitude. Because the velocities are always 1, the value with longtitude 0 is correct (111.19) but others are wrong.outputs: