diff --git a/devices/h.properties b/devices/h.properties new file mode 100644 index 0000000..3ef95ca --- /dev/null +++ b/devices/h.properties @@ -0,0 +1,9 @@ +#Wed Apr 18 11:08:33 CEST 2018 +maxValue=NaN +minValue=NaN +offset=0.0 +precision=-1 +resolution=NaN +rotation=false +scale=1.0 +unit=null diff --git a/devices/hkl_group.properties b/devices/hkl_group.properties new file mode 100644 index 0000000..7ad37d1 --- /dev/null +++ b/devices/hkl_group.properties @@ -0,0 +1,2 @@ +#Wed Apr 18 11:08:33 CEST 2018 +precision=-1 diff --git a/devices/k.properties b/devices/k.properties new file mode 100644 index 0000000..3ef95ca --- /dev/null +++ b/devices/k.properties @@ -0,0 +1,9 @@ +#Wed Apr 18 11:08:33 CEST 2018 +maxValue=NaN +minValue=NaN +offset=0.0 +precision=-1 +resolution=NaN +rotation=false +scale=1.0 +unit=null diff --git a/devices/l.properties b/devices/l.properties new file mode 100644 index 0000000..3ef95ca --- /dev/null +++ b/devices/l.properties @@ -0,0 +1,9 @@ +#Wed Apr 18 11:08:33 CEST 2018 +maxValue=NaN +minValue=NaN +offset=0.0 +precision=-1 +resolution=NaN +rotation=false +scale=1.0 +unit=null diff --git a/script/test/TestDiffcalc.py b/script/test/TestDiffcalc.py new file mode 100644 index 0000000..6adfac5 --- /dev/null +++ b/script/test/TestDiffcalc.py @@ -0,0 +1,68 @@ + +#https://github.com/DiamondLightSource/diffcalc +#Axis +#DC mu delta, gam, eta, chi, phi +# alp del, gam, oh, nu , phi + + +run("diffutils") +setup_diff(sixch, energy) + +#Setup +setup_axis('gam', 0, 179) +setup_axis('del', 0, 179) +setup_axis('del', min=0) +setup_axis('phi', cut=-180.0) +print_axis_setup() + +#Orientation +help(ub.ub) +ub.listub() +# Create a new ub calculation and set lattice parameters +ub.newub('test') +ub.setlat('cubic', 1, 1, 1, 90, 90, 90) +# Add 1st reflection (demonstrating the hardware adapter) +settings.hardware.wavelength = 1 +ub.c2th([1, 0, 0]) # energy from hardware +settings.hardware.position = 0.0, 45.0, 0.0, 0.225, -4.1, -0.1476 +ub.addref([1, 0, 0])# energy and position from hardware +# Add 2nd reflection (this time without the harware adapter) +ub.c2th([0, 1, 0], 12.39842) +ub.addref([0, 1, 0], [0.0, 45.0, 0, 0.225, -4.1, -0.1476], 12.39842) + +# check the state +ub.ub() +ub.checkub() + +#Constraints +help(hkl.con) +hkl.con('qaz', 90) +hkl.con('a_eq_b') +hkl.con('mu', 0) +hkl.con() + +#Motion +print angles_to_hkl((0., 60., 0., 30., 0., 0.)) +print hkl_to_angles(1, 0, 0) +sixc.write([0, 60, 0, 30, 90, 0]) +print "sixc=" , sixc.position +wl.write(1.0) +print "wl = ", wl.read() +ub.lastub() +ub.setu ([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) +ub.showref() +ub.swapref(1,2) +#print you.hkl +#pos(get_hkl()) +hkl_group.read() +#you.hkl.simulateMoveTo([0,1,1]) +#sim(get_hkl(), [0,1,1]) +hkl_group.sim([0.0,1.0,1.0]) +#pos(get_hkl(), [0,1,1]) +hkl_group.write([0.0,1.0,1.0]) + +#Scans +lscan(l, [sin], 1.0, 1.5, 0.1) +ascan([k,l], [sin], [1.0, 1.0], [1.2, 1.3], [0.1, 0.1], zigzag=True, parallel_positioning = False) +vector = [[1.0,1.0,1.0], [1.0,1.0,1.1], [1.0,1.0,1.2], [1.0,1.0,1.4]] +hklscan(vector, [sin, arr], 0.9)