This commit is contained in:
2019-03-20 13:52:00 +01:00
parent 3084fe0510
commit 5db0f78aee
910 changed files with 191152 additions and 322 deletions

View File

@@ -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")