API

Python

Below you’ll find documentation for the iolite Python API. The current API is still in beta, so may change without notice although we’ll try very hard not to make any significant changes.

The following documentation assumes that you’re comfortable coding in Python. We recommend reading through the python examples at https://github.com/iolite-LA-ICP-MS/iolite4-python-examples to see how the API works.

Not included in the following documentation are the following Types.

There are three types of timeSeries:

  • Input
  • Intermediate
  • Output

e.g. to get a list of all the input channels, use data.timeSeriesNames(data.Input)

There are also three types of selection group:

  • Baseline
  • ReferenceMaterial
  • Sample

e.g. to get a list of all the reference material selection groups used in the current experiment, use data.selectionGroupNames(data.ReferenceMaterial)

Python examples

Below is a short example showing how to guess the dwell times based on minimum cps jumps in channel, just as an introduction. A complete suite of examples is available at https://github.com/iolite-LA-ICP-MS/iolite4-python-examples

import numpy as np
from iolite.TimeSeriesData import TimeSeriesData

for c in data.timeSeriesList(TimeSeriesData.tsInput):
        if c.name == 'TotalBeam':
                continue

        di = np.diff(c.data())
        di = np.abs(di[~np.isnan(di)])
        di = di[np.nonzero(di)]
        guess = 1000/np.min(di)
        if guess != guess:
                guess = 10

        print('%s = %i'%(c.name, guess))
        c.setProperty('Dwell Time (ms)', guess)