diff options
| author | Christian Kolset <christian.kolset@gmail.com> | 2025-11-14 16:44:37 -0700 |
|---|---|---|
| committer | Christian Kolset <christian.kolset@gmail.com> | 2025-11-14 16:44:37 -0700 |
| commit | 1873d28735e18866f7e0167045611440e4cbe20e (patch) | |
| tree | e02fa642255bcc115e2a601a9d492863fe537caf /tutorials/module_4 | |
| parent | bda9939b6e93e06f61d5a51d90d6fb4a75d4aab8 (diff) | |
First draft of OOP tutorial complete AND worked on spectroscopy problem
Diffstat (limited to 'tutorials/module_4')
| -rw-r--r-- | tutorials/module_4/4.4 Statistical Analysis.md | 2 | ||||
| -rw-r--r-- | tutorials/module_4/Spectroscopy problem.md | 61 | ||||
| -rw-r--r-- | tutorials/module_4/spectroscopy_problem/spectroscopy.py | 20 |
3 files changed, 79 insertions, 4 deletions
diff --git a/tutorials/module_4/4.4 Statistical Analysis.md b/tutorials/module_4/4.4 Statistical Analysis.md index 4272e8b..f61caa9 100644 --- a/tutorials/module_4/4.4 Statistical Analysis.md +++ b/tutorials/module_4/4.4 Statistical Analysis.md @@ -75,7 +75,7 @@ This helps to assess confidence in their results and identify outliers that may > >Takeaway: Statistical distributions aren’t just for data analysis they guide how reliable we make our products. -## Spectroscopy +## Practical Application: 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. 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. diff --git a/tutorials/module_4/Spectroscopy problem.md b/tutorials/module_4/Spectroscopy problem.md index 429d387..18feeb9 100644 --- a/tutorials/module_4/Spectroscopy problem.md +++ b/tutorials/module_4/Spectroscopy problem.md @@ -41,8 +41,12 @@ A spectroscopy experiment is set up to collect the spectra discharges of Argon a <img src="image_1762363220163.png" width="530"> *Fig 1: Spectroscopy experiment set-up for characterization for a plasma source in Argon and Oxygen.* - +The goals is for us to be able to record the intensity vs. wavelength in real units with any type of energy source. The calibration process will go as follows: +1. Acquire data of unknown energy source +2. Calibrate the wavelength dimension by measuring the wavelength of an energy source (Hg - mercury) with well known wavelengths. +3. Calibrate the intensity dimension by measuring the intensity of a known energy source (W - tungsten) with well know intensities. ### Calibration of spectrometer + Problem 1: Plot the intensity of the mercury lamp as a function of pixel count. Problem 2: The goal want to convert our distance dimension units from pixel to wavelength. To calibrate the wavelength readings (x-axis) by matching the peaks of the spectra to literature data. To calibrate the wavelength readings (x-axis), use linear regression to convert the pixel count to true wavelength ($nm$). The following equation can be used: @@ -131,4 +135,57 @@ $$ - +||Intensity||||Air <br>Wavelength (Å)||||Spectrum||||Reference|| +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +|| | | | | | | | | | | | | | | | +|||||||||||||||| +|20|2026.860|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|400 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable4.htm#2052.828)|2052.828|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|20|2224.711|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|10|2252.786|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|60|2260.294|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|400 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable4.htm#2262.223)|2262.223|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|10|2263.634|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|1000 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable3.htm#2536.517),c|2536.517|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|25|2652.039|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|40|2653.679|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|400 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable4.htm#2847.675)|2847.675|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|30|2916.250|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|25|2947.074|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|250 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable3.htm#2967.280)|2967.280|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|70|3021.498|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|90|3125.668|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|80|3131.548|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|80|3131.839|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|12|3208.169|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|10|3532.594|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|10|3605.762|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|600 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable3.htm#3650.153)|3650.153|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|70|3654.836|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|50|3663.279|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|1000 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable4.htm#3983.931),c|3983.931|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|400 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable3.htm#4046.563)|4046.563|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|60|4339.223|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|100|4347.494|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|1000 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable3.htm#4358.328)|4358.328|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|12 c|5128.442|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|15|5204.768|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|80 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable4.htm#5425.253)|5425.253|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|500 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable3.htm#5460.735)|5460.735|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|200 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable4.htm#5677.105)|5677.105|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|50|5769.598|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|60|5790.663|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|12|5871.279|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|20 c|5888.939|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|15|6146.435|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|250 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable4.htm#6149.475),c|6149.475|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|25|7081.90|Hg I|[F54](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#F54)| +|6|7346.508|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|250 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable4.htm#7944.555)|7944.555|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|6 h|9520.198|Hg II|[SR01](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#SR01)| +|200 [P](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable3.htm#10139.76)|10139.76|Hg I|[BAL50](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#BAL50)| +|50|13570.21|Hg I|[H53](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#H53)| +|40|13673.51|Hg I|[H53](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#H53)| +|50|15295.82|Hg I|[H53](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#H53)| +|50|17072.79|Hg I|[H53](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#H53)| +|25|23253.07|Hg I|[PBT55](https://www.physics.nist.gov/PhysRefData/Handbook/Tables/mercurytable7.htm#PBT55)|
\ No newline at end of file diff --git a/tutorials/module_4/spectroscopy_problem/spectroscopy.py b/tutorials/module_4/spectroscopy_problem/spectroscopy.py index f32ca52..f66734a 100644 --- a/tutorials/module_4/spectroscopy_problem/spectroscopy.py +++ b/tutorials/module_4/spectroscopy_problem/spectroscopy.py @@ -49,8 +49,25 @@ plt.show() "Calibrate length dimension" -np.polyfit(df_Hg['Pixels'],df_Hg['Intensity'],3) +C = np.polyfit(df_Hg['Pixels'],df_Hg['Intensity'],3) +lambda_Hg = lambda p : C[3] + C[2]*p+C[1]*p**2+C[0]*p**3 + +lambda_calibrated = lambda_Hg(df_Hg['Pixel']) + + +# Plot Hg intensity-wavelength plot +plt.figure(figsize=(8,5)) +plt.plot(lambda_Hg, df_Hg['Intensity'], linestyle='-') +plt.xlabel('Wavelength [nm]') +plt.ylabel('Intensity [a.u.]') +plt.title('Wavelength-Intensity (Hg)') +plt.grid(True) +plt.show() + + + +""" "Calibrate intensity dimension" epsilon = # Surface emissivity lambd = @@ -59,3 +76,4 @@ I_W_true = epsilon*((2hc**2)/(lambd**5)*1/(e**(hc/kT)-1)) I_W_meas= df_Ox['I_Tungsten [a.u.]'] R=I_W_meas/I_W_true I_plasma_meas=R*I_plasma_true +"""
\ No newline at end of file |
