Advertisement
ajith_97

Untitled

Nov 27th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import numpy as np
  2. from scipy.interpolate import interp1d
  3. import matplotlib.pyplot as plt
  4.  
  5. # Known QE points from a digitized curve (example values)
  6. wavelength = np.array([900, 1000, 1200, 1400, 1600, 1700]) # nm
  7. qe_values = np.array([0.1, 0.6, 0.85, 0.8, 0.5, 0.1]) # QE values (0 to 1)
  8.  
  9. # Interpolate the curve
  10. qe_curve = interp1d(wavelength, qe_values, kind='cubic', fill_value="extrapolate")
  11.  
  12. # Generate QE values for full range
  13. lambda_range = np.linspace(900, 1700, 500)
  14. qe_interpolated = qe_curve(lambda_range)
  15.  
  16. # Plot the interpolated QE curve
  17. plt.plot(lambda_range, qe_interpolated, label="Interpolated QE Curve")
  18. plt.scatter(wavelength, qe_values, color='red', label="Known Points")
  19. plt.xlabel("Wavelength (nm)")
  20. plt.ylabel("Quantum Efficiency (QE)")
  21. plt.title("InGaAs QE Curve")
  22. plt.legend()
  23. plt.grid()
  24. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement