ion_tof_linear_fit#

atompy.physics.coltrims.ion_tof_linear_fit(tof_vs_m_over_q_pairs, show_plot=True, names=None, tof_unit='ns', m_over_q_unit='amu/a.u.', savefig_filename=None)[source]#

Perform a linear fit of TOF vs m/Q pairs

Parameters:
tof_vs_m_over_q_pairs[[float, float], …]

[(TOF_1, m_1/Q_1), (TOF_2, m_2/Q_2), …]

show_plotbool, default True

Plot data and fit and show it with plt.show().

namesSequence of str, optional

Optionally, provide a list of names/chemical formulas for m/Q len(names) must match len(tof_vs_m_over_q_pairs)

tof_unitstr, default ‘ns’

Units of provided TOFs

m_over_q_unitstr, default “amu/a.u.”

Units of provided m/Q

savefig_filenamestr, optional

Optionally, provide a filename to save the figure shown with show_plot = True.

Returns:
slopefloat

slope of the linear regression

interseptfloat

intersept (i.e., x=0)

delta_slopefloat

standard error of the slope

delta_interceptfloat

standard error of the intercept