diff options
| author | Christian Kolset <christian.kolset@gmail.com> | 2025-11-07 15:57:46 -0700 |
|---|---|---|
| committer | Christian Kolset <christian.kolset@gmail.com> | 2025-11-07 15:57:46 -0700 |
| commit | 98e8f1ac5de5f210e7bf0fd21c2a10f3d6d97763 (patch) | |
| tree | a8bf15f30c2f8f8d685630fb9c7c147f38366889 | |
| parent | 6da7dd248a9e6b46cb82f97d82a19f63f145ba75 (diff) | |
continued work on spectopscopy problem
| -rw-r--r-- | tutorials/module_4/Spectroscopy problem.md | 103 | ||||
| -rw-r--r-- | tutorials/module_4/spectroscopy problem/spectroscopy.py | 48 |
2 files changed, 95 insertions, 56 deletions
diff --git a/tutorials/module_4/Spectroscopy problem.md b/tutorials/module_4/Spectroscopy problem.md index 0641864..57770bb 100644 --- a/tutorials/module_4/Spectroscopy problem.md +++ b/tutorials/module_4/Spectroscopy problem.md @@ -1,64 +1,87 @@ +# From Tema 1 Optical Spectroscopy emission file -Example problem on Data Processing - Optical Emission Spectroscopy +**Problem 1:** Using a mercury continuous calibration lamp (with well-defined lines in the literature), transform the X-axis of the spectrum into physical units of wavelength [nm]. -- Import xls data into Python -- Plot the Intensity [a.u.] vs pixels -- Interpolate and convert x-axis from pixels to nm (true wavelength) using Hg lamp data (using data in file: Lampa_Calibrare_Mercur.xlsx) -- Find response function of the spectrometer using the tungsten lamp data from file: "Calibrare Intensitate Oxigen.xlsx)": $R=\frac{I_{measured}}{I_{true}}$ (where True is computed by Planck's law of radiation (see notes in the pptx above) -- Convert y-axis from Intensity [a.u.] into Intensity in [W/(cm^2*sr*nm)] by dividing the measured Oxygen spectrum with the response function: $I_{oxygen, true}=\frac{I_{oxygen, measured}}{R}$ -- Once the spectra is in real units: compute the density of one of the oxygen lines by integrating underneath one of the peaks (see equation from Slide 39 - bottom). We will give all of the constants that are in this equation (see the "Intensity_Calibration_Oxygen_Discharge_Solution.xlsx") ---- +[To solve this problem, use the data in the Excel document titled: “Lampa_Calibrare_Mercur.xlsx”] -A spectroscopy experiment is set up to collect the spectra discharges of Argon and Oxygen (figure 1). The data given to you will be given to you as light intensity versus pixels. +**Problem 2:** Once the X-axis of the spectrum is calibrated, it will be removed from the optical system and a discharge in Argon will be positioned in its place. Identify at least 7 lines in the spectrum of the discharge in Argon using the NIST database. -<img src="image_1762363220163.png" width="530"> -Fig 1: Spectroscopy experiment set-up for characterization for a plasma source in Argon and Oxygen +[To solve this problem, use the data in the Excel document titled: “Spectru Descarcare Argon.xlsx”]. -### Calibration of -Problem 1: Plot the experimental data of Intensity as a function of pixel count. -Problem 2: Calibrate your data by converting the pixels to true wavelenth (nm) by using the mercury lamp data. -Problem 3: Find response function of the spectrometer using the tungsten lamp data from file. -Problem 4: Convert the arbitrary units of intensity to real units of $\frac{W}{cm^2*sr*nm}$ -Problem 5: Once the spectra is in real units, compute the density of one of the oxygen lines by integrating underneath one of the peaks. -$$ -n_{1,2}=\frac{\int_{\lambda_0-\Delta\lambda}^{\lambda_0+\Delta\lambda} I(\lambda)d\lambda}{\frac{1}{4\pi}hv_{1,2}A_{1,2}l}\tag{1} -$$ +**Problem 3:** In order to extract quantitative data from an emission spectrum, it is necessary to calibrate the intensity axis in physical units. To achieve this, we will place a tungsten plate lamp in front of the optical system. Using a pyrometer, the plate temperature was obtained as T=1800 K. +Requirements: +3.1. Determine the theoretical spectrum of the tungsten plate lamp +3.2. Determine the measured spectrum of the tungsten plate lamp +3.3. Determine the curve that characterizes the response of the device for each wavelength. +3.4. Use the response curve of the device to calibrate the emission spectrum of a discharge in oxygen in radiance. +3.5. Measure the discharge temperature in oxygen using the Boltzman method for the emission lines at 777 nm and 844 nm. [Please comment on the temperature obtained!] +3.6. Determine the density of atoms in the excited state for the line at 844 nm. NOTE: in order to calculate the excited state density it is very important to know the collection volume (note that the column length enters the density calculation formula). For ease, take l=250 μm +3.7. Extra-credit: I would like you to think about how you would determine the collection volume of the light from the plasma knowing: the diameter of the lenses used (2 inches), the focal lengths (f1=125mm, f2=200mm) and the diameter of the optical fiber (d=200 μm). +[To solve this problem use the data from the Excel document titled: “Calibrare Intensitate Oxigen.xlsx”] +**Problem 4:** Identify the types of errors/uncertainties that occur in an OES experiment. +--- +# Example problem on Data Processing - Optical Emission Spectroscopy +- Import xls data into Python +- Plot the Intensity [a.u.] vs pixels +- Interpolate and convert x-axis from pixels to nm (true wavelength) using Hg lamp data (using data in file: **Lampa_Calibrare_Mercur.xlsx**) +- Find response function of the spectrometer using the tungsten lamp data from file: "**Calibrare Intensitate Oxigen.xlsx**)": $R=\frac{I_{measured}}{I_{true}}$ (where True is computed by Planck's law of radiation (see notes in the pptx above) +- Convert y-axis from Intensity [a.u.] into Intensity in [W/(cm^2*sr*nm)] by dividing the measured Oxygen spectrum with the response function: $I_{oxygen, true}=\frac{I_{oxygen, measured}}{R}$ +- Once the spectra is in real units: compute the density of one of the oxygen lines by integrating underneath one of the peaks (see equation from Slide 39 - bottom). We will give all of the constants that are in this equation (see the "I**ntensity_Calibration_Oxygen_Discharge_Solution.xlsx**") --- -Problem 1: Plot the intensity of the spectra versus the pixels. +# Spectroscopy +A spectroscopy experiment is set up to collect the spectra discharges of Argon and Oxygen (figure 1). The data obtained from the spectrometer represent the light intensity measured across different pixel positions on the detector. Since this is unit-less we will need to calibrate the experiment with a know light source to be able to obtain useful results. + +<img src="image_1762363220163.png" width="530"> +*Fig 1: Spectroscopy experiment set-up for characterization for a plasma source in Argon and Oxygen.* -Problem 2: Using the known wavelength intensities of mercury, convert our data from pixels to units of wavelength (nm). -Problem 3: Once we've calibrated the horizontal axis to show wavelength, use data from literature to extrapolate +### Calibration of spectrometer +Problem 1: Plot the intensity of the mercury lamp as a function of pixel count. ---- -From Tema 1 Optical Spectroscopy emission file +Problem 2: Calibrate the wavelength readings (x-axis) by converting the pixel count to true wavelength ($nm$) by using linear regression. The following equation can be used: +$$ +\lambda_p=I+C_1p+C_2p^2+C_3p^3 +$$ +where: + $\lambda =$ wavelength of pixel $p$, + $I =$ wavelength of pixel 0, + $C_1 =$ first coefficient ($\frac{nm}{pixel}$), + $C_2 =$ second coefficient $(\frac{nm}{pixel^2})$, + $C_3 =$ third coefficient $(\frac{nm}{pixel^3})$ + +Problem 3: The accuracy of the spectrometer is limited by the sensitivity and resolution of the instrument. We can model these imperfection by comparing the measured values with "true" literature data. Find response function of the spectrometer using a tungsten (W) lamp data. The data has been recorded and saved in "calibrare_intensity_oxygen". +$$ +R(\lambda)=\frac{I_{measured}}{I_{true}} +$$ +For $I_{measured, W}$ use $I_{W} - I_{background}$. +$I_{true}$ is obtained by using plancks law at T=1800 K. +$$ +I_{\lambda,\Omega}(T)= \epsilon (\frac{2hc^2}{\lambda^5}\frac{1}{e^{hc/kT}-1}) +$$ -**Problem 1:** Using a mercury continuous calibration lamp (with well-defined lines in the literature), transform the X-axis of the spectrum into physical units of wavelength [nm]. -[To solve this problem, use the data in the Excel document titled: “Lampa_Calibrare_Mercur.xlsx”] +$I_{measure}^W = R(\lambda) * I_{true}^W(\lambda)$ -**Problem 2:** Once the X-axis of the spectrum is calibrated, it will be removed from the optical system and a discharge in Argon will be positioned in its place. Identify at least 7 lines in the spectrum of the discharge in Argon using the NIST database. +$I_{measure}^{plasma} = R(\lambda) * I_{true}^{plasma}(\lambda)$ -[To solve this problem, use the data in the Excel document titled: “Spectru Descarcare Argon.xlsx”]. +$I_{meas}^{plasma}(\lambda) = \frac{I_{meas}^{W}(\lambda)}{I_{true}^{W}(\lambda)} * I_{true}^{plasma}(\lambda)$ -**Problem 3:** In order to extract quantitative data from an emission spectrum, it is necessary to calibrate the intensity axis in physical units. To achieve this, we will place a tungsten plate lamp in front of the optical system. Using a pyrometer, the plate temperature was obtained as T=1800 K. -Requirements: -3.1. Determine the theoretical spectrum of the tungsten plate lamp -3.2. Determine the measured spectrum of the tungsten plate lamp -3.3. Determine the curve that characterizes the response of the device for each wavelength. -3.4. Use the response curve of the device to calibrate the emission spectrum of a discharge in oxygen in radiance. -3.5. Measure the discharge temperature in oxygen using the Boltzman method for the emission lines at 777 nm and 844 nm. [Please comment on the temperature obtained!] -3.6. Determine the density of atoms in the excited state for the line at 844 nm. NOTE: in order to calculate the excited state density it is very important to know the collection volume (note that the column length enters the density calculation formula). For ease, take l=250 μm -3.7. Extra-credit: I would like you to think about how you would determine the collection volume of the light from the plasma knowing: the diameter of the lenses used (2 inches), the focal lengths (f1=125mm, f2=200mm) and the diameter of the optical fiber (d=200 μm). +Problem 4: Calibrate the light intensity from the arbitrary units to real units of $[{\frac{W}{cm^2*sr*nm}}]$ +$I_{oxygen, true}=\frac{I_{oxygen, measured}}{R}$ -[To solve this problem use the data from the Excel document titled: “Calibrare Intensitate Oxigen.xlsx”] -**Problem 4:** Identify the types of errors/uncertainties that occur in an OES experiment.
\ No newline at end of file +### Calculating the density of oxygen + +Problem 5: Once the spectra is in real units, compute the density of one of the oxygen lines by integrating underneath one of the peaks. +$$ +n_{1,2}=\frac{\int_{\lambda_0-\Delta\lambda}^{\lambda_0+\Delta\lambda} I(\lambda)d\lambda}{\frac{1}{4\pi}hv_{1,2}A_{1,2}l}\tag{1} +$$ + diff --git a/tutorials/module_4/spectroscopy problem/spectroscopy.py b/tutorials/module_4/spectroscopy problem/spectroscopy.py index b3aeab5..e195fbd 100644 --- a/tutorials/module_4/spectroscopy problem/spectroscopy.py +++ b/tutorials/module_4/spectroscopy problem/spectroscopy.py @@ -6,30 +6,46 @@ Created on Wed Nov 5 12:58:59 2025 @author: christian """ + +""" +Problem: + +- Import xls data into Python +- Plot the Intensity [a.u.] vs pixels +- Interpolate and convert x-axis from pixels to nm (true wavelength) using Hg lamp data (using data in file: **Lampa_Calibrare_Mercur.xlsx**) +- Find response function of the spectrometer using the tungsten lamp data from file: "**Calibrare Intensitate Oxigen.xlsx**)": $R=\frac{I_{measured}}{I_{true}}$ (where True is computed by Planck's law of radiation (see notes in the pptx above) +- Convert y-axis from Intensity [a.u.] into Intensity in [W/(cm^2*sr*nm)] by dividing the measured Oxygen spectrum with the response function: $I_{oxygen, true}=\frac{I_{oxygen, measured}}{R}$ +- Once the spectra is in real units: compute the density of one of the oxygen lines by integrating underneath one of the peaks (see equation from Slide 39 - bottom). We will give all of the constants that are in this equation (see the "I**ntensity_Calibration_Oxygen_Discharge_Solution.xlsx**") +""" + import pandas as pd import matplotlib.pyplot as plt Hg_data = 'Lampa_Calibrare_Mercur.xlsx' -Ar_data = 'Spectru Descarcare Argon.xlsx' +#Ar_data = 'Spectru Descarcare Argon.xlsx' +Ox_data = 'Calibrare Intensitate Oxigen.xlsx' + +df_Hg = pd.read_excel(Hg_data, header=11, engine='openpyxl') +df_Ox = pd.read_excel(Ox_data, header=3, engine='openpyxl') +#df_Ar = pd.read_excel(Ar_data, header=14, engine='openpyxl') -df_Hg = pd.read_excel( - Hg_data, - header=11, # row number to use as header - engine='openpyxl' -) -df_Ar = pd.read_excel( - Ar_data, - header=14, # row number to use as header - engine='openpyxl' -) +# Trims mercury data to the first 2000 pixels +df_Hg = df_Hg[df_Hg['Pixels']<2000] -filtered = df_Hg[df_Hg['Pixels']>2000] +"Plot Intensity vs Pixels for mercury" +# Plot Hg intensity-pixel plot plt.figure(figsize=(8,5)) -plt.plot(df_Hg['Pixels'], df_Hg['Intensity'], marker='o', linestyle='-') -plt.xlabel('Pixelse') -plt.ylabel('Intensity') -plt.title('Pixel-Intensity') +plt.plot(df_Hg['Pixels'], df_Hg['Intensity'], linestyle='-') +plt.xlabel('Pixels') +plt.ylabel('Intensity [a.u.]') +plt.title('Pixel-Intensity (Hg)') plt.grid(True) plt.show() + + + + + + |
