def on_key_press(self, event): if event.key == 'i': if self.widget.mpl.ntb._active == 'PAN': self.widget.mpl.ntb.pan() if self.widget.mpl.ntb._active == 'ZOOM': self.widget.mpl.ntb.zoom() elif event.key == 's': self.session_ctrl.save_dpp_ppss() elif event.key == 'w': self.plot_new_graph() elif event.key == 'v': lims = self.widget.mpl.canvas.ax_pattern.axis() if self.widget.checkBox_BgSub.isChecked(): x, y = self.model.base_ptn.get_bgsub() else: x, y = self.model.base_ptn.get_raw() xroi, yroi = get_DataSection(x, y, [lims[0], lims[1]]) self.plot_ctrl.update([lims[0], lims[1], yroi.min(), yroi.max()]) else: key_press_handler(event, self.widget.mpl.canvas, self.widget.mpl.ntb)
def set_current_section(self, roi): x_section_bg, y_section_bg = get_DataSection( self.base_ptn.x_bg, self.base_ptn.y_bg, roi) __, y_section_bgsub = get_DataSection( self.base_ptn.x_bgsub, self.base_ptn.y_bgsub, roi) self.current_section.set(x_section_bg, y_section_bgsub, y_section_bg)
def get_single_section(self, roi): x_section_bg, y_section_bg = get_DataSection( self.base_ptn.x_bg, self.base_ptn.y_bg, roi) __, y_section_bgsub = get_DataSection( self.base_ptn.x_bgsub, self.base_ptn.y_bgsub, roi) return x_section_bg, y_section_bgsub, y_section_bg