Closed filefolder closed 1 year ago
Hi Robert,
A couple of questions:
(1) Which version of PyVoroTomo are you using? Hongjian and I have slightly different versions, and his should probably be the authoritative version. (2) What is your starting model? And can you reproduce the error in a minimal example?
I am suspecting that this is an edge-case phenomenon, in which a ray is propagating along the boundary of the model where there isn't enough information to define a proper 3-D gradient vector. This can happen, for example, when you have a ray propagating between a surface source and surface receiver in a homogeneous velocity model.
I'm using the PyVoro currently on github, master branch, I think the last commit was March 2021. If there is a newer version I would be keen to try it as I use it quite often.
Just got this error this morning on a different model, it's a new one to me, and because I have recently updated PyKonal it may be the result of some new behaviour or change in traveltime_inventory
? (edit: yeah looks like that was this https://github.com/malcolmw/pykonal/commit/946cd139eaf1d954018f44b48715b193b4048b6c)
2023045T01:04:27::INFO::0000:: Relocating events.
2023045T01:04:27::ERROR::0001:: _relocate_events_de() raised <class 'TypeError'>: Argument 'traveltime_inventory' has incorrect type (expected str, got dict)
2023045T01:04:27::ERROR::0001:: relocate_events() raised <class 'TypeError'>: Argument 'traveltime_inventory' has incorrect type (expected str, got dict)
2023045T01:04:27::ERROR::0001:: iterate() raised <class 'TypeError'>: Argument 'traveltime_inventory' has incorrect type (expected str, got dict)
2023045T01:04:27::ERROR::0001:: main() raised <class 'TypeError'>: Argument 'traveltime_inventory' has incorrect type (expected str, got dict)
I will keep trying to isolate the issue, maybe widen the model or remove shallow events. I might also downgrade pykonal on the chance it's a version issue.. which hadn't occurred to me until just now.
@filefolder, the new error is a quick fix. I did update the TraveltimeInventory
class initializer: It no longer needs the station_dict
argument. You just need to provide the path
argument.
Regarding PyVoroTomo, I believe you are using the most recent version, unless Hongjian has made any changes that aren't reflected in his public repository.
You might try wrapping Line 789 in a try except
block to print the offending event, station pair information so you can recreate a minimal example. Then I should be able to help you debug.
Thanks for the replies!
I seem to have managed to get this working on an older machine, so the model and data are likely OK. I think what happened was that the velocity models were built on slightly different versions of PyKonal as well as on different versions of Python (e.g. 3.8 vs 3.11), and that was causing inconsistencies... somewhere? I have no good idea why, but it (hopefully) explains a lot of other strange glitches and random crashes as well that happened too infrequently to pin down. Since restricting everything to the same versions and py3.8 things seem to be going smoothly but will keep an eye on it.
FWIW to anyone else, I've made a branch of PVT here https://github.com/filefolder/PyVoroTomo that I think (haven't confirmed) fixes most of the outstanding issues and should run with 0.2.3.b4. I'll send a PR through eventually.
OK, thanks for the feedback. I will keep an eye out for issues with Python 3.11. Looking forward to your PR.
Hi Malcolm,
I am struggling with an onset case of "Encountered NaN gradient" when using pyvorotomo, but I think this is happening in pykonal somewhere. Have you experienced this or know what the issue may be? I was initially thinking that some of my event-station distances were too close, and indeed sometimes very close arrivals this generated
None
raypaths, but removing these hasn't solved the issue. I don't have issues with other regions/velocity models so I'm guessing that's the culprit, but I don't see anything obviously wrong with it or understand how that would matter anyway.Here is the error... seems to track back to line 639 of fields.pyx (
gg = np.moveaxis(np.stack([g0, g1, g2]), 0, -1)
) but again, I am at a loss to understand why. I am using a relatively new numpy 1.24.1 ...?Any insights appreciated... even if there's a way to failsafe this functions against NaNs or divide by zeros that I am missing.