ZGainsforth
4/5/2016 - 6:13 PM

Plots a Bruker text spectrum from the command line.

Plots a Bruker text spectrum from the command line.

#!/usr/bin/env python
# Created 2015, Zack Gainsforth
import sys

if (len(sys.argv) < 2) or (sys.argv[1] in ['-h', '--help', '-?']):
	print "Usage is:\nPlotBrukerSpectrum.py filename.txt\nWhere filename.txt is the text output version of the spectrum output by Bruker's Esprit software."
	quit()

import matplotlib.pyplot as plt
import numpy as np
import QuickPlot

# print len(sys.argv)
# print sys.argv[1]

S = np.genfromtxt(sys.argv[1], skip_header=50)
QuickPlot.SpecPlot(S, boldlevel=3, xlabel='keV', ylabel='Counts', xlim=[0,10], plottype='semilogy')

plt.show()