APS-4ID-POLAR / ipython-polar

4-ID-Polar ipython configuration for bluesky (and other)
1 stars 3 forks source link

Energy scan #33

Closed gfabbris closed 3 years ago

gfabbris commented 4 years ago

closes #27

gfabbris commented 4 years ago

Let's discuss the best way to implement multiple counting times in a qxscan on Monday.

prjemian commented 4 years ago

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)
prjemian commented 4 years ago

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
gfabbris commented 4 years ago

@prjemian: Something like this 03fee51 may be something to put in the apstools.KohzuSeqCtl_Monochromator?

gfabbris commented 4 years ago

I'll just wait until Monday to test the latest changes a the beamline before merging.