Skip to content

Instantly share code, notes, and snippets.

@chiahaoliu
Created November 28, 2017 02:53
Show Gist options
  • Save chiahaoliu/1a0d08d6a7adc76b18c0a6e2c37db539 to your computer and use it in GitHub Desktop.
Save chiahaoliu/1a0d08d6a7adc76b18c0a6e2c37db539 to your computer and use it in GitHub Desktop.
def configure_pe1c(exp):
try:
from bluesky.plans import abs_set
except ImportError:
from bluesky.plan_stubs import abs_set
acq_time = pe1c.cam.acquire_time.get()
num_frame = np.ceil(exp/acq_time)
computed_exp = num_frame * acq_time
yield from abs_set(pe1c.images_per_set, num_frame, wait=True)
print("INFO: requested exposure time = {} - > computed exposure time"
"= {}".format(exp, computed_exp))
expo_time = 17
RE(configure_pe1c(expo_time))
assert int(expo_time/pe1c.cam.acquire_time.get()) == pe1c.images_per_set.get()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment