def on_close(self, e): """ Close the window and update self.config from the new values. :param e: Unused event :return: None """ self.config.mzsig = simp_string_to_value(self.outmzsig.GetValue()) self.config.dtsig = simp_string_to_value(self.outdtsig.GetValue()) self.config.psfun = self.ctlpsfun.GetSelection() self.Destroy() self.EndModal(0)
def on_plot(self, e): """ Plot a predicted peak shape based on the values input into the control. :param e: Unused event :return: None """ self.on_center(e) sigguess = simp_string_to_value(self.ctlsigguess.GetValue()) midguess = np.argmax(self.centdat[:, 1]) aguess = np.amax(self.centdat[:, 1]) if self.flipflag == 0: self.psfun = self.ctlpsfun.GetSelection() fitdat = make_peak_shape(self.centdat[:, 0], self.psfun, sigguess, self.centdat[midguess, 0]) else: fitdat = make_peak_shape(self.centdat[:, 0], 0, sigguess, self.centdat[midguess, 0]) self.plot1.plotrefreshtop(self.centdat[:, 0], self.centdat[:, 1], title="Data", xlabel="m/z (Th)", ylabel="Normalized Intensity", zoom="span") self.plot1.plotadd(self.centdat[:, 0], fitdat * aguess, "blue", "Peak Shape Guess", nopaint=False)
def on_plot(self, e): """ For the sigma value in the self.ctrlmzsig, plot a simulated peak. :param e: Unused event :return: None """ self.on_center(e) self.psfun = self.ctlpsfun.GetSelection() sigguess = simp_string_to_value(self.ctlmzsig.GetValue()) midguess = np.argmax(self.centdat[:, 1]) aguess = np.amax(self.centdat[:, 1]) fitdat = make_peak_shape(self.centdat[:, 0], self.psfun, sigguess, self.centdat[midguess, 0]) self.plot1.plotrefreshtop(self.centdat[:, 0], self.centdat[:, 1], title="Data", xlabel="m/z (Th)", ylabel="Normalized Intensity", zoom="span") self.plot1.plotadd(self.centdat[:, 0], fitdat * aguess, "blue", "Peak Shape Guess", nopaint=False)