Created
February 18, 2016 19:43
-
-
Save klauer/8874424aacbf47eeb714 to your computer and use it in GitHub Desktop.
bson issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
klauer@xf03id-srv1:~/dev/pyepics$ cat bug.py | |
from ophyd import (SimDetector, TIFFPlugin, HDF5Plugin) | |
from ophyd.device import (Component as Cpt, ) | |
prefix = 'XF:31IDA-BI{Cam:Tbl}' | |
class MyDetector(SimDetector): | |
tiff1 = Cpt(TIFFPlugin, 'TIFF1:') | |
det = MyDetector(prefix) | |
det.wait_for_connection() | |
print(det.describe()) | |
print(det.tiff1.capture.describe()) | |
print(det.tiff1.dim0_sa.get(use_monitor=True)) | |
print(det.tiff1.dim0_sa.get(use_monitor=False)) | |
import bson | |
import numpy as np | |
from metadatastore.commands import _transform_data | |
import collections | |
timestamps = collections.defaultdict(lambda key=None: 0.0) | |
ddet = _transform_data(det.read(), timestamps) | |
dtiff = _transform_data(det.tiff1.read(), timestamps) | |
bson.BSON.encode(ddet) | |
bson.BSON.encode(dtiff) |
Author
klauer
commented
Feb 18, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment