Closed gfabbris closed 3 years ago
Let's discuss the best way to implement multiple counting times in a qxscan on Monday.
Thinking how to generalize the process of setting the count time for each type of detector, you would have to add the same custom method to a subclass of each detector type you use, like this:
class MyScalerCH(ScalerCH):
def mySetCountTimePlan(t):
yield from bps.mv(self.preset_time, t)
class MyVortex(VortexBaseClass):
def mySetCountTimePlan(t):
yield from bps.mv(self.set_acquire_time_signal_whatever, t)
scaler = MyScalerCH(prefix, name="scaler")
vortex= MyVortex(prefix, name="vortex")
detectors = [scaler, vortex]
for region in scan_regions:
for det in detectors:
det.mySetCountTime(region.count_time)
iterate through two lists at the same time:
energies = [1,2,3,4]
times = [1,1,2,2]
for e, t in zip(energies, times):
print(e, t)
expect
1 1
2 1
3 2
4 2
@prjemian: Something like this 03fee51 may be something to put in the apstools.KohzuSeqCtl_Monochromator
?
I'll just wait until Monday to test the latest changes a the beamline before merging.
Adds energy scan plans. All are based on the
Escan_list
, which runs the energy scan from anenergy_list
input.Escan
just creates this input with a fixed energy step usingnumpy.linspace
.qxscan
reads theqxscan_params
device (see below) to create the energy list.The
qxscan_params
device has a bunch ofSignal
components that hold the parameters and energy list for a qxscan. I also added some functions that allow for a user interactive setup, and reading/writing the parameters into dictionary and json file. It should be trivial to convert these components intoEpicsSignal
and have them in an medm screen.I left the
abs_plot
callback there, but I'm thinking that it won't be used. Theabsorption_calc
reads an EPICS user_calc that calculates the log(I0/I) (or could be changed to I/I0 for XRF). This is currently not automatically added to the energy scans, but I plan to do that after some testing.closes #27