# irfpy.vima.massring¶

Calculate mass ring number from energy and mass in Vex IMA Bible.

The way of calculating the mass ring number from energy and mass is described in the ImaBible.pdf file. This module implements that.

 rm(e_per_q, m_per_q, pi) Return Rm. dm(e_per_q, m_per_q, pi) Return Dm. massline(m_per_q, pi[, enestep]) Return the iso-mass contour.

Users may use rm() function to calculate the mass ring number from energy and mass together with PACC index. The mass ring number looks to have 0-based index. It may say that the range of mass ring number could be (-0.5, 31.5).

>>> print('{:.2f}'.format(rm(100, 32, 3)))     # Mass ring number for 100 eV/q, 32 amu/q particle with PACC=3.
8.49


dm() will give the width, although it is almost always 1.2.

Users also want to know the iso-mass line. This will be done by massline() function.

>>> energies, masses = massline(32, 6, enestep=np.logspace(1, 4, 96))
>>> print('{e:.2f} {m:.2f}'.format(e=energies, m=masses))
29.76 7.03


See also the example in snippet_mima.mima_masscontour.

Details: The table contains the table needed for calculation. It is 8-element list, but only used for 0, 3, and 6th element. Each corresponds to the table for each PACC. The table is (5, 12) shaped. Contents is in _load_table4() function.

>>> print(_table.shape)
(5, 12)
>>> print(_table)
None

irfpy.vima.massring.rm(e_per_q, m_per_q, pi)[source]

Return Rm.

>>> Rm = rm(1200, 12.8, 0)    # M/q = 12.8 for PACC=0

Parameters
• e_per_q – Energy per charge (in eV/q)

• m_per_q – Mass per charge (in amu/q)

• pi – Pacc index, 0, 3 or 6.

Returns

Mass ring number.

>>> print('{:.2f}'.format(float(Rm)))
15.29

>>> Rm = rm(2400, 37.6, 3)    # M/q = 37.6 for PACC=3
>>> print('{:.2f}'.format(float(Rm)))
5.26

>>> Rm = rm(750, 3.75, 6)    # M/q = 3.75 for PACC=6
>>> print('{:.2f}'.format(float(Rm)))
14.78

>>> Rm = rm(100, 12.8, 0)    # M/q = 12.8 for PACC=0
>>> print('{:.2f}'.format(float(Rm)))
67.50

>>> Rm = rm(250, 37.6, 3)    # M/q = 37.6 for PACC=3
>>> print('{:.2f}'.format(float(Rm)))
7.45

>>> Rm = rm(350, 3.75, 6)    # M/q = 3.75 for PACC=6
>>> print('{:.2f}'.format(float(Rm)))
17.15

irfpy.vima.massring.massline(m_per_q, pi, enestep=None)[source]

Return the iso-mass contour.

For the given mass and post acceleration, the mass ring numbers as a function of energies are returned.

Parameters
• m_per_q – Mass per charge (amu/q)

• pi – Post acceleration index. 0, 3, or 6.

• enestep – Energy step. Default is logspace(0, 4, 96).

Returns

(enestep, massring) with each element np.array with shape of given enestep.

irfpy.vima.massring.dm(e_per_q, m_per_q, pi)[source]

Return Dm.

Parameters
• e_per_q – Energy per charge (in eV/q)

• m_per_q – Mass per charge (in amu/q)

• pi – Pacc index, 0, 3 or 6.

Returns

Mass ring number.

>>> Dm = dm(1200, 12.8, 0)    # M/q = 12.8 for PACC=0
>>> print('{:.2f}'.format(float(Dm)))
1.72

>>> Dm = dm(2400, 37.6, 3)    # M/q = 37.6 for PACC=3
>>> print('{:.2f}'.format(float(Dm)))
1.51

>>> Dm = dm(750, 3.75, 6)    # M/q = 3.75 for PACC=6
>>> print('{:.2f}'.format(float(Dm)))
2.15

>>> Dm = dm(100, 12.8, 0)    # M/q = 12.8 for PACC=0
>>> print('{:.2f}'.format(float(Dm)))
6.36

>>> Dm = dm(250, 37.6, 3)    # M/q = 37.6 for PACC=3
>>> print('{:.2f}'.format(float(Dm)))
0.90

>>> Dm = dm(350, 3.75, 6)    # M/q = 3.75 for PACC=6
>>> print('{:.2f}'.format(float(Dm)))
2.27