Mass Spectrometry

Mass spectrometry is commonly used in catalysis and electrocatalysis for two different types of data - spectra, where intensity is taken while scanning over m/z, and multiple ion detection (MID) where the intensity of a small set of m/z values are tracked in time.

The main TechniqueMeasurement class for MID data is the MSMeasurement.

The position of spectra in ixdat is not completely set yet. Currently, they exist as Spectrum base class alongside Measurement. For more details see Spectrum

The ms module

Module for representation and analysis of MS measurements

class ixdat.techniques.ms.MSMeasurement(name, **kwargs)[source]

Class implementing raw MS functionality

default_exporter

alias of MSExporter

default_plotter

alias of MSPlotter

get_flux_series(mol)[source]

Return a ValueSeries with the calibrated flux of mol

grab_flux(mol, tspan=None, tspan_bg=None, remove_background=True, removebackground=None, include_endpoints=False)[source]

Return the flux of mol (calibrated signal) in [mol/s]

Note: - With native ixdat quantification (use_siq=False),

grab_flux(mol, …) is identical to grab(f”n_dot_{mol}”, …) with remove_background=True by default. An MSCalibration does the maths.

  • With an external quantification package (use_siq=True), the maths are done here with the help of self.quantifier

Parameters
  • mol (str or MSCalResult) – Name of the molecule or a ms_calibration thereof

  • tspan (list) – Timespan for which the signal is returned.

  • tspan_bg (list) – Timespan that corresponds to the background signal. If not given, no background is subtracted.

  • remove_background (bool) – Whether to remove a pre-set background if available Defaults to True.

  • removebackground (bool) – DEPRECATED. Use remove_background.

  • include_endpoints (bool) – Whether to interpolate for tspan[0] and tspan[-1]

grab_flux_for_t(mol, t, tspan_bg=None, remove_background=False, removebackground=None)[source]

Return the flux of mol (calibrated signal) in [mol/s] for a given time vec

Parameters
  • mol (str) – Name of the molecule.

  • t (np.array) – The time vector along which to give the flux

  • tspan_bg (tspan) – Timespan that corresponds to the background signal. If not given, no background is subtracted.

  • remove_background (bool) – Whether to remove a pre-set background if available

  • removebackground (bool) – DEPRECATED. Use remove_background.

grab_signal(*args, **kwargs)[source]

Alias for grab()

integrate_flux(mol, tspan, tspan_bg, ax=None)[source]

Integrate a calibrated ms signal with background subtraction and evt. plotting (copy of integrate_signal method)

TODO: Should this, like grab_signal does now, have the option of using a

background saved in the object rather than calculating a new one?

TODO: Ensure fill_between considers the non-standard unit in the figure

Parameters
  • mol (str) – The molecule name for which to integrate the signal

  • tspan (tspan) – The timespan over which to integrate

  • tspan_bg (tspan) – Timespan at which the signal is at its background value

  • ax (Axis) – axis to plot on. Defaults to None

integrate_signal(mass, tspan, tspan_bg, ax=None)[source]

Integrate a ms signal with background subtraction and evt. plotting

TODO: Should this, like grab_signal does now, have the option of using a

background saved in the object rather than calculating a new one?

Parameters
  • mass (str) – The mass for which to integrate the signal

  • tspan (tspan) – The timespan over which to integrate

  • tspan_bg (tspan) – Timespan at which the signal is at its background value

  • ax (Axis) – axis to plot on. Defaults to None

property mass_list

List of the masses for which ValueSeries are contained in the measurement

reset_bg(mass_list=None)[source]

Reset background values for all masses or the masses in mass_list

set_bg(tspan=None, tspan_bg=None, mass_list=None)[source]

Set background values for mass_list to the average signal during tspan_bg.

class ixdat.techniques.ms.MSSpectroMeasurement(name, **kwargs)[source]
default_exporter

alias of MSSpectroExporter

default_plotter

alias of MSSpectroPlotter

class ixdat.techniques.ms.MSSpectrum(*, name, technique='spectrum', metadata=None, sample_name=None, reader=None, tstamp=None, field=None, field_id=None, duration=None)[source]

Nothing to add to normal Spectrum yet. TODO: Methods for co-plotting ref spectra from a database

class ixdat.techniques.ms.MSSpectrumSeries(*args, **kwargs)[source]

Nothing to add to normal SpectrumSeries yet.