Package: ionics
InstallationRequirementsIf you are on Unix then all dependencies are installed automatically upon installation. If you are
using Windows then thenumpyandscipydependencies can’t be installed automatically as
they require precompiled binaries for the specific operating system. Scipy doesn’t support
binaries for Windows officially. Please consider the scipy installation instructions aboutscientific Python distributionsandinofficial binaries.The GUI usesPyQt4which must be installed separately (the GUI also supports PyQt5 which can be
installed similarly to the PyQt4 installation instructions below). You can use the package of course
without the GUI in your scripts by simply importing it. However if you want to use the GUI please
consider the following resources:Unix- You can downloaded the latest release fromhere. Please follow the installation
instructions on this website. Usually you have to build it from source which is fairly simple though.Windows- Download the correct PyQt4 version fromthis website;
make sure that you match your Python and OS version. Then open Powershell (press the Windows key
and type “Powershell” in the search field; we recommend to use the x86 version) and navigate to
the folder where you downloaded the.whlfile to (usuallyDownloads). Then install the
package viapip install<version>.whlwhere you replace<version>.whlwith the name of
the file you downloaded (you can use tab completion in Powershell).The GUI also usesmatplotlib; please visit theirwebsitefor the installation instructions.Installing the packageYou can install the package from pip by runningpip install ionics.Note:If you are using Windows then Python must have been added to your path in order for the
above command to succeed.UsageThe GUITo use the graphical user interface navigate to the directory where the package has been installed.
You can find it by runningpython-c"import ionics; print ionics.__file__". Within that
directory just runpython start_gui.py.Browsing cross sectionOn the left side you find a file browser exposing the cross section files that are contained by
theionicspackage. You can get a list of available cross sections by either clicking
on a directory (all cross section within that directory) or a module itself (all cross sections
within that module). The cross sections are shown in the window below the file browser.
By clicking on a cross section you can obtain information about them.Plotting cross sectionsTo plot a specific cross section drag and drop it onto a plot canvas on the right side.
You are prompted to enter the cross section’s specific parameters as well as the plot range.
You can also specify the scale for which the data should be generated (linearmeans the data is
evenly distributed,logmeans the data is exponentially distributed so it will be evenly
distributed when using a log-scale).Also:You can stack multiple single-differential cross sections by dropping them onto the same canvas.You can add a new canvas by clicking on the “add” button on the very right.You can change the scale for each axis at the bottom of the corresponding plot.Usage within your applicationsThis package contains various ionization cross sections as well as related auxiliary functions
(such as random sampling). Two kinds of ionization cross sections are provided:Single differential ionization cross sections (SDCS); seeionics.ddcs.Double differential ionization cross sections (DDCS); seeionics.sdcs.Required parameters for cross sections must be specified in their__init__methods. A cross
section can be evaluated by calling it (via__call__) (for the signature see the help text of
one of the cross sections). SDCS require the kinetic energy of the ionized particle as an argument
while DDCS also require the polar scattering angle (in addition).Random sampling is available for double differential cross sections. Two general methods are available
which are meant to work with any two-dimensional distribution:Inverse transform samplingRejection samplingPlease considerionics.ddcs.random_samplingfor more information.ExamplesUsing a double differential cross section:>>> from ionics.ddcs.voitkiv import VoitkivDDCS
>>> ddcs = VoitkivDDCS(4.0e12, 1, 'H')  # 4 TeV protons on Hydrogen.
>>> ddcs(10, pi/2)  # Kinetic energy 10eV, transverse scattering.
0.00043127346990368256