tof-simulator is a package to simulate the spectra from a Time-of-Flight mass spectrometer.
It has capabilities to analyze substances from convenient names and may be used as a python module in a script or interactively as a Graphical program.
The package may be used in three different forms:
- Python module in a script. Something like:
from tofsim import ToF
# Create the TOF with all isotopes from Ar and Kr
T = ToF('Ar','Kr')
# Adjust the TOF parameters
T.Vs = 120 # Extraction voltaje
T.Vd = 3000 # Acceleration voltaje
T.signal() # Make the spectra
p = T.get_statistics_peaks() # Get the peaks
print(p) # Print the peaks- Gtk GUI interface tof_gtk
- Web GUI interface tof_stl
Note
See Project page: https://github.com/fiolj/tof-simulator
Install using pip, either system-wide (administrator rights are needed)
pip install tof-simulator
or (usually preferred) for the current user:
pip install --user tof-simulator
Note
The installation as described above does not include GUI systems, they are optional
To install the optional Gtk GUI use:
pip install --user tof-simulator[gtk]
The optional Web GUI uses streamlit ( https://streamlit.io/ ), and can be installed as:
pip install --user tof-simulator[stl]
In order to install from source, you can:
Clone the project
git clone https://github.com/fiolj/tof-simulator
Go to the local folder of the project and build the package:
cd tof-simulator python3 -m build
Install the recently created package
pip install --user dist/tofsim-4.0-py3-none-any.whl[gtk,stl]
In order to run the simulator programmatically:
- Only Numpy is required.
- Optionally, matplotlib is needed to use included capabilities for plotting.
To use the Gtk GUI, the requirements are:
-
Information on how to install PyGobject on different platforms may be found in the documentation
To use the Gtk GUI, the requirements are:
Copyright (C) 2020 Juan Fiol
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Further information on installation, dependencies and use may be found in the documentation.

