BCDA-APS / use_bluesky

Tools to help APS use the Bluesky Framework (https://blueskyproject.io/)
8 stars 3 forks source link

Create area detector example with external trigger #103

Closed prjemian closed 3 years ago

prjemian commented 3 years ago

Request on MS Teams:

Please add an example of using external triggering mode of an area detector (maybe here, https://nbviewer.jupyter.org/github/BCDA-APS/use_bluesky/blob/main/lessons/lesson6.ipynb). I would like to arm an area detector and struck (MCA mode), and trigger them externally.

prjemian commented 3 years ago

Pointed to example from 2BM-B (tomography) where that detector was configured for external triggering (by hardware pulses from the motor stage).

The ophyd part of this work is to configure the detector's stage_sigs dictionary with the settings for external triggering. Here is the code (on the detector device, not the cam module):

https://github.com/APS-2BM-MIC/ipython-user2bmb/blob/94301cff74be34b67e4642d264bc83739f22d532/profile_2bmb/startup/25-PG3-grasshopper.py#L124-L133

    pg3_det.cam.stage_sigs["gain"] = 0
    pg3_det.cam.stage_sigs["auto_exposure_on_off"] = "Off"
    pg3_det.cam.stage_sigs["auto_exposure_auto_mode"] = "Manual"
    pg3_det.cam.stage_sigs["shutter_auto_mode"] = "Manual"
    pg3_det.cam.stage_sigs["gain_auto_mode"] = "Manual"
    pg3_det.cam.stage_sigs["trigger_mode_on_off"] = "Off"
    pg3_det.cam.stage_sigs["trigger_mode_auto_mode"] = "Manual"
    pg3_det.cam.stage_sigs["trigger_delay_on_off"] = "Off"
    pg3_det.cam.stage_sigs["frame_rate_on_off"] = "Off"
    pg3_det.cam.stage_sigs["frame_rate_auto_mode"] = "Manual"
prjemian commented 3 years ago

Hard to make an example notebook for this since the details are always specific to the implementation and external hardware is required.