# 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)
Somthing like this: