Skip to content
Snippets Groups Projects
pydeviceCRL.cmd 1.46 KiB
Newer Older
mwyman's avatar
mwyman committed
################################################################################
# PyDevice Support for Transfocator
################################################################################

mwyman's avatar
mwyman committed
# Next two lines set up some testing tools for energy -- can be commented out 
epicsEnvSet("MONOE","testMonoE")
dbLoadRecords("${TOP}/db/energyTestTools.db","P=$(PREFIX), MONOE=$(MONOE), IDENERGY=testIDE")

mwyman's avatar
mwyman committed
#CRL 1 (substitutions file NEEDS WORK)
dbLoadTemplate("substitutions/pyDeviceTfor.substitutions","P=$(PREFIX)")
mwyman's avatar
mwyman committed
pydev("stack_subFile = 'substitutions/pyDeviceTfor.substitutions'")
mwyman's avatar
mwyman committed

# python code NEEDS WORK
pydev("from pyTransfocator_single import singleTF")
pydev("CRL1 = singleTF()")

mwyman's avatar
mwyman committed
# Update the next line for the beamline energy
epicsEnvSet("BLE","$(PREFIX)$(MONOE)")
dbLoadRecords(""${TOP}/db/pyDevCRLsingle.db","P=$(PREFIX), N=1, OBJ=CRL1, STACK_THICK=0.050, MIN_THICK=0.003")


# Update the next line for the beamline energy
epicsEnvSet("BLE","$(PREFIX)$(MONOE)")
dbLoadRecords("${TOP}/db/pyDevFilters.db","P=$(PREFIX), N=1, OBJ=filters, NUM=12, KEV=$(BLE)")

# After iocInit, need to setup attenuation lookup table
# 	filters_subFile - string holding name/rel. location of substitutions file loaded
#                     loaded in  dbLoadTemplate
#   12  - number of filters in this case
# 	8.5 - beam energy in keV used for the initial lookup table setup -- can be updated
#          after startup
doAfterIocInit("pydev('filters.setupLookupTable(filters_subFile, 12, energy = 8.5)')")