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.py35
1 files changed, 35 insertions, 0 deletions
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()