# Laser Induced Breakdown Spectroscopy Analysis¶

## Tutorial 5: Analysis using multiple spectra¶

To date, our analysis has used a single spectrum for each sample. The single spectrum, has been the average of multiple spectra across the sample. This has simplified our analysis, but the averaging has meant that information about the variation of elements across the sample has been discarded.

In this tutorial, we will look at what can be done with the information we had previously discarded.

As with the previous tutorial, those who are interested in the Python can read the code cells (which have comments). If not, just skip to the next markdown cell for the outcomes.

### Looking at the Variation in One Spectra¶

For most LIBS systems and samples there will be variation between spectra. This is the result of

• different optical conditions and laser powers between shots
• differences in the sample from analysis location to location due to sample inhomegeneity

Any use of these spectra needs to quantify the effect of those variations on the result.

In [1]:
import pandas as pd
import numpy as np
from bokeh.plotting import figure, show
from bokeh.io import output_notebook
from bokeh.models import Range1d

output_notebook()

# load the data from file
spectra_data = pd.read_csv('.\\files\\OREAS501b_6.txt', index_col=None, names=["Wavelengths", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"])
# and display the first 5 lines
print(spectra_data.head(5))

#use the Bokeh library, start a chart (or figure)
p1 = figure()

#use a list of colours
colours_list = ["red", "orange", "yellow", "green", "blue", "indigo", "violet", "black", "steelblue", "gray"]

# to automate the plotting
for i in range(1,11):
p1.line(x=spectra_data['Wavelengths'], y=spectra_data['%i' % i ], legend='Spectra %i' % i, color=colours_list[i-1])

p1.yaxis.axis_label = "Intensity (Arb Units)"
p1.xaxis.axis_label = "Wavelength (nm)"
show(p1)

Loading BokehJS ...
   Wavelengths      1      2      3      4      5      6     7      8      9  \
0     186.4672  237.0  112.0  484.0   87.0  257.0  199.0   0.0  114.0  346.0
1     186.5354  210.0   54.0  486.0   87.0  287.0  221.0  17.0  123.0  354.0
2     186.6037  239.0   73.0  510.0  109.0  276.0  199.0  26.0  115.0  332.0
3     186.6720  217.0  104.0  484.0  112.0  289.0  234.0  31.0  107.0  364.0
4     186.7402  232.0   85.0  523.0  133.0  320.0  255.0  39.0  124.0  347.0

10
0  225.0
1  209.0
2  231.0
3  247.0
4  239.0