@@ -16,7 +16,7 @@ outputs h5 file with the same structure of the data in databroker.
16
16
17
17
from suitcase import hdf5
18
18
last_run = db[- 1 ] # get header from databroker
19
- hdf5.export(last_run, ' myfile.h5' , mds = db.mds )
19
+ hdf5.export(last_run, ' myfile.h5' , db = db)
20
20
21
21
The first argument may be a single Header or a list of Headers. You can also use keyword "fields"
22
22
in the "export" function to define specifically which data sets you want to output.
@@ -28,7 +28,7 @@ in the "export" function to define specifically which data sets you want to outp
28
28
un_wanted_fields = [' A' , ' B' , ' C' ]
29
29
fds = hdf5.filter_fields(hdr, un_wanted_fields)
30
30
filename = ' scanID_123.h5'
31
- hdf5.export(hdr, filename, mds = db.mds , fields = fds)
31
+ hdf5.export(hdr, filename, db = db, fields = fds)
32
32
33
33
Here I assume A, B, C are keywords for some vector data, like images. You can define them as un_wanted_fields.
34
34
If all vector data are blocked, saving data with only scaler data and header information should be very faster.
@@ -55,7 +55,7 @@ solution 1: decorator
55
55
return doc
56
56
return rebinner
57
57
58
- hdf5.export(last_run, ' myfile.h5' , mds = db.mds , filter = make_rebinner(3 , ' a' ))
58
+ hdf5.export(last_run, ' myfile.h5' , db = db, filter = make_rebinner(3 , ' a' ))
59
59
60
60
61
61
@@ -69,7 +69,7 @@ solution 2: partial function
69
69
def rebinner (n , field , name , doc )
70
70
make_rebinner = partial(rebinner, 3 , ' a' )
71
71
72
- hdf5.export(last_run, ' myfile.h5' , mds = db.mds , filter = make_rebinner)
72
+ hdf5.export(last_run, ' myfile.h5' , db = db, filter = make_rebinner)
73
73
74
74
75
75
solution 3: use class
@@ -86,7 +86,7 @@ solution 3: use class
86
86
def __call__ ()self , name , doc ):
87
87
...
88
88
89
- hdf5.export(last_run, ' myfile.h5' , mds = db.mds , filter = ReBinner(3 , ' a' ))
89
+ hdf5.export(last_run, ' myfile.h5' , db = db, filter = ReBinner(3 , ' a' ))
90
90
91
91
We can use base class from bluesky.
92
92
@@ -95,6 +95,6 @@ solution 4: based on original export function
95
95
96
96
.. code-block :: python
97
97
98
- hdf5.export(last_run, ' myfile.h5' , mds = db.mds , filter , filter_kwargs)
98
+ hdf5.export(last_run, ' myfile.h5' , db = db, filter , filter_kwargs)
99
99
100
100
# use filter function as filter(name, doc, filter_kwargs)
0 commit comments