Closed gfabbris closed 2 years ago
This pull request introduces 1 alert when merging 776c459a12e4f5357bdb8aea9a022f2464100222 into e9ac549a33e158efc2f321b2333a76a1c0de0c1c - view on LGTM.com
new alerts:
This pull request introduces 1 alert when merging 12bd01b85215ddb5b5c2fc8b369e7802e5972e95 into e9ac549a33e158efc2f321b2333a76a1c0de0c1c - view on LGTM.com
new alerts:
The current trigger
process can have a pretty bad dead time, because the PV being tracked is not optimal (the detector is ready to take another image before that). I'm exploring a change that might help in the eiger_new_mechanism banch.
@prjemian and @strempfer: This is ready for review.
I didn't test the latest version with the detector, but I'm willing to just merge and fix it later if needed (not sure when will have access to the detector).
Note that this creates two options of trigger, time-based and new-image-based, that can be selected during load.
The setup was heavily based on the NSLS2 CHX, and the handler was based on the
area_detector_handlers.eiger.EigerHandler
.Some of the most important aspects:
This was tested at the beamline, but without x-rays.
The trigger is based on EPICS updating the image count (
eiger.cam.array_counter
), which is probably a bit slow.The stage/unstage process has a bunch of blocking calls that are not managed by the
RunEngine
. As far as I can tell this is also done by other area detector devices setup at NSLS2, but I think this is not great. This can get ugly if you try to "control+c" while these blocking calls are going on.The image file naming used here is probably debatable. It is controlled by
eiger.file.base_name
, and will automatically create a new folder using that base name. It will automatically try to add theeiger.file.seq_id
in the same so that the folders are unique:https://github.com/APS-4ID-POLAR/ipython-polar/blob/1050815165d1dbc1e79ec5431789b8ed66ae23cb/profile_bluesky/startup/instrument/devices/ad_eiger.py#L144 but it will raise an
OSError
if the folder already exists! And note that our local scans will change the file names to bescan{}
.format(RE.md["scan_id"]+1), which tracks the scan number. https://github.com/APS-4ID-POLAR/ipython-polar/blob/1050815165d1dbc1e79ec5431789b8ed66ae23cb/profile_bluesky/startup/instrument/plans/local_scans.py#L186The
MyEigerHandler
needs to be registered with the localdb
while reading. So it might be better to move it topolartools
after this pull request is settled.This also adds the nanopositioner motors and local versions of the
grid_scan
andrel_grid_scan
(with all the 4-ID-D specific pre-processing).Closes #130.