Skip to content

Instantly share code, notes, and snippets.

@chiahaoliu
Last active February 19, 2019 05:16
Show Gist options
  • Save chiahaoliu/cde72d3bdc8e0118b426d29289894a77 to your computer and use it in GitHub Desktop.
Save chiahaoliu/cde72d3bdc8e0118b426d29289894a77 to your computer and use it in GitHub Desktop.
configure area det by Msg
import bluesky.plan_stubs as bps
from xpdacq.beamtime import _check_mini_expo
def configure_area_det_expo(expo):
area_det = xpd_configuration['area_det']
# compute number of frames
acq_time = area_det.cam.acquire_time.get()
_check_mini_expo(exposure, acq_time)
num_frame = np.ceil(exposure / acq_time)
computed_exposure = num_frame * acq_time
yield from bps.mv(area_det.images_per_set, num_frame)
# print exposure time
print("INFO: requested exposure time = {} - > computed exposure time"
"= {}".format(exposure, computed_exposure))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment