Skip to content

Commit

Permalink
Fix persistent bug in the GUI with pickradius
Browse files Browse the repository at this point in the history
  • Loading branch information
dlilien committed Nov 17, 2021
1 parent 8daa070 commit 1cf75b5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
# The short X.Y version.
version = '1.1'
# The full version, including alpha/beta/rc tags.
release = '1.1.3'
release = '1.1.4'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion impdar/gui/pickgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def _delete_picks(self, snum, tnum):
if not np.isnan(self.current_pick[1, tnum - 1]):
self.dat.picks.lasttrace.snum[self._pick_ind] = self.current_pick[1, tnum - 1]

def update_lines(self, colors='gmm', picker=None):
def update_lines(self, colors='gmm', picker=0):
"""Update the plotting of the current pick.
Parameters
Expand Down
33 changes: 17 additions & 16 deletions impdar/lib/load/load_bsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,29 +75,18 @@ def load_bsi(fn_h5, nans=None, *args, **kwargs):
h5_data.tnum = len(list(dset.keys()))
h5_data.snum = len(
dset['location_0']['datacapture_0']['echogram_0'])
lat = np.zeros((h5_data.tnum,))
lon = np.zeros((h5_data.tnum,))
h5_data.elev = np.zeros((h5_data.tnum,))
time = np.zeros((h5_data.tnum,))
h5_data.data = np.zeros((h5_data.snum, h5_data.tnum))

if type(dset['location_0']['datacapture_0']['echogram_0'].attrs['Digitizer-MetaData_xml']) == str:
digitizer_data = dset['location_0']['datacapture_0'][
'echogram_0'].attrs['Digitizer-MetaData_xml']
else:
digitizer_data = dset['location_0']['datacapture_0'][
'echogram_0'].attrs['Digitizer-MetaData_xml'].decode('utf-8')
h5_data.dt = 1.0 / float(
_xmlGetVal(digitizer_data, ' Sample Rate'))
h5_data.travel_time = np.arange(h5_data.snum) * h5_data.dt * 1.0e6

lat = np.zeros((h5_data.tnum,))
lon = np.zeros((h5_data.tnum,))
h5_data.elev = np.zeros((h5_data.tnum,))
time = np.zeros((h5_data.tnum,))

# Other information that ImpDAR currently cannot use
# _xmlGetVal(digitizer_data, 'vertical range')
h5_data.trig_level = float(
_xmlGetVal(digitizer_data, 'trigger level'))
time_offset = float(_xmlGetVal(digitizer_data, 'relativeInitialX'))
h5_data.travel_time = h5_data.travel_time + time_offset * 1.0e6

for location_num in range(h5_data.tnum):
# apparently settings can change mid-line
nsamps = dset['location_{:d}'.format(location_num)]['datacapture_0']['echogram_0'].shape[0]
Expand Down Expand Up @@ -139,6 +128,18 @@ def load_bsi(fn_h5, nans=None, *args, **kwargs):
time[location_num] = np.nan
h5_data.elev[location_num] = np.nan

h5_data.dt = 1.0 / float(
_xmlGetVal(digitizer_data, ' Sample Rate'))
h5_data.travel_time = np.arange(h5_data.snum) * h5_data.dt * 1.0e6

# Other information that ImpDAR currently cannot use
# _xmlGetVal(digitizer_data, 'vertical range')
h5_data.trig_level = float(
_xmlGetVal(digitizer_data, 'trigger level'))
time_offset = float(_xmlGetVal(digitizer_data, 'relativeInitialX'))
h5_data.travel_time = h5_data.travel_time + time_offset * 1.0e6


mask = ~np.isnan(time)
if nans == 'interp':
if np.any(~mask):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from Cython.Build import cythonize
ext_modules = cythonize(ext_modules)

version = '1.1.3'
version = '1.1.4'
packages = ['impdar',
'impdar.lib',
'impdar.bin',
Expand Down

0 comments on commit 1cf75b5

Please sign in to comment.