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

Not able to compute or plot arrival times/ rays using bellhop model in python #101

Open
vtzirakis opened this issue Mar 25, 2024 · 3 comments
Assignees

Comments

@vtzirakis
Copy link

Hello!

I'm trying to use python to simulate marine environments and compute rays, arrival times etc, as I am not familiar with matlab. All works fine ( I can set and plot the environment), however when I try to compute the rays or arrival times ( arrivals = pm.compute_arrivals(env) ) I get the following message in jupyter:

[WARN] Bellhop did not generate expected output file.

As a result I can not plot the rays or arrival times, as the variable values are probably set to Nan or something. Specifically, when I try to plot arrival times I get this error:

AttributeError Traceback (most recent call last)
Cell In[16], line 2
1 arrivals = pm.compute_arrivals(env)
----> 2 pm.plot_rays(arrivals, env=env, width=900)

File ~\AppData\Roaming\Python\Python311\site-packages\arlpy\uwapm.py:478, in plot_rays(rays, env, invert_colors, **kwargs)
461 def plot_rays(rays, env=None, invert_colors=False, **kwargs):
462 """Plots ray paths.
463
464 :param rays: ray paths
(...)
476 >>> pm.plot_rays(rays, width=1000)
477 """
--> 478 rays = rays.sort_values('bottom_bounces', ascending=False)
479 max_amp = _np.max(_np.abs(rays.bottom_bounces)) if len(rays.bottom_bounces) > 0 else 0
480 if max_amp <= 0:

AttributeError: 'NoneType' object has no attribute 'sort_values'

I do not know what the problem is and since there is not much information online about bellhop in python, I am stuck. Any help would be really appriciated. Thanks in advance!

Vassilis

@mchitre
Copy link
Member

mchitre commented Mar 28, 2024

Run your code with debug=True and copy out the generated files. Looking at their content might give you a hint as to what is wrong.

@mchitre mchitre self-assigned this Mar 28, 2024
@Arthanor
Copy link

Arthanor commented Nov 26, 2024

Hi, I assume the previous poster managed to find their issue and, instead of opening a new one, I figured this is quite appropriate since I also cannot generate rays (in the domain I need).

The problem is that rays with more vertical source angles bounce off the bottom and go off the domain to the left.
Image
In the prt files, there is a message like:
ray is outside the box where the ocean soundspeed is defined x = ( r, z ) = -1027.3710183331586 25.478280757985310
As far as I am concerned, those rays are lost. Is there a way to tell Bellhop to stop tracing them?

I saw something about drawing a box out of which Bellhop stops tracing rays (http://oalib.hlsresearch.com/Rays/HLS-2010-1.pdf page 10), but didn't find anything about how to define it in arlpy. It is automatically set to 101% of the distance to the furthest receiver, and indeed defining an extra sound speed column at 102% of the distance, but backwards, fixed it. Would it be possible to define that value (and by extension its depth equivalent) in arlpy? The current values are good for defaults, but it would be good to be able to set them as well. Also, I assume that is more dependent on Bellhop, but it would be great to be able to define the box in -range, or just stop tracing rays that go into "negative" range.
Thanks in advance!

@mchitre
Copy link
Member

mchitre commented Nov 27, 2024

arlpy supports a subset of all the options provided by BELLHOP based on common usage. If you find something that you need from BELLHOP but that isn't supported by arlpy yet, I am happy to take a PR that adds that option to arlpy.

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

3 participants