dEph = caget("SATUN:USER-DELTA") Eph1 = caget("SATUN:FELPHOTENE") Eph2 = Eph1 + dEph undlist = ("SATUN06","SATUN07","SATUN08","SATUN09","SATUN10","SATUN11","SATUN12","SATUN13", "SATUN15","SATUN16","SATUN17","SATUN18","SATUN19","SATUN20","SATUN21","SATUN22") 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,K2 for und in undlist: caputq(und + "-UIND030:K_SET", K2[und]) time.sleep(0.5) # Make sure the new K values have been written #Switching on radial motors (and pushing go) to ensure proper movements for und in undlist: caput(und + "-UIND030:RADIAL-ON.PROC", 1) for und in undlist: caput(und + "-UIND030:RADIAL-GO.PROC", 1)