Skip to content

Commit

Permalink
error handling for bluesky acquisition
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaswmorris committed Apr 17, 2023
1 parent fe89a6b commit c21580e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions bloptools/bo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import logging

import bluesky.plan_stubs as bps
import bluesky.plans as bp # noqa F401
import h5py
Expand Down Expand Up @@ -203,12 +205,14 @@ def acquire_with_bluesky(self, params, routing=True, verbose=False):
if verbose:
print(f"sampling {ordered_params}")

# try:
uid = yield from bp.list_scan(
self.dets, *[_ for items in zip(self.dofs, np.atleast_2d(ordered_params).T) for _ in items]
)
_table = self.db[uid].table(fill=True)
_table.loc[:, "uid"] = uid
try:
uid = yield from bp.list_scan(
self.dets, *[_ for items in zip(self.dofs, np.atleast_2d(ordered_params).T) for _ in items]
)
_table = self.db[uid].table(fill=True)
_table.loc[:, "uid"] = uid
except Exception as err:
logging.warning(repr(err))

for i, entry in _table.iterrows():
keys, vals = self.experiment.parse_entry(entry)
Expand Down

0 comments on commit c21580e

Please sign in to comment.