First, we open the massiveOES project
import massiveOES
project = massiveOES.MeasuredSpectra.load('313nm/12p7.SPE.dat')
Select one of the spectra in the project and export the measurement and the simulation
index = 25 # in this project, the representative spectrum is that on index 25
measured = project.measured_Spectra_for_fit(index) #this returns massiveOES.Spectrum object containing x and y axis
simulated = massiveOES.specDB.puke_spectrum(project.parameters_list[index], sims = project.simulations)
#make the simulation, again as massiveOES.Spectrum object
The measured and simulated variables now contain the massiveOES.Spectrum objects. These have attributes x and
y which are simply 1-D numpy arrays. These can be easily plotted with matplotlib.
%pylab inline
#enables plotting in the browser
matplotlib.pyplot.plot(measured.x, measured.y, label = 'measurement')
matplotlib.pyplot.plot(simulated.x, simulated.y, label = 'simulations')
matplotlib.pyplot.legend(ncol = 2)
Of course, the axes x and y may be also saved
numpy.savetxt('measured.txt', numpy.array([measured.x, measured.y]).T)