This commit is contained in:
gac-x04sa
2019-08-16 14:54:56 +02:00
parent 4a9cf08623
commit 74c54dff38
208 changed files with 40866 additions and 130 deletions
@@ -0,0 +1,24 @@
from diffcalc.util import allnum, command, DiffcalcException
def sim(scn, hkl):
"""sim hkl scn -- simulates moving scannable (not all)
"""
if not isinstance(hkl, (tuple, list)):
raise TypeError()
if not allnum(hkl):
raise TypeError()
try:
print scn.simulateMoveTo(hkl)
except AttributeError:
raise TypeError(
"The first argument does not support simulated moves")
def energy_to_wavelength(energy):
try:
return 12.39842 / energy
except ZeroDivisionError:
raise DiffcalcException(
"Cannot calculate hkl position as Energy is set to 0")