oscarbranson / latools

Tools for the reproducible reduction of LA-ICPMS data.
http://latools.readthedocs.io
MIT License
15 stars 10 forks source link

Calculate detection limits #42

Open oscarbranson opened 5 years ago

oscarbranson commented 5 years ago

Somthing like this:

# get analytes that aren't internal standard
non_ref_analytes = [a for a in dat.analytes if a != dat.internal_standard]

# calculate the X/internal_standard ratio in the background data
bkgratio = dat.bkg.raw.divide(dat.bkg.raw.loc[:, dat.internal_standard], axis='rows').loc[:, non_ref_analytes]
# calculate the X/internal_standard standard deviation in the background data.
bkgratio_std = bkgratio.std()

# get the calibration parameters for all the analytes
calib_ms = la.nominal_values(dat.calib_params).mean(0)

# calculate the X/internal_standard calibration limits.
detlim = 3 * bkgratio_std * calib_ms  # in mol / mol  internal_standard (in this case, Si29)