Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions arlpy/uwapm.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,18 +524,18 @@ def plot_transmission_loss(tloss, env=None, **kwargs):
max_angle=45
)
>>> tloss = pm.compute_transmission_loss(env)
>>> pm.plot_transmission_loss(tloss, width=1000)
>>> pm.plot_transmission_loss(tloss,env, width=1000)
"""
xr = (min(tloss.columns), max(tloss.columns))
if env is None:
raise ValueError("Environment is required")
xr = (env['rx_range'].min(), env['rx_range'].max())
yr = (-max(tloss.index), -min(tloss.index))
xlabel = 'Range (m)'
if xr[1]-xr[0] > 10000:
xr = (min(tloss.columns)/1000, max(tloss.columns)/1000)
xr = (env['rx_range'].min()/1000, env['rx_range'].max()/1000)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the problem that tloss.columns is not correctly populated? If so, perhaps that's the place to fix this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes,'tloss.columns' is incorrect , but it was calculated by Acoustic Toolbox in fortran. Could only fix it in original package

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. I suggest that we still make env optional (recommended), but pick up rx_range from it if it is specified. Works?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for long time till now thatInoticed your reply but there are lots of works for me, I would try refix it in spare time.🥲🥲🥲

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, I understand. All of us have day jobs to take care of in addition to contributing to open source projects.

xlabel = 'Range (km)'
oh = _plt.hold()
_plt.image(20*_np.log10(_fi.epsilon+_np.abs(_np.flipud(_np.array(tloss)))), x=xr, y=yr, xlabel=xlabel, ylabel='Depth (m)', xlim=xr, ylim=yr, **kwargs)
if env is not None:
plot_env(env, rx_plot=False)
_plt.hold(oh)

def pyplot_env(env, surface_color='dodgerblue', bottom_color='peru', tx_color='orangered', rx_color='midnightblue',
Expand Down