IsoSpike with Iolite 4

The new standalone version of Iolite has a built in Python interpreter, allowing very flexible post-processing of your data. IsoSpike leverages this new subsystem, using Python libraries to do the double-spike correction. This is fully extensible, with additional post-processing being easily accommodated.

Requirements

  • Iolite4
  • Python libraries:
    • Scipy
    • Numpy
    • Pandas

Installation

Install from .zip file

You can download the files in a zip archive from GitHub. Extract the downloaded .zip to your preferred location.

Install with Git
git clone https://github.com/thisisjohnc/isospike isospike/ && cd isospike/IsoSpike_for_Iolite4

This will clone the isospike files into the folder isospike/ and then move to the folder with the Python files for Iolite4.

Setup

In Iolites preferences, add ;IsoSpike_for_Iolite4\Addons\; to the Python Site Packages. IsoSpike will then be automatically loaded with Iolite. Note: there must be a semicolon between entries.

Usage

To use IsoSpike, make the following additions to your DRS:

  1. import IsoSpike
  2. define your DS parameters
  3. call IsoSpike
  4. post-processing

The following code blocks demonstrate each of those steps.

1. Import IsoSpike

In the DRS initialisation, import IsoSpike:

from IsoSpike_iolite4 import IsoSpike
2. Define your DS parameters

In the DRS, define the static double-spike parameters (natural composition, spike composition, and log of the mass ratios), and store in an array:

## example using Pt isotopes
rationames=['Pt195/Pt194','Pt196/Pt194','Pt198/Pt194'] ## This is used to generate channel names later in the DRS  
unmixedRatios=[1.0303605,0.7717145,0.2232910]
spikeRatios=[1.838948,19.31747,38.37810]
logMassRatios=[0.005153188,0.010270037,0.020439027]
DSsettings=np.array([unmixedRatios,spikeRatios,logMassRatios])
3. Call IsoSpike

Once you have finished your preparatory steps in your DRS, particularly calculating the raw ratios, call IsoSpike as follows:

result_array=IsoSpike(DSsettings,input_ratio1,input_ratio2,input_ratio3)

## example using Pt isotopes
# result_array=IsoSpike(DSsettings,Raw195_194,Raw196_194,Raw198_194)

The results are thus stored in result_array. Of course, the whole point is to be able to view and interrogate the data in Iolite – see below.

4. Post-processing

The IsoSpike_results array can then be referenced in the DRS and used in Iolite in the same way as any channel, and viewed in the Time Series or Results windows.

The following code is one way of doing that, and will automaticaly process the IsoSpike outputs into channels that you can interact with in Iolite.

#unpack results
x=ones*result_array[:,0]
y=ones*result_array[:,1]
z=ones*result_array[:,2]
DScorr_ratio1=ones*result_array[:,3]
DScorr_ratio2=ones*result_array[:,4]
DScorr_ratio3=ones*result_array[:,5]
deltaratio1=ones*result_array[:,6]
deltaratio2=ones*result_array[:,7]
deltaratio3=ones*result_array[:,8]

#create time series in Iolite
data.createTimeSeries("lambda",data.Output, indexChannel.time(),x)
data.createTimeSeries("alpha",data.Output, indexChannel.time(),y)
data.createTimeSeries("beta",data.Output, indexChannel.time(),z)    
data.createTimeSeries("DScorr"+rationames[0],data.Output, indexChannel.time(),DScorr_ratio1)
data.createTimeSeries("DScorr"+rationames[1],data.Output, indexChannel.time(),DScorr_ratio2)
data.createTimeSeries("DScorr"+rationames[2],data.Output, indexChannel.time(),DScorr_ratio3)    
data.createTimeSeries("Delta"+rationames[0],data.Output, indexChannel.time(),deltaratio1)
data.createTimeSeries("Delta"+rationames[1],data.Output, indexChannel.time(),deltaratio2)
data.createTimeSeries("Delta"+rationames[2],data.Output, indexChannel.time(),deltaratio3)

#create splines on the DS corrected ratios for the standard
StdSpline1 = data.spline(rmName, 'DScorr'+rationames[0]).data()
StdSpline2 = data.spline(rmName, 'DScorr'+rationames[1]).data()
StdSpline3 = data.spline(rmName, 'DScorr'+rationames[2]).data()

#calculate internally normalised delta values
DeltaInt_ratio1 = ((DScorr_ratio1/StdSpline1)-1)*1000
DeltaInt_ratio2 = ((DScorr_ratio2/StdSpline2)-1)*1000
DeltaInt_ratio3 = ((DScorr_ratio3/StdSpline3)-1)*1000
data.createTimeSeries("DeltaInt"+rationames[0],data.Output, indexChannel.time(),DeltaInt_ratio1)
data.createTimeSeries("DeltaInt"+rationames[1],data.Output, indexChannel.time(),DeltaInt_ratio2)
data.createTimeSeries("DeltaInt"+rationames[2],data.Output, indexChannel.time(),DeltaInt_ratio3)

Beyond the DRS

One of the great things about Iolite including a Python interpreter is that it becomes possible to add in any additional post-processing steps you can imagine. I’m open to collaborations, so if you have a good idea and you want some help to develop it, please feel free to drop me a line.