diff --git a/jdaviz/configs/cubeviz/plugins/cube_listener.py b/jdaviz/configs/cubeviz/plugins/cube_listener.py
index d862b78a8b..f981e6e8f2 100644
--- a/jdaviz/configs/cubeviz/plugins/cube_listener.py
+++ b/jdaviz/configs/cubeviz/plugins/cube_listener.py
@@ -43,7 +43,7 @@ def sonify_spectrum(spec, duration, overlap=0.05, system='mono', srate=44100, fm
data = {'spectrum': [spec], 'pitch': [1]}
# again, use maximal range for the mapped parameters
- lims = {'spectrum': ('0', '100')}
+ lims = {'spectrum': (0, '100')}
# set up source
sources = Events(data.keys())
diff --git a/jdaviz/configs/cubeviz/plugins/sonify_data/sonify_data.py b/jdaviz/configs/cubeviz/plugins/sonify_data/sonify_data.py
index cbf240011e..049b829b25 100644
--- a/jdaviz/configs/cubeviz/plugins/sonify_data/sonify_data.py
+++ b/jdaviz/configs/cubeviz/plugins/sonify_data/sonify_data.py
@@ -39,13 +39,14 @@ class SonifyData(PluginTemplateMixin, DatasetSelectMixin, SpectralSubsetSelectMi
"""
template_file = __file__, "sonify_data.vue"
- sample_rate = IntHandleEmpty(44100).tag(sync=True)
- buffer_size = IntHandleEmpty(2048).tag(sync=True)
+ sample_rate = 44100 #IntHandleEmpty(44100).tag(sync=True)
+ buffer_size = 2048 #IntHandleEmpty(2048).tag(sync=True)
assidx = FloatHandleEmpty(2.5).tag(sync=True)
ssvidx = FloatHandleEmpty(0.65).tag(sync=True)
eln = Bool(True).tag(sync=True)
audfrqmin = FloatHandleEmpty(50).tag(sync=True)
audfrqmax = FloatHandleEmpty(1000).tag(sync=True)
+ use_pccut = Bool(True).tag(sync=True)
pccut = IntHandleEmpty(20).tag(sync=True)
volume = IntHandleEmpty(100).tag(sync=True)
stream_active = Bool(True).tag(sync=True)
@@ -101,7 +102,7 @@ def vue_sonify_cube(self, *args):
self.flux_viewer.get_sonified_cube(self.sample_rate, self.buffer_size,
selected_device_index, self.assidx, self.ssvidx,
self.pccut, self.audfrqmin,
- self.audfrqmax, self.eln)
+ self.audfrqmax, self.eln, self.use_pccut)
# Automatically select spectrum-at-spaxel tool
spec_at_spaxel_tool = self.flux_viewer.toolbar.tools['jdaviz:spectrumperspaxel']
diff --git a/jdaviz/configs/cubeviz/plugins/sonify_data/sonify_data.vue b/jdaviz/configs/cubeviz/plugins/sonify_data/sonify_data.vue
index 697315b87d..032b7f4ab9 100644
--- a/jdaviz/configs/cubeviz/plugins/sonify_data/sonify_data.vue
+++ b/jdaviz/configs/cubeviz/plugins/sonify_data/sonify_data.vue
@@ -42,26 +42,6 @@
Advanced Sound Options
-
-
-
-
-
-
-
+
+
+
+
@@ -158,8 +146,7 @@
Volume
-
-
\ No newline at end of file
+
diff --git a/jdaviz/configs/cubeviz/plugins/viewers.py b/jdaviz/configs/cubeviz/plugins/viewers.py
index 6740966cea..4cc4d32d7d 100644
--- a/jdaviz/configs/cubeviz/plugins/viewers.py
+++ b/jdaviz/configs/cubeviz/plugins/viewers.py
@@ -135,7 +135,7 @@ def update_volume_level(self, level):
self.sonified_cube.atten_level = int(1/np.clip((level/100.)**2, MINVOL, 1))
def get_sonified_cube(self, sample_rate, buffer_size, device, assidx, ssvidx,
- pccut, audfrqmin, audfrqmax, eln):
+ pccut, audfrqmin, audfrqmax, eln, use_pccut):
spectrum = self.active_image_layer.layer.get_object(statistic=None)
wlens = spectrum.wavelength.to('m').value
flux = spectrum.flux.value
@@ -161,11 +161,12 @@ def get_sonified_cube(self, sample_rate, buffer_size, device, assidx, ssvidx,
# make a rough white-light image from the clipped array
whitelight = np.expand_dims(clipped_arr.sum(-1), axis=2)
- # subtract any percentile cut
- clipped_arr -= np.expand_dims(pc_cube, axis=2)
+ if use_pccut:
+ # subtract any percentile cut
+ clipped_arr -= np.expand_dims(pc_cube, axis=2)
- # and re-clip
- clipped_arr = np.clip(clipped_arr, 0, np.inf)
+ # and re-clip
+ clipped_arr = np.clip(clipped_arr, 0, np.inf)
self.sonified_cube = CubeListenerData(clipped_arr ** assidx, wlens, duration=0.8,
samplerate=sample_rate, buffsize=buffer_size,