First, we open the massiveOES project

In [12]:
import massiveOES
project = massiveOES.MeasuredSpectra.load('313nm/12p7.SPE.dat')
/home/janvorac/wheel/packages/massiveOES/massiveOES/data/OHAX.db
/home/janvorac/wheel/packages/massiveOES/massiveOES/data/N2CB.db

Select one of the spectra in the project and export the measurement and the simulation

In [13]:
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.

In [18]:
%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)
Populating the interactive namespace from numpy and matplotlib
Out[18]:
<matplotlib.legend.Legend at 0x7ff9fc7b0610>

Of course, the axes x and y may be also saved

In [20]:
numpy.savetxt('measured.txt', numpy.array([measured.x, measured.y]).T)