Example #1
0
    def do_fit_neon(self):
        self.peak_threshold = self.calib_threshold_entry.value()
        self.peak_threshold = float(self.peak_threshold)
        self.do_acquisition()
        self.neon_fit_param, self.neon_fit_data = pressure.neon_fit(
            self.wavelength, self.intensity, self.peak_threshold)
        if self.fit_plot is not None:
            self.ax.lines.remove(self.fit_plot_[0])
        self.fit_plot_ = self.ax.plot(self.wavelength,
                                      self.neon_fit_data,
                                      "b-",
                                      lw=1.5)
        self.fit_plot = 1
        self.canvas.draw()
        #Getting the fitted peaks positions
        n = len(self.neon_fit_param.keys()) - 1
        n = n / 4  #Number of peaks
        self.neon_peaks_positions = []  #fitted positions in wavelength
        for i in range(n):
            x = self.neon_fit_param["X%d" % i].value
            self.neon_peaks_positions.append(x)
        self.neon_peaks_positions = sorted(self.neon_peaks_positions)

        self.true_neon_wl_index = peak.get_index_from_values(
            __NEON_PEAKS__, self.neon_peaks_positions)
        self.neon_true_wavelength = __NEON_PEAKS__[self.true_neon_wl_index]

        self.measured_wl_pixel = peak.get_index_from_values(
            self.wavelength, self.neon_peaks_positions)
        self.calibrated_coefficients = pressure.calibration_coefficients(
            self.measured_wl_pixel, self.neon_true_wavelength)
Example #2
0
 def do_fit_neon(self):
     self.peak_threshold = self.calib_threshold_entry.value()
     self.peak_threshold = float(self.peak_threshold)
     self.do_acquisition()
     self.neon_fit_param, self.neon_fit_data = pressure.neon_fit(self.wavelength,self.intensity, self.peak_threshold)
     if self.fit_plot is not None:
         self.ax.lines.remove(self.fit_plot_[0])
     self.fit_plot_ = self.ax.plot(self.wavelength, self.neon_fit_data, "b-", lw=1.5)
     self.fit_plot = 1
     self.canvas.draw()
     #Getting the fitted peaks positions
     n = len(self.neon_fit_param.keys())-1
     n = n/4#Number of peaks
     self.neon_peaks_positions = []#fitted positions in wavelength
     for i in range(n):
         x = self.neon_fit_param["X%d"%i].value
         self.neon_peaks_positions.append(x)
     self.neon_peaks_positions = sorted(self.neon_peaks_positions)
     
     self.true_neon_wl_index = peak.get_index_from_values(__NEON_PEAKS__, self.neon_peaks_positions)
     self.neon_true_wavelength = __NEON_PEAKS__[self.true_neon_wl_index]
     
     self.measured_wl_pixel = peak.get_index_from_values(self.wavelength, self.neon_peaks_positions)
     self.calibrated_coefficients = pressure.calibration_coefficients(self.measured_wl_pixel, self.neon_true_wavelength)