Sorry for the delay in getting this to you, but here is a script that you can run to export data in the format you wanted (mean; 1sd; LOD).
You can copy and paste the following into iolite's Python Workspace and click Save As... to save it as a script. You can also call it from the Export View -> Export Script.
Please test it and let me know if you find any problems 😊
-Bence
import pandas as pd
from iolite.QtGui import QFileDialog
from iolite.QtCore import QDir
import sys
def getValuesDF(mode):
"""
Returns a pandas data frame for all selections in all groups (except
Baselines).
The value for each selection to be returned is based on mode:
Mean: mean of selection
OneSD: uncertainty as 1 SD
LOD: LOD (currently just Longerich value)
Returns pandas dataframe with columns as channels, and each row as a
selection
NOTE: The headers are un-named in the returned dataframe. This makes it
easier to concat/append dataframes
"""
df = pd.DataFrame()
selNames = []
for group in data.selectionGroupList():
if group.type == data.Baseline:
continue
for sel in group.selections():
if mode == 'Mean':
res = [data.result(sel, ch).value() for ch in data.timeSeriesList(data.Output)]
elif mode == 'OneSD':
res = [data.result(sel, ch).uncertainty("Basic", "AbsOneStdDev") for ch in data.timeSeriesList(data.Output)]
elif mode == 'LOD':
res = [data.result(sel, ch).longerichLOD() for ch in data.timeSeriesList(data.Output)]
else:
print("ERROR: mode argument must be one of \"Mean\", \"OneSD\", or \"LOD\"")
return
df[sel.name] = res
selNames.append(sel.name)
# Now transpose it so that each selection is a row instead of a column
df = df.transpose()
# And add the sel name as column
df.insert(0, 'Name', selNames)
return df
df_vals = getValuesDF('Mean')
df_vals = df_vals.append(pd.Series(), ignore_index=True)
df_unc = getValuesDF('OneSD')
df_unc = df_unc.append(pd.Series(), ignore_index=True)
df_lod = getValuesDF('LOD')
df_final = pd.concat([df_vals, df_unc, df_lod])
# Add the column headings:
headers = [channel.name for channel in data.timeSeriesList(data.Output)]
headers.insert(0, 'Selection Name')
df_final.set_axis(headers, axis=1, inplace=True)
fname = QFileDialog.getSaveFileName(None, "Save Export Data", QDir.homePath(), "CSV Files (*.csv")
if fname:
df_final.to_csv(fname, index=False)
print(f"Saved to {fname}")