# Difference: 20151021_MSciSpectrocopyLab (1 vs. 2)

#### Revision 227 Oct 2015 - JosephBayley

Line: 1 to 1

 META TOPICPARENT name="StewartBoogertSpectroscopy2015"
Finding errors in spectra

Initially we wanted to find the errors in the spectra plot below. A discrete number of photons will hit the pixel in a certain amount of time, this number of photons follows a Poisson distribution. As the number of photoelectron also follows a Poisson the error is equal to the square root of the number of events, \sigma = \sqrt{N_{\rm{pe}}}. The spectra can then be plotted with the errors included.

Changed:
<
<
• Spectra_error.png:
>
>
• Spectra_error.png:
By then selecting one of the peaks a gaussian function can then be fitted to gain estimates for the standard deviation mean and amplitude of the peak. The fit uses the least squares method where {} is minimised. The \sigma_{n_{i}} is the errors in the initial spectral plot above. The Gaussian fit to one of the peaks is shown below:
Changed:
<
<
• Peak_fit.png:
>
>
• Peak_fit.png:
The Gaussian fit returns two arrays of values, the fit parameters which were:

amplitude = 2.45174694e+07

Line: 20 to 20
and the covariance matrix. The covariance matrix returns values for how much the fit parameters are correlated to each other. The diagonals of the covariance matrix return the variance of each of the fit parameters. For a Gaussian distribution the variance V[x], is equal to the square of the standard deviation, V[x} = (\sigma)^2. Therefore the error in the satndard deviation of the peak can be found from the squareroot of the correct element of the covariance matrix. The covariance matrix for this plot is
Changed:
<
<
[[ 1.53901604e+11 -6.97141082e-01 -1.63287377e+03 -2.26365868e+08]
[ -6.97141082e-01 1.60878183e-03 -2.72663680e-07 9.95929048e-03]
[ -1.63287377e+03 -2.72663680e-07 9.39810559e-04 2.33274473e+01]
[ -2.26365868e+08 9.95929048e-03 2.33274473e+01 1.48494566e+07]]
>
>
 Amplitude Mean Sigma Background Amplitude [1.53901604e+11 -6.97141082e-01 -1.63287377e+03 -2.26365868e+08] Mean [-6.97141082e-01 1.60878183e-03 -2.72663680e-07 9.95929048e-03] Sigma [-1.63287377e+03 -2.72663680e-07 9.39810559e-04 2.33274473e+01] Background [-2.26365868e+08 9.95929048e-03 2.33274473e+01 1.48494566e+07]

Changed:
<
<
The errors can then be found from the diagonal so that.
>
>

Changed:
<
<
amplitude = (2.45174694 \pm 0.0392302949) e+07 pe
>
>
.

.

.

The standard deviation of each of the fit parameters can then be found from the squareroot of the diagonal.

amplitude = (2.45174694 \pm 0.0392302949) e+07 pe

mean =32.1143568 \pm 0.0401096226
Line: 36 to 44
The standard deviation of the peak can then be plotted against the distance of the camera from the lens.
Changed:
<
<
• Focus.png:
>
>
• Focus.png:
To get the most accurate position for the focus a parabola can then be fitted to the plot of focus, this is shown below.
Changed:
<
<
• Focus_fit.png:
>
>
• Focus_fit.png:
The parabola fit then gave a minimum of 19.9mm.

Plotting the standard deviation against camera angle

The same process could then be repeated where the standard deviation of the peak can be plotted against the angle of the camera.

Changed:
<
<
• Angle.png:
>
>
• Angle.png:
By fitting the a parabola similar to the above plot for focus the best angle can be found.
Changed:
<
<
• Angle_fit.png:
>
>
• Angle_fit.png:
The parabola gave a best angle of 4.6mm.

Mapping the pixel number to the wavelength of the light.

To find the corresponding pixel number to wavelength in the above image the three lines were found to have values of 508.5822nm, 479.9912nm and 467.8149nm. By fittig a Gaussian to all three peaks as shown below the peak positions could be estimated.

Changed:
<
<
• Spectra_position.png:
>
>
• Spectra_position.png:
These peak values were found at the pixel positions of

peak 1 = 168.80845947 \pm 2.65735394668

Line: 68 to 75
By then combining these peak values with the previously found peak values above it is possible to find the width of one frame in nm, this was found to be
Changed:
<
<
frame width = 735 pixels = 80.9902944578 \pm 0.82257041263
>
>
frame width = 735 pixels = 80.9902944578 \pm 0.82257041263 nm
This frame can then be plotted with the correct wavelength values for each peak.
Changed:
<
<
• Spectra_wavelength.png:
>
>
• Spectra_wavelength.png:
Then this wavelength will have to be correlated to the micrometer position.
>
>
Faint Peaks

The plot below shows a strong peak on the left with two smaller peaks at pixel positions of approximately 100 and 400. These are the weaker lines on cadmium.

• Faint_Peaks.png:
The data was then sliced for the faint peak at the position of 400 and a gaussian was fit to it.
• Faint_Peak_Fit.png:
-- Public.JosephBayley - 26 Oct 2015

 META FILEATTACHMENT attachment="Spectra_error.png" attr="h" comment="" date="1445858414" name="Spectra_error.png" path="Spectra_error.png" size="79856" user="zxap044" version="1"
Line: 86 to 98

 META FILEATTACHMENT attachment="Focus.png" attr="h" comment="" date="1445859295" name="Focus.png" path="Focus.png" size="60537" user="zxap044" version="1" attachment="Spectra_wavelength.png" attr="h" comment="" date="1445860450" name="Spectra_wavelength.png" path="Spectra_wavelength.png" size="85864" user="zxap044" version="1" attachment="Spectra_position.png" attr="h" comment="" date="1445860449" name="Spectra_position.png" path="Spectra_position.png" size="79556" user="zxap044" version="1"
