In [1]:
from particle import *
from ui_interface import *
from amedata import *
from ring import Ring
from chartplot import *
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
#%matplotlib osx
In [2]:
ame_data = AMEData(DummyIFace())
chart_plot = ChartPlot()
In [3]:
p = Particle(6, 6, ame_data, Ring('ESR', 108.5))
p.qq = 3
p.ke_u = 422
p.path_length_m = 108.5
p.f_analysis_mhz = 245
p.i_beam_uA = 1.2
In [4]:
# do some calculations
p.get_magnetic_rigidity()
Out[4]:
In [5]:
for pp in p.get_isobars():
print(pp)
In [6]:
# get some nuclides
some_nuclides = p.get_nuclides(12, 24, 13, 26, 1)
# color them according to some criterion
for pp in some_nuclides:
if pp.get_lifetime() == 'stbl':
pp.chart_fill_color = Particle.FILL_COLOR_STABLE
# plot them
chart_plot.bulk_plot(some_nuclides)
In [7]:
# Get some nuclides
some_nuclides = np.array([])
for pp in p.get_nuclides(0, 82, 0, 126, 1):
info = [pp.tbl_aa, pp.tbl_binen_kev]
some_nuclides = np.append(some_nuclides, info)
some_nuclides = np.reshape(some_nuclides, (int(np.shape(some_nuclides)[0]/2), 2))
In [8]:
# plot the quantity
plt.plot(some_nuclides[:,0], some_nuclides[:,1], 'g')
plt.grid()
plt.title('BE/u vs. A')
plt.xlabel('A')
plt.ylabel('BE/u [keV]')
Out[8]:
In [9]:
# Get some nuclides
some_nuclides = np.array([])
for pp in p.get_nuclides(2, 40, 12, 36, 3):
info = [pp.tbl_aa, pp.get_ionic_moq()]
some_nuclides = np.append(some_nuclides, info)
some_nuclides = np.reshape(some_nuclides, (int(np.shape(some_nuclides)[0]/2), 2))
In [10]:
# plot the quantity
plt.plot(some_nuclides[:,0], some_nuclides[:,1], 'b.')
plt.grid()
plt.title('ionic m/Q vs. A')
plt.xlabel('A')
plt.ylabel('ionic m/Q')
Out[10]:
In [11]:
res = p.identify(244.6, 244.7, 2, 2, 2, 0.01)
print(res)
In [ ]:
In [ ]: