def newtoncalc(plot_input, xbin, ybin):
     p_ion1, p_ion2, p_ion3, ion1, ion2, ion3 = plot_input
     px1, py1, pz1 = p_ion1
     px2, py2, pz2 = p_ion2
     px3, py3, pz3 = p_ion3
     dot1_2 = px1*px2 + py1*py2 + pz1*pz2
     dot1_3 = px1*px3 + py1*py3 + pz1*pz3
     pmag1 = np.sqrt(px1**2 + py1**2 + pz1**2)
     pmag2 = np.sqrt(px2**2 + py2**2 + pz2**2)
     pmag3 = np.sqrt(px3**2 + py3**2 + pz3**2)
     px2_newton = dot1_2/pmag1
     py2_newton = np.sqrt(pmag2**2 - px2_newton**2)
     px3_newton = dot1_3/pmag1
     py3_newton = -np.sqrt(pmag3**2 - px3_newton**2)
     px_newton = np.concatenate((px2_newton/pmag1, px3_newton/pmag1))
     py_newton = np.concatenate((py2_newton/pmag1, py3_newton/pmag1))
     plt.style.use('default')
     fig, ax = plt.subplots(1, 1)
     title = 'Newton Plot Relative to {}'.format(ion1)
     fig.canvas.set_window_title(title)
     hist2d(px_newton, py_newton, ax, title, 'Relative X Momentum', 
            'Relative Y Momentum', xbinsize=xbin, ybinsize=ybin, 
            color_map='viridis')
     ax.quiver(1, 0, color='r', scale=1, scale_units='x', headlength=4,
               headaxislength=4)
     ax.axhline(y=0, color='black', linewidth=0.8)
     ax.axvline(x=0, color='black', linewidth=0.8)
     ax.text(1.02, 0.08, ion1, fontsize=12)
     ax.text(0.01, 0.93, ion2, fontsize=12, transform=ax.transAxes)
     ax.text(0.01, 0.03, ion3, fontsize=12, transform=ax.transAxes)
     ax.set_xlim(-5, 5)
     ax.set_ylim(-5 ,5)
示例#2
0
 def dalitz3(self, xbin, ybin):
     epsilon1 = self.ke_tot1 / self.ker
     epsilon2 = self.ke_tot2 / self.ker
     epsilon3 = self.ke_tot3 / self.ker
     x_data = (epsilon2 - epsilon3) / (3**(1 / 2))
     y_data = epsilon1 - 1 / 3
     plt.style.use('default')
     fig, ax = plt.subplots(1, 1)
     fig.canvas.set_window_title('Dalitz Plot 3')
     xlabel = r'$(\epsilon_2 - \epsilon_3)/\sqrt{3} $'
     ylabel = r'$\epsilon_1 - \frac{1}{3}$'
     hist2d(x_data,
            y_data,
            ax,
            'Dalitz Plot',
            xlabel,
            ylabel,
            xbinsize=xbin,
            ybinsize=ybin,
            color_map='viridis')
     ax.set_xlim(-0.6, 0.6)
     ax.set_ylim(-0.4, 0.6)
     ax.set_aspect('equal')
     circle = mpatches.Circle((0, 0), 1 / 3, fill=False, linestyle='--')
     ax.add_patch(circle)
     ax.xaxis.label.set_size(12)
     ax.yaxis.label.set_size(12)
     plt.tight_layout()
示例#3
0
 def cos_ker(self):
     cos = self.pz1 / np.sqrt(self.px1**2 + self.py1**2 + self.pz1**2)
     plt.style.use('dark_background')
     fig, ax = plt.subplots(1, 1)
     fig.canvas.set_window_title('Cos(theta) vs. KER')
     hist2d(self.ker, cos, ax,
            r'{}, {} Cos($\theta$) vs. KER'.format(self.ion1, self.ion2),
            'Kinetic Energy Release (eV)', r'Cos($\theta$)')
示例#4
0
 def mom_sphere(self, xbin, ybin):
     plt.style.use('dark_background')
     fig, [ax1, ax2, ax3] = plt.subplots(1, 3)
     fig.suptitle('Momentum Spheres {}'.format(self.ion1))
     fig.canvas.set_window_title('Momentum Spheres')
     hist2d(self.px1,
            self.py1,
            ax1,
            '$P_x$ vs. $P_y$',
            '$P_x$',
            '$P_y$',
            xbinsize=xbin,
            ybinsize=ybin,
            colorbar=False)
     hist2d(self.py1,
            self.pz1,
            ax2,
            '$P_y$ vs. $P_z$',
            '$P_y$',
            '$P_z$',
            xbinsize=xbin,
            ybinsize=ybin,
            colorbar=False)
     hist2d(
         self.pz1,
         self.px1,
         ax3,
         '$P_z$ vs. $P_x$',
         '$P_z$',
         '$P_x$',
         xbinsize=xbin,
         ybinsize=ybin,
     )