diff options
Diffstat (limited to 'tutorials')
| -rw-r--r-- | tutorials/module_1/basics_of_python.md | 2 | ||||
| -rw-r--r-- | tutorials/module_4/4.0 Outline.md | 2 | ||||
| -rw-r--r-- | tutorials/module_4/4.4 Statistical Analysis.md | 14 | ||||
| -rw-r--r-- | tutorials/module_4/Spectroscopy problem.md | 60 | ||||
| -rw-r--r-- | tutorials/module_4/image_1762363220163.png | bin | 0 -> 80845 bytes | |||
| -rw-r--r-- | tutorials/module_4/image_1762366586870.png | bin | 0 -> 794380 bytes | |||
| -rw-r--r-- | tutorials/module_4/spectroscopy problem/Calibrare Intensitate Oxigen.xlsx | bin | 0 -> 64999 bytes | |||
| -rw-r--r-- | tutorials/module_4/spectroscopy problem/Intensity_Calibration_Oxygen_Discharge_Solution.xlsx | bin | 0 -> 402305 bytes | |||
| -rw-r--r-- | tutorials/module_4/spectroscopy problem/Lampa_Calibrare_Mercur.xlsx | bin | 0 -> 135793 bytes | |||
| -rw-r--r-- | tutorials/module_4/spectroscopy problem/Spectru Descarcare Argon.xlsx | bin | 0 -> 74877 bytes | |||
| -rw-r--r-- | tutorials/module_4/spectroscopy problem/spectroscopy.py | 35 |
11 files changed, 100 insertions, 13 deletions
diff --git a/tutorials/module_1/basics_of_python.md b/tutorials/module_1/basics_of_python.md index 776af44..80b05d3 100644 --- a/tutorials/module_1/basics_of_python.md +++ b/tutorials/module_1/basics_of_python.md @@ -91,7 +91,7 @@ The comprehensive table below show all built-in data types available in python. ## Variables -A **variable** in Python is a name that stores a value, allowing you to use and manipulate data efficiently. +A **variable** in Python is a name that stores a value, allowing you to use and manipulate data efficiently. In mathematics it is common to use a single letter to represent a variable, in programming descriptive variables are used to make it easier for whoever is reading the code to understand what is going on. You may remember what `x` is when writing the code, but when you revise it in the future, it may not be easy to remember what `x` represented in your 200 lines of code. In engineering it is encourage to use descriptive (such as `velocity_data`) or common convention symbols (`omega` for angular velocity). For this section arbitrary variables are used for the purpose of showing how variables works. #### Declaring and Assigning Variables diff --git a/tutorials/module_4/4.0 Outline.md b/tutorials/module_4/4.0 Outline.md index 0c19b12..1ec0ced 100644 --- a/tutorials/module_4/4.0 Outline.md +++ b/tutorials/module_4/4.0 Outline.md @@ -61,7 +61,7 @@ b. Plotting with Pandas and Matplotlib c. Subplots, twin axes, and annotations d. Colomaps and figure aesthetics - e. Exporitn gplots for reports (DPI, figure size) + e. Exporitng plots for reports (DPI, figure size) f. Creating dashboards or summary figures g. Problem 1: Using pandas to plot spectroscopy data from raw data. Add labels, units, title, and annotations for peaks h. Problem 2: Create a multi-panel figure showing raw data, fitted curve, and residuals. Format with consistent style, legend and color scheme for publication-ready quality.
\ No newline at end of file diff --git a/tutorials/module_4/4.4 Statistical Analysis.md b/tutorials/module_4/4.4 Statistical Analysis.md index c4c32b0..4272e8b 100644 --- a/tutorials/module_4/4.4 Statistical Analysis.md +++ b/tutorials/module_4/4.4 Statistical Analysis.md @@ -77,8 +77,18 @@ This helps to assess confidence in their results and identify outliers that may ## Spectroscopy ### Background -Spectroscopy is the study of how matter interacts with electromagnetic radiation, including the absorption and emission of light and other forms of radiation. It examines how these interactions depend on the wavelength of the radiation, providing insight into the physical and chemical properties of materials. In simple terms, spectroscopy helps us understand what substances are made of and how they behave when exposed to energy. +Spectroscopy is the study of how matter interacts with electromagnetic radiation, including the absorption and emission of light and other forms of radiation. It examines how these interactions depend on the wavelength of the radiation, providing insight into the physical and chemical properties of materials. This is how NASA determines the composition of planetary surfaces and atmospheres. It's also applied in combustion and thermal analysis where spectroscopy measure plasma temperature and monitors exhaust composition in rocket engines. + +In simple terms, spectroscopy helps us understand what substances are made of and how they behave when exposed to high levels energy to help improve system performance and efficiency. These applications allow us to better understand material behavior under extreme conditions and improve system performance and efficiency. + +### Spectrometer +The instrument used to measure the spectra of light is called a spectrometer. It works on the basis of taking light, scatters it and then projecting the spectra onto a detector allowing us to capture the intensity of the light at different wavelengths. See the supplementary video of the inside of a spectrometer. + + +Once the data is collected we can compare our data with know spectra of elements to then identify their composition. The figure below, show the spectra of different elements. + +<img src="image_1762366586870.png" width="500"> + -In engineering applications, spectroscopy is a powerful diagnostic and analysis tool. It can be used for material identification, such as how NASA determines the composition of planetary surfaces and atmospheres. It’s also applied in combustion and thermal analysis, where emission spectroscopy measures plasma temperatures and monitors exhaust composition in rocket engines. These applications allow engineers to better understand material behavior under extreme conditions and improve system performance and efficiency. ## Problem: Eliminating uncertainty in Spectroscopy readings When using spectroscopy to measure emission intensity, each reading fluctuates slightly due to sensor noise, temperature drift or electronic fluctuations. By taking multiple readings and averaging them, random errors (positive and negative) tend to cancel out, the mean converges to the true value. The standard deviation quantifies how precise the measurement is. Plot all readings of intensity as a function of wavelength on top of each other. Calculate the mean, standard deviation and variance. Then plot the intensity readings as a histogram. Comment on the distributions type.
\ No newline at end of file diff --git a/tutorials/module_4/Spectroscopy problem.md b/tutorials/module_4/Spectroscopy problem.md index d48eaba..0641864 100644 --- a/tutorials/module_4/Spectroscopy problem.md +++ b/tutorials/module_4/Spectroscopy problem.md @@ -1,22 +1,64 @@ -## Background - - 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=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=I_oxygen_measured/R +- 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") +--- + +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. + +<img src="image_1762363220163.png" width="530"> +Fig 1: Spectroscopy experiment set-up for characterization for a plasma source in Argon and Oxygen + +### 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 1: Plot the intensity of the spectra versus the pixels. + +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 + +--- +From Tema 1 Optical Spectroscopy emission file + +**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”] + +**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. +[To solve this problem, use the data in the Excel document titled: “Spectru Descarcare Argon.xlsx”]. +**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. -Problem 1: Import the data as a pandas dataframe. +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 2: Using the known wavelength intensities of mercury, identify the wavelengths. +[To solve this problem use the data from the Excel document titled: “Calibrare Intensitate Oxigen.xlsx”] -Problem 3:
\ No newline at end of file +**Problem 4:** Identify the types of errors/uncertainties that occur in an OES experiment.
\ No newline at end of file diff --git a/tutorials/module_4/image_1762363220163.png b/tutorials/module_4/image_1762363220163.png Binary files differnew file mode 100644 index 0000000..2e9656e --- /dev/null +++ b/tutorials/module_4/image_1762363220163.png diff --git a/tutorials/module_4/image_1762366586870.png b/tutorials/module_4/image_1762366586870.png Binary files differnew file mode 100644 index 0000000..de4a9a2 --- /dev/null +++ b/tutorials/module_4/image_1762366586870.png diff --git a/tutorials/module_4/spectroscopy problem/Calibrare Intensitate Oxigen.xlsx b/tutorials/module_4/spectroscopy problem/Calibrare Intensitate Oxigen.xlsx Binary files differnew file mode 100644 index 0000000..f18e170 --- /dev/null +++ b/tutorials/module_4/spectroscopy problem/Calibrare Intensitate Oxigen.xlsx diff --git a/tutorials/module_4/spectroscopy problem/Intensity_Calibration_Oxygen_Discharge_Solution.xlsx b/tutorials/module_4/spectroscopy problem/Intensity_Calibration_Oxygen_Discharge_Solution.xlsx Binary files differnew file mode 100644 index 0000000..cdeec66 --- /dev/null +++ b/tutorials/module_4/spectroscopy problem/Intensity_Calibration_Oxygen_Discharge_Solution.xlsx diff --git a/tutorials/module_4/spectroscopy problem/Lampa_Calibrare_Mercur.xlsx b/tutorials/module_4/spectroscopy problem/Lampa_Calibrare_Mercur.xlsx Binary files differnew file mode 100644 index 0000000..b429c6d --- /dev/null +++ b/tutorials/module_4/spectroscopy problem/Lampa_Calibrare_Mercur.xlsx diff --git a/tutorials/module_4/spectroscopy problem/Spectru Descarcare Argon.xlsx b/tutorials/module_4/spectroscopy problem/Spectru Descarcare Argon.xlsx Binary files differnew file mode 100644 index 0000000..7c98481 --- /dev/null +++ b/tutorials/module_4/spectroscopy problem/Spectru Descarcare Argon.xlsx diff --git a/tutorials/module_4/spectroscopy problem/spectroscopy.py b/tutorials/module_4/spectroscopy problem/spectroscopy.py new file mode 100644 index 0000000..b3aeab5 --- /dev/null +++ b/tutorials/module_4/spectroscopy problem/spectroscopy.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Wed Nov 5 12:58:59 2025 + +@author: christian +""" + +import pandas as pd +import matplotlib.pyplot as plt + +Hg_data = 'Lampa_Calibrare_Mercur.xlsx' +Ar_data = 'Spectru Descarcare Argon.xlsx' + +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' +) + +filtered = df_Hg[df_Hg['Pixels']>2000] + +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.grid(True) +plt.show() |
