-
Notifications
You must be signed in to change notification settings - Fork 0
/
specfile_test.lar
28 lines (25 loc) · 1.2 KB
/
specfile_test.lar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#LARCH script to test the specfile plugin
#NOTE: 'specfile.py' should be placed in the Larch plugins folder, either:
# $HOME/.larch/plugins/ or /usr/local/share/larch/plugins on Unix
# C:\Users\ME\larch\plugins or C:\Program Files\larch\plugins on Windows
add_plugin('specfile')
fname = "specfile_test.dat"
counter = "arr_hdh_ene"
signal = "zap_det_dtc"
monitor = "arr_I02sum"
seconds = "arr_seconds"
scan = 3
for norm in [None, "area", "max-min", "sum"]:
g1 = read_specfile_scan(fname, scan=scan, cntx=counter, csig=signal, cmon=monitor, csec=seconds, norm=norm)
print "Read scan {0} with normalization {1}".format(scan, norm)
newplot(g1.x, g1.y, win=1, title='reading a single scan from SPEC file', xlabel=g1.infos["xlabel"], ylabel=g1.infos["ylabel"])
raw_input("Press Enter to continue")
#endfor
_next = raw_input("Do you want to run the next test (y/n)? ")
if _next == 'y':
motor = 'Spec.Energy'
rngstr = '5:70'
xystep = 0.05
g2 = read_specfile_map(fname, scans=rngstr, cntx=counter, cnty=motor, csig=signal, cmon=monitor, csec=seconds, xystep=xystep)
contour(g2.zz, x=g2.x, y=g2.y, colormap='Spectral', nlevels=200, win=2, title='reading many scans from SPEC file')
#endif