diff --git a/eispac/core/eisfitresult.py b/eispac/core/eisfitresult.py index 6cc9666..4e794f5 100644 --- a/eispac/core/eisfitresult.py +++ b/eispac/core/eisfitresult.py @@ -723,7 +723,7 @@ def shift2wave(self, array, wave=195.119): # FIXME: This function should actually use units this_wave = self.fit['wave_range'].mean() disp = np.zeros(len(array.shape)) - disp[0] = (ccd_offset(wave*u.Angstrom) - ccd_offset(this_wave*u.Angstrom)).to_value('pixel') + disp[0] = (ccd_offset(wave*u.Angstrom) - ccd_offset(this_wave*u.Angstrom)).to_value('pixel')[0] array = shift_img(array, disp) return array diff --git a/scripts/eis_explore_raster.py b/scripts/eis_explore_raster.py index a65c8d3..9003a18 100644 --- a/scripts/eis_explore_raster.py +++ b/scripts/eis_explore_raster.py @@ -1475,10 +1475,24 @@ def event_replot_all_spec(self): def event_reset_plot(self): """Clear and replot a selected raster or spectrum""" + #TO-DO: make a function for clearing objects from the plot r_ind = int(self.sender().objectName()[1]) plot_type = self.sender().objectName().split('_')[1] if plot_type.lower().startswith('rast'): + # If there is crosshair on the plot, remove it + if self.rast_crosshair[r_ind] is not None: + self.rast_crosshair[r_ind].remove() + self.rast_crosshair[r_ind] = None + + # If there are any lines plotted on the ax, remove them + if self.rast_axhline[r_ind] is not None: + self.rast_axhline[r_ind].remove() + self.rast_axhline[r_ind] = None + if self.rast_axvline[r_ind] is not None: + self.rast_axvline[r_ind].remove() + self.rast_axvline[r_ind] = None + self.rast_ax[r_ind] = None self.rast_fig[r_ind].clf() self.rast_lims[r_ind] = None