Sorry for being unspecific. Yes, I use loadtxt to make two arrays - for transmission, and for wavenumbers. And using pyplot I can create the plot, however it looks quite jagged and I read that Gaussian or Lorenzian deconvolution should be applied to make it more tidy. I assumed that I should use the transmission values as the x in a Gaussian distribution.
I suggest you to check the meaning of deconvolution.
The idea is that when you measure, you convolute "the physics" with your instrument's resolution. So, something that is infinitely narrow in your spectra may appear as having a gaussian shape.
Therefore the first step you have to achieve is knowing how your instrument behaves. Take the spectra of something as narrow as you can get (a laser line, for instance) and use that measurement in your deconvolution function.
Perhaps Maria is only looking for a smooth interpolation for the data.
I'm assuming this because you've mentioned data comes out jagged using (matplotlib?) pyplot. Most plot libraries use a straight line between any two points, so if you lack data (step on your function may be too big) the plot will come out with that effect. By decreasing the step (which means increasing the number of samples, typically by interpolating between them) you can solve that issue, specially if you use methods adequate to do so. If this is the case I would advise Scipy "interp1d":
, perhaps using kind='cubic' interpolation. Please notice that interpolated data should only be assumed physically relevant if there's a reason for it. For plotting this is OK, for experimental procedures this is considered an increase in uncertainty (and rightfully so).
I'm not sure in what scientific area (and in what procedure) you're retrieving data from but it seems you're assuming the raw data already comes convoluted (which I find a bit unlikely). Convolution "per se" is a mathematical operation between two functions and you basically do it when you want to transform function 1 into function 3 by using function 2 (so f1*f2 = f3 ; actually I believe this is regardless of obtaining gaussian shape or not Aquiles, that will depend on the purpose).
I'm only saying this because by doing deconvolution you are hopping to recover one of the functions (let's say function 1 by using function 2 and 3). That will only solve the "jagged" behavior if that more "primal" signal is less "jagged" than the one you are dealing now. Again it seems to me unlikely in most uses I've seen of convolution (so convoluted signal is usually less jagged than original). I've just checked and the wikipedia article about convolution has some pretty nice animations explaining illustrating the effect of this operation:
Thank you both, and apologies for the late reply. Indeed, it is interpolation that I needed but it seems that I cannot get it right within Python. In the interpolated graph I end up with values of -60 000 for intensity. But anyway, it was helpful to read your advice.
I was trying to make a better-looking plot for the theoretical vibration spectrum and according to Gabedit, I can pick Gaussian convolution or Lorentzian convolution to make it look like a proper spectrum instead of ugly straight lines between points.