Skip to content

Commit

Permalink
strip out unused wl bounds parameters,
Browse files Browse the repository at this point in the history
  • Loading branch information
James Trayford committed Jan 1, 2025
1 parent e77c182 commit b514570
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 1 addition & 3 deletions jdaviz/configs/cubeviz/plugins/cube_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ def sonify_spectrum(spec, duration, overlap=0.05, system='mono', srate=44100, fm

class CubeListenerData:
def __init__(self, cube, wlens, samplerate=44100, duration=1, overlap=0.05, buffsize=1024,
bdepth=16, wl_bounds=None, wl_unit=None, audfrqmin=50, audfrqmax=1500,
eln=False, vol=None):
bdepth=16, wl_unit=None, audfrqmin=50, audfrqmax=1500, eln=False, vol=None):
self.siglen = int(samplerate*(duration-overlap))
self.cube = cube
self.dur = duration
Expand All @@ -74,7 +73,6 @@ def __init__(self, cube, wlens, samplerate=44100, duration=1, overlap=0.05, buff
else:
self.atten_level = int(np.clip((vol/100)**2, MINVOL, 1))

self.wl_bounds = wl_bounds
self.wl_unit = wl_unit
self.wlens = wlens

Expand Down
6 changes: 3 additions & 3 deletions jdaviz/configs/cubeviz/plugins/sonify_data/sonify_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ def update_wavelength_range(self, event):
display_unit = self.spec_viewer.state.x_display_unit
# is this spectral selection or the entire spectrum?
if hasattr(self.spectral_subset.selected_obj, "subregions"):
wlbounds = self.spectral_subset.selected_obj.subregions
wlranges = self.spectral_subset.selected_obj.subregions
else:
wlbounds = None
self.flux_viewer.update_listener_wls(wlbounds, display_unit)
wlranges = None
self.flux_viewer.update_listener_wls(wlranges, display_unit)

@observe('volume')
def update_volume_level(self, event):
Expand Down
6 changes: 2 additions & 4 deletions jdaviz/configs/cubeviz/plugins/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def __init__(self, *args, **kwargs):
self.stream = None

self.sonification_wl_ranges = None
self.sonification_wl_bounds = None
self.sonification_wl_unit = None
self.volume_level = None
self.stream_active = True
Expand Down Expand Up @@ -115,8 +114,8 @@ def update_sonified_cube(self, x, y):
self.sonified_cube.newsig = self.sonified_cube.sigcube[x, y, :]
self.sonified_cube.cbuff = True

def update_listener_wls(self, wbounds, wunit):
self.sonification_wl_ranges = wbounds
def update_listener_wls(self, wranges, wunit):
self.sonification_wl_ranges = wranges
self.sonification_wl_unit = wunit

def update_sound_device(self, device_index):
Expand Down Expand Up @@ -170,7 +169,6 @@ def get_sonified_cube(self, sample_rate, buffer_size, device, assidx, ssvidx,

self.sonified_cube = CubeListenerData(clipped_arr ** assidx, wlens, duration=0.8,
samplerate=sample_rate, buffsize=buffer_size,
wl_bounds=self.sonification_wl_bounds,
wl_unit=self.sonification_wl_unit,
audfrqmin=audfrqmin, audfrqmax=audfrqmax,
eln=eln, vol=self.volume_level)
Expand Down

0 comments on commit b514570

Please sign in to comment.