summaryrefslogtreecommitdiff
path: root/tutorials/module_4/spectroscopy_problem/spectroscopy.py
diff options
context:
space:
mode:
Diffstat (limited to 'tutorials/module_4/spectroscopy_problem/spectroscopy.py')
-rw-r--r--tutorials/module_4/spectroscopy_problem/spectroscopy.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/tutorials/module_4/spectroscopy_problem/spectroscopy.py b/tutorials/module_4/spectroscopy_problem/spectroscopy.py
index e195fbd..f32ca52 100644
--- a/tutorials/module_4/spectroscopy_problem/spectroscopy.py
+++ b/tutorials/module_4/spectroscopy_problem/spectroscopy.py
@@ -9,7 +9,7 @@ Created on Wed Nov 5 12:58:59 2025
"""
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**)
@@ -18,9 +18,11 @@ Problem:
- 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 numpy as np
import pandas as pd
import matplotlib.pyplot as plt
+
Hg_data = 'Lampa_Calibrare_Mercur.xlsx'
#Ar_data = 'Spectru Descarcare Argon.xlsx'
Ox_data = 'Calibrare Intensitate Oxigen.xlsx'
@@ -33,6 +35,7 @@ df_Ox = pd.read_excel(Ox_data, header=3, engine='openpyxl')
# Trims mercury data to the first 2000 pixels
df_Hg = df_Hg[df_Hg['Pixels']<2000]
+
"Plot Intensity vs Pixels for mercury"
# Plot Hg intensity-pixel plot
@@ -45,7 +48,14 @@ plt.grid(True)
plt.show()
+"Calibrate length dimension"
+np.polyfit(df_Hg['Pixels'],df_Hg['Intensity'],3)
+"Calibrate intensity dimension"
+epsilon = # Surface emissivity
+lambd =
-
-
+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