# import the toolbox and call it B import LT.box as B c = B.get_file('cal.data') # get the calibration data for the MCA spectrum pos = B.get_data(c, 'pos') # get the position (in channel numbers) values as an array energy = B.get_data(c, 'energy') # get the energy (in MeV) values as an array cal = B.linefit(pos, energy) # perfom the for to get the calibration function co = B.get_spectrum('co_60_cal.SPE', \ calibration = cal.line) # load the spectrum and apply the # calibration cs = B.get_spectrum('cs_137_cal.SPE', \ calibration = cal.line) # load the spectrum and apply the # calibration cs *= 0.15 # scale the spectrum by a factor 0.15 (see histogram operations) co.plot() # plot the spectrum # now the cs spectrum is plotted on top of the co, so cs gets to label everything cs.xlabel='Energy (MeV)' # change the x-label cs.ylabel = 'Counts' # change the y-label cs.title=r'$^{60}Co$ (blue) $^{137}Cs$ (green)' # LaTeX for math in the title cs.plot(color = 'g') # plot the other spectrum on top it the color green B.pl.show() # make shure the complete plot si shown