>
>
 META FILEATTACHMENT attachment="Faint_Peaks.png" attr="h" comment="" date="1445933172" name="Faint_Peaks.png" path="Faint_Peaks.png" size="46468" user="zxap044" version="1" attachment="Faint_Peak_Fit.png" attr="h" comment="" date="1445933171" name="Faint_Peak_Fit.png" path="Faint_Peak_Fit.png" size="74870" user="zxap044" version="1"

#### Revision 126 Oct 2015 - JosephBayley

Line: 1 to 1
>
>
 META TOPICPARENT name="StewartBoogertSpectroscopy2015"
Finding errors in spectra

Initially we wanted to find the errors in the spectra plot below. A discrete number of photons will hit the pixel in a certain amount of time, this number of photons follows a Poisson distribution. As the number of photoelectron also follows a Poisson the error is equal to the square root of the number of events, \sigma = \sqrt{N_{\rm{pe}}}. The spectra can then be plotted with the errors included.

• Spectra_error.png:
By then selecting one of the peaks a gaussian function can then be fitted to gain estimates for the standard deviation mean and amplitude of the peak. The fit uses the least squares method where {} is minimised. The \sigma_{n_{i}} is the errors in the initial spectral plot above. The Gaussian fit to one of the peaks is shown below:

• Peak_fit.png:
The Gaussian fit returns two arrays of values, the fit parameters which were:

amplitude = 2.45174694e+07

mean =32.1143568

sigma = 2.36989539

background = 1.44398361e+05

and the covariance matrix. The covariance matrix returns values for how much the fit parameters are correlated to each other. The diagonals of the covariance matrix return the variance of each of the fit parameters. For a Gaussian distribution the variance V[x], is equal to the square of the standard deviation, V[x} = (\sigma)^2. Therefore the error in the satndard deviation of the peak can be found from the squareroot of the correct element of the covariance matrix. The covariance matrix for this plot is

[[ 1.53901604e+11 -6.97141082e-01 -1.63287377e+03 -2.26365868e+08]
[ -6.97141082e-01 1.60878183e-03 -2.72663680e-07 9.95929048e-03]
[ -1.63287377e+03 -2.72663680e-07 9.39810559e-04 2.33274473e+01]
[ -2.26365868e+08 9.95929048e-03 2.33274473e+01 1.48494566e+07]]

The errors can then be found from the diagonal so that.

amplitude = (2.45174694 \pm 0.0392302949) e+07 pe

mean =32.1143568 \pm 0.0401096226

sigma = 2.36989539 \pm 0.0306563298

background = (1.44398361 \pm 0.0385349927) e+05 pe

Plotting the standard deviation against the focus distance

The standard deviation of the peak can then be plotted against the distance of the camera from the lens.

• Focus.png:
To get the most accurate position for the focus a parabola can then be fitted to the plot of focus, this is shown below.

• Focus_fit.png:
The parabola fit then gave a minimum of 19.9mm.

Plotting the standard deviation against camera angle

The same process could then be repeated where the standard deviation of the peak can be plotted against the angle of the camera.

• Angle.png:
By fitting the a parabola similar to the above plot for focus the best angle can be found.

• Angle_fit.png:
The parabola gave a best angle of 4.6mm.

Mapping the pixel number to the wavelength of the light.

To find the corresponding pixel number to wavelength in the above image the three lines were found to have values of 508.5822nm, 479.9912nm and 467.8149nm. By fittig a Gaussian to all three peaks as shown below the peak positions could be estimated.

• Spectra_position.png:

These peak values were found at the pixel positions of

peak 1 = 168.80845947 \pm 2.65735394668

peak 2 = 282.11434879 \pm 2.37636473875

peak 3 = 553.879099215 \pm 2.8694730656

By then combining these peak values with the previously found peak values above it is possible to find the width of one frame in nm, this was found to be

frame width = 735 pixels = 80.9902944578 \pm 0.82257041263

This frame can then be plotted with the correct wavelength values for each peak.

• Spectra_wavelength.png:

Then this wavelength will have to be correlated to the micrometer position.

-- Public.JosephBayley - 26 Oct 2015

 META FILEATTACHMENT attachment="Spectra_error.png" attr="h" comment="" date="1445858414" name="Spectra_error.png" path="Spectra_error.png" size="79856" user="zxap044" version="1" attachment="Peak_fit.png" attr="h" comment="" date="1445858452" name="Peak_fit.png" path="Peak_fit.png" size="60050" user="zxap044" version="1" attachment="Angle_fit.png" attr="h" comment="" date="1445859296" name="Angle_fit.png" path="Angle_fit.png" size="75446" user="zxap044" version="1" attachment="Angle.png" attr="h" comment="" date="1445859296" name="Angle.png" path="Angle.png" size="62386" user="zxap044" version="1" attachment="Focus_fit.png" attr="h" comment="" date="1445859295" name="Focus_fit.png" path="Focus_fit.png" size="76795" user="zxap044" version="1" attachment="Focus.png" attr="h" comment="" date="1445859295" name="Focus.png" path="Focus.png" size="60537" user="zxap044" version="1" attachment="Spectra_wavelength.png" attr="h" comment="" date="1445860450" name="Spectra_wavelength.png" path="Spectra_wavelength.png" size="85864" user="zxap044" version="1" attachment="Spectra_position.png" attr="h" comment="" date="1445860449" name="Spectra_position.png" path="Spectra_position.png" size="79556" user="zxap044" version="1"

Copyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback