From f4084981011f214b69bb3fa413bf5651152b0839 Mon Sep 17 00:00:00 2001 From: Peter Urban Date: Wed, 23 Oct 2024 15:01:21 +0200 Subject: [PATCH] make_wci: include transducer position when determining hmin and hmax of the image --- .../pingprocessing/watercolumn/image/make_wci.py | 5 +++-- .../pingprocessing/widgets/wciviewer.py | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python/themachinethatgoesping/pingprocessing/watercolumn/image/make_wci.py b/python/themachinethatgoesping/pingprocessing/watercolumn/image/make_wci.py index 3d094ed..25ee43d 100644 --- a/python/themachinethatgoesping/pingprocessing/watercolumn/image/make_wci.py +++ b/python/themachinethatgoesping/pingprocessing/watercolumn/image/make_wci.py @@ -163,8 +163,9 @@ def from_pings_and_limits( ping_offsets.append(ping_sensor_configurations[-1].get_target("Transducer")) # compute limits of the create image - if hmin is None: _hmin = np.nanmin([_hmin, np.nanmin(xyz.y)]) - if hmax is None: _hmax = np.nanmax([_hmax, np.nanmax(xyz.y)]) + tr_y = ping_offsets[-1].y + if hmin is None: _hmin = np.nanmin([_hmin, np.nanmin(xyz.y), tr_y]) + if hmax is None: _hmax = np.nanmax([_hmax, np.nanmax(xyz.y), tr_y]) if vmax is None: _vmax = np.nanmax([_vmax, np.nanmax(xyz.z)]) if hmin is None: hmin = _hmin * 1.1 diff --git a/python/themachinethatgoesping/pingprocessing/widgets/wciviewer.py b/python/themachinethatgoesping/pingprocessing/widgets/wciviewer.py index 7c7bff2..4244f16 100644 --- a/python/themachinethatgoesping/pingprocessing/widgets/wciviewer.py +++ b/python/themachinethatgoesping/pingprocessing/widgets/wciviewer.py @@ -221,6 +221,10 @@ def __init__(self, pings, horizontal_pixels=1024, name="WCI", figure=None, progr if show: display(self.layout) + def set_ping_sample_selector(self, ping_sample_selector): + self.args_imagebuilder["ping_sample_selector"] = ping_sample_selector + self.update_data(0) + def fix_xy(self, w): with self.output: xlim = self.ax.get_xlim()