Files
x04sa-es3/script/daq/daq3-setup.py
gac-x04sa f295b182cb Closedown
2019-02-11 13:05:41 +01:00

76 lines
2.1 KiB
Python

###################################################################################################\
#Geometry
###################################################################################################
set_geometry("fourcv", True)
###################################################################################################\
#Constraints
###################################################################################################
#hkl.con('a_eq_b')
#equivalent to 'setmode 0' + 'freeze 5'
hkl.con( 'alpha', 5) #alpha constant
#equivalent to 'setmode 1' + 'freeze 5'
#hkl.con( 'beta', 5) #alpha constant
#equivalent to 'setmode 2''
#hkl.con( 'a_eq_b', 0) #alpha constant
#hkl.con( 'eta', 0)
setup_axis(alpha, alpha.getMinValue(), alpha.getMaxValue())
setup_axis(delta, delta.getMinValue(), 90) #delta.getMaxValue())
setup_axis(gamma, gamma.getMinValue(), gamma.getMaxValue())
setup_axis(omegaV, omegaV.getMinValue(), omegaV.getMaxValue())
###################################################################################################\
#Orientation
###################################################################################################
"""
Enter real space lattice parameters:
Lattice a (1.305)? 7.723
Lattice b (1.305)? 7.707
Lattice c (1.305)? 7.723
Lattice alpha (90)? 90
Lattice beta (90)? 89.265
Lattice gamma (90)? 90
"""
ub.newub('test1')
ub.setlat('cubic', 7.723, 7.707, 7.723, 90.0, 89.265, 90.0)
#en = 9.5
#en = 12.4 #!!!!!
#Only available in newer Diffcalc
#ub.setmiscut(0)
#Calculated with newer Diffcalc
# UB matrix: 0.81363 0.00000 -0.01044
# 0.00000 0.81526 0.00000
# 0.00000 0.00000 0.81357
#ub.setub([[ 0.81363, 0.00000, 0.00000], [0.00000, 0.81526, 0.00000], [-0.01044, 0.00000, 0.81357]])
ub.addref([0, 1, 2], [5.0, 9.379, 19.7895, 102.6162], energy.take())
ub.addref([2, 0, 2], [5.0, 19.0754, 20.1865, 11.9693], energy.take())
ub.addref([2, 2, 2], [5.0, 27.1234, 21.2368, 60.0354], energy.take())
ub.ub()
ub.checkub()
calc_ub = get_ub_matrix()
#print angles_to_hkl((44.3400, 0.0000, 123.7322 , 0.0))[0]
hkl_to_angles(0, 1, 2)[0]