diff options
Diffstat (limited to 'tutorials/module_4/spectroscopy_problem/spectroscopy.py')
| -rw-r--r-- | tutorials/module_4/spectroscopy_problem/spectroscopy.py | 20 |
1 files changed, 19 insertions, 1 deletions
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 |
