How to plot graph the intensity versus wavelength for the spectrum? [closed]

…衆ロ難τιáo~ 提交于 2019-12-08 14:06:50

问题


Need to plot graph the intensity versus wavelength for the spectrum. Also, me need to determine the wavelengths from the graph (the image below):

With which program I can do this? I searched in Google program, but they all work with video (example theremino spectrometer)?. I need to work the image.


回答1:


That's not a graph but a picture. Anyhow you can get started as follows.

You can load the image with scipy. Then, in the simplest case, do a horizontal cut which will give you intensity vs pixel position.

import scipy.misc as misc
import matplotlib.pyplot as plt

img = misc.imread('spectrum.png', mode='L')
mid_line = img[len(img)//2]
plt.plot(mid_line)
plt.show()

There is quite some background luminosity there. Doing a vertical averaging would give a smoother spectra (img_mean = img.mean(axis=0)).

Then you have to find a way to "calibrate" the pixel positions to wavelength. For that you need an external source of "truth", which I don't know what you have available. For example you can say that the maximum at the green line is 510 nm (pixel 405) and the bright blue one 460 nm (pixel 302). Then, depending on your experimental setup you might be able to say that the distance in pixels is linear with wavelength and then you have you conversion.

Hope this guides you a bit.



来源:https://stackoverflow.com/questions/46910765/how-to-plot-graph-the-intensity-versus-wavelength-for-the-spectrum

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!