Version 1.14

This commit is contained in:
root
2020-08-14 16:25:14 +02:00
parent 481360d1f8
commit 9547784e17
18 changed files with 152 additions and 86 deletions
@@ -1,5 +1,5 @@
Eph1 = 11.312 # actual photon energy
Eph2 = 12.00 # desired photon energy
Eph1 = 11.65 # actual photon energy
Eph2 = 12.05 # desired photon energy
do_elog = True
@@ -11,9 +11,6 @@ for und in undlist:
K1[und] = K
K2[und] = ((Eph1 / Eph2 * (K**2 + 2) - 2))**0.5
print K1,K2
#if Eph2 > Eph1 :
# for und in undlist: caput(und + "-UIND030:K_SET", 1.1)
# time.sleep(40.0)
for und in undlist: caput(und + "-UIND030:K_SET", K2[und])
#Elog entry
@@ -21,5 +18,4 @@ if do_elog:
title = "Wavelength change"
log_msg = "Old photon energy: %0.2f" % Eph1 + " kev\n"
log_msg = log_msg + "New photon energy: %0.2f" % Eph2 + " keV\n"
attachments = None
elog(title, log_msg, attachments)
elog(title, log_msg)
+38
View File
@@ -0,0 +1,38 @@
undlist = ("SATUN17","SATUN18","SATUN19","SATUN20","SATUN21","SATUN22")
### getting current photon energy:
Eph1 = caget(undlist[0] + "-UIND030:FELPHOTENE")
#Eph1 = 0.530 # actual photon energy in keV
print("Photon energy at start (at ", undlist[0],") : ", round(Eph1,4))
### give desired photon energy via relative or absolute method.
### please comment the other out!
### relative change in photon energy:
#step = -0.002 # desired step to scale in keV
#Eph2 = Eph1 + step
### absolute change in photon energy:
Eph2 = 0.540 # desired photon energy in keV
print("Photon energy at end: ", round(Eph2,4))
do_elog = True
### actual code:
K1, K2 = {}, {}
for und in undlist:
K = caget(und + "-UIND030:K_SET")
K1[und] = K
K2[und] = ((Eph1 / Eph2 * (K**2 + 2) - 2))**0.5
print(K1)
print(K2)
for und in undlist: caput(und + "-UIND030:K_SET", K2[und])
### create Elog entry
if do_elog:
title = "Athos wavelength change"
log_msg = "Old photon energy: %0.4f" % Eph1 + " kev\n"
log_msg = log_msg + "New photon energy: %0.4f" % Eph2 + " keV\n"
elog(title, log_msg)