Thresholds are the simplest type of filter in latools
. They identify regions where the concentration or local gradient of an analyte is above or below a threshold value.
Appropriate thresholds may be determined from prior knowledge of the samples, or by examining whole-analysis level cross-plots of the concentration or local gradients of all pairs of analytes, which reveal relationships within all the ablations, allowing distinct contaminant compositions to be identified and removed.
Selects data where a target analyte is above or below a specified threshold.
For example, applying an threshold Al/Ca value of 100 μmol/mol to Sample-1
of the example data:
This creates two filters - one that selects data above the threshold, and one that selects data below the threshold. To see what filters you've created, and whether they're 'on' or 'off', use ~latools.latools.analyse.filter_status
, which will print:
Subset All_Samples:
n Filter Name Mg24 Mg25 Al27 Ca43 Ca44 Mn55 Sr88 Ba137 Ba138
0 Al27_thresh_below False False False False False False False False False
1 Al27_thresh_above False False False False False False False False False
To effect the data, a filter must be activated:
Data above the threshold values (dashed line) are excluded by this filter (greyed out).
~latools.latools.analyse.filter_threshold
creates a threshold filter.~latools.latools.analyse.filter_on
and~latools.latools.analyse.filter_off
turn filters on or off.~latools.latools.analyse.crossplot
creates a cross-plot of all analytes, showing relationships within the data at the population-level (all samples). This can be useful when choosing a threshold value.~latools.latools.analyse.filter_reports
creates plots of a particular filter, showing which sections of the ablation are selected.~latools.latools.analyse.histograms
creates histograms of the concentrations of all analytes. Useful for identifying threshold values for specific analytes.~latools.latools.analyse.trace_plots
with optionfilt=True
creates plots of all data, showing which regions are selected/rejected by the active filters.~latools.latools.analyse.filter_clear
deletes all filters.
Selects data where a target analyte is not changing - i.e. its gradient is constant. This filter starts by calculating the local gradient of the target analyte:
For example, imagine a calcium carbonate sample which we know should have constant Al concentration. In this sample, variable Al is indicative of a contaminant phase. A gradient threshold filter can be used to isolate regions where Al is constant, and more likeley to be contaminant-free. To create an apply this filter:
The top panel shows the calculated gradient, with the regions above and below the threshold value greyed out. the bottom panel shows the data regions selected by the filter for all elements.
Gradients are in units of mol[X] / mol[internal standard] / s. The absolute value of the gradient will change depending on the value of win
used.
Working out what a gradient threshold
value should be from first principles can be a little complex. The best way to choose a threshold value is by looking at the data. There are three functions to help you do this:
~latools.latools.analyse.gradient_plots
Calculates the local gradient of all samples, plots the gradients, and saves them as a pdf. The gradient equivalent of~latools.latools.analyse.trace_plots
.~latools.latools.analyse.gradient_histogram
Plot histograms of the local gradients in the entire dataset.~latools.latools.analyse.gradient_crossplot
Create crossplots of the local gradients for all analyes.
~latools.latools.analyse.filter_threshold
creates a threshold filter.~latools.latools.analyse.filter_on
and~latools.latools.analyse.filter_off
turn filters on or off.~latools.latools.analyse.gradient_plots
Calculates the local gradient of all samples, plots the gradients, and saves them as a pdf. The gradient equivalent of~latools.latools.analyse.trace_plots
.~latools.latools.analyse.gradient_crossplot
Create crossplots of the local gradients for all analyes.~latools.latools.analyse.gradient_histogram
Plot histograms of the local gradients in the entire dataset.~latools.latools.analyse.trace_plots
with optionfilt=True
creates plots of all data, showing which regions are selected/rejected by the active filters.~latools.latools.analyse.filter_reports
creates plots of a particular filter, showing which sections of the ablation are selected.~latools.latools.analyse.filter_clear
deletes all filters.
In cases where the absolute threshold value is not known, a percentile may be used. An absolute threshold value is then calculated from the raw data at either the individual-ablation or population level, and used to create a threshold filter.
For example, to remove regions containing the top 10% of Al concentrations:
The histogram on the right shows the distribution of Al data in the sample, with a line showing the 90th percentile of the data, corresponding to the threshold value used.
The principle of this filter is the same, but it operatures on the local gradient of the data, instead of the absolute concentrations.