def plot(self):
     tof1,x1,y1,tof2,x2,y2,tof3,x3,y3,delay,adc1,adc2,index = self.xyt_list
     l = float(self.l_entry.get())
     z0 = float(self.z0_entry.get())
     vz0 = float(self.vz0_entry.get())
     x_jet = float(self.x_entry.get())
     vx_jet =float(self.vx_entry.get())
     y_jet = float(self.y_entry.get())
     vy_jet = float(self.vy_entry.get())
     C = float(self.c_entry.get())
     t0 = float(self.t0_entry.get())
     conv = 0.457102 #conversion factor from mm/ns to atomic units
     self.param_list = [l, z0, vz0, x_jet, vx_jet, y_jet, vy_jet, C, t0]
     acc1 = self.acc(1, l, z0, self.m1, C) #acceleration of 1st ion
     acc2 = self.acc(1, l, z0, self.m2, C) #acceleration of 2nd ion
     acc3 = self.acc(1, l, z0, self.m3, C) #acceleration of 3rd ion
     vx1_cm = ((x1 - (x_jet))/(tof1 - t0)) - (vx_jet)  
     vy1_cm = ((y1 - (y_jet))/(tof1 - t0)) - (vy_jet) 
     vx2_cm = ((x2 - (x_jet))/(tof2 - t0)) - (vx_jet)
     vy2_cm = ((y2 - (y_jet))/(tof2 - t0)) - (vy_jet)
     vx3_cm = ((x3 - (x_jet))/(tof3 - t0)) - (vx_jet)
     vy3_cm = ((y3 - (y_jet))/(tof3 - t0)) - (vy_jet)
     vz1_cm = (l-z0)/(tof1-t0) - (1/2)*acc1*(tof1-t0) + vz0
     vz2_cm = (l-z0)/(tof2-t0) - (1/2)*acc2*(tof2-t0) + vz0
     vz3_cm = (l-z0)/(tof3-t0) - (1/2)*acc3*(tof3-t0) + vz0
     px1 = self.m1 * vx1_cm * conv
     px2 = self.m2 * vx2_cm * conv
     px3 = self.m3 * vx3_cm * conv
     py1 = self.m1 * vy1_cm * conv
     py2 = self.m2 * vy2_cm * conv
     py3 = self.m3 * vy3_cm * conv
     pz1 = self.m1 * vz1_cm * conv
     pz2 = self.m2 * vz2_cm * conv
     pz3 = self.m3 * vz3_cm * conv
     
     ptotx = px1 + px2 + px3
     ptoty = py1 + py2 + py3
     ptotz = pz1 + pz2 + pz3
    
     
     self.ax1.clear()
     self.ax2.clear()
     self.ax3.clear()
     h1, edge1 = hist1d(ptotx, self.ax1, 'X Momentum Sum',
                        'X Momentum (a.u.)','Counts', output=True)
     h2, edge2 = hist1d(ptoty, self.ax2, 'Y Momentum Sum',
                        'Y Momentum (a.u.)','', output=True)
     h3, edge3 = hist1d(ptotz, self.ax3, 'Z Momentum Sum',
                        'Z Momentum (a.u.)', output=True)
     if self.tog_state.get() == 1:
         self.gaussfit(edge1, h1, [1,0,1], self.ax1)
         self.gaussfit(edge2, h2, [1,0,1], self.ax2)
         self.gaussfit(edge3, h3, [1,0,1], self.ax3)
         
     self.canvas.draw()
Пример #2
0
 def plot_energy(self, binsize='default'):
     plt.style.use('default')
     fig, ax = plt.subplots(1, 1)
     fig.canvas.set_window_title('Ion Kinetic Energy and Total KER')
     hist1d(self.ke_tot1, ax, '', '', '', binsize=binsize)
     hist1d(self.ke_tot2, ax, '', '', '', binsize=binsize)
     hist1d(self.ke_tot3, ax, '', '', '', binsize=binsize)
     hist1d(self.ker, ax, '{} , {}, {} Kinetic Energy'.format(self.ion1, 
            self.ion2, self.ion3), 'Kinetic Energy (eV)', 'Counts', 
            binsize=binsize)
     ax.legend([self.ion1, self.ion2, self.ion3, 'Total KER'])
Пример #3
0
 def plot_psum(self, binsize='default'):
     plt.style.use('default')
     fig, ax = plt.subplots(1, 3)
     fig.canvas.set_window_title('Momentum Sums')
     hist1d(self.ptotx,
            ax[0],
            'X Momentum Sum',
            'X Momentum (a.u.)',
            'Counts',
            binsize=binsize)
     hist1d(self.ptoty,
            ax[1],
            'Y Momentum Sum',
            'Y Momentum (a.u.)',
            '',
            binsize=binsize)
     hist1d(self.ptotz,
            ax[2],
            'Z Momentum Sum',
            'Z Momentum (a.u.)',
            '',
            binsize=binsize)
     title = (self.ion1 + ', ' + self.ion2 + ', ' + self.ion3 +
              ' Momentum Sums')
     fig.suptitle(title)
Пример #4
0
 def plot_energy(self, binsize='default'):
     fig, ax = plt.subplots(1, 3)
     fig.canvas.set_window_title('Ion Kinetic Energy and KER')
     hist1d(self.ke_tot1,
            ax[0],
            '{} Kinetic Energy'.format(self.ion1),
            'Kinetic Energy (eV)',
            'Counts',
            binsize=binsize)
     hist1d(self.ke_tot2,
            ax[1],
            '{} Kinetic Energy'.format(self.ion2),
            'Kinetic Energy (eV)',
            '',
            binsize=binsize)
     hist1d(self.ker,
            ax[2],
            'Kinetic Energy Release',
            'Kinetic Energy (eV)',
            '',
            binsize=binsize)
Пример #5
0
 def plot_pxyz(self):
     plt.style.use('default')
     fig, [ax1, ax2, ax3] = plt.subplots(1, 3)
     fig.suptitle('{} Momentum'.format(self.ion1))
     fig.canvas.set_window_title('Ion 1 XYZ Momentum')
     hist1d(self.px1, ax1)
     hist1d(-(self.px1), ax1, 'X Momentum', 'Momentum (a.u.)', 'Counts')
     ax1.legend(['$P_x$', '$-P_x$'], loc=1)
     hist1d(self.py1, ax2)
     hist1d(-(self.py1), ax2, 'Y Momentum', 'Momentum (a.u.)')
     ax2.legend(['$P_y$', '$-P_y$'], loc=1)
     hist1d(self.pz1, ax3)
     hist1d(-(self.pz1), ax3, 'Z Momentum', 'Momentum (a.u.)')
     ax3.legend(['$P_z$', '$-P_z$'], loc=1)
     fig, [ax1, ax2, ax3] = plt.subplots(1, 3)
     fig.suptitle('{} Momentum'.format(self.ion2))
     fig.canvas.set_window_title('Ion 2 XYZ Momentum')
     hist1d(self.px2, ax1)
     hist1d(-(self.px2), ax1, 'X Momentum', 'Momentum (a.u.)', 'Counts')
     ax1.legend(['$P_x$', '$-P_x$'], loc=1)
     hist1d(self.py2, ax2)
     hist1d(-(self.py2), ax2, 'Y Momentum', 'Momentum (a.u.)')
     ax2.legend(['$P_y$', '$-P_y$'], loc=1)
     hist1d(self.pz2, ax3)
     hist1d(-(self.pz2), ax3, 'Z Momentum', 'Momentum (a.u.)')
     ax3.legend(['$P_z$', '$-P_z$'], loc=1)