@@ -16,7 +16,7 @@ outputs h5 file with the same structure of the data in databroker.
1616
1717 from suitcase import hdf5
1818 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)
2020
2121 The first argument may be a single Header or a list of Headers. You can also use keyword "fields"
2222in 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
2828 un_wanted_fields = [' A' , ' B' , ' C' ]
2929 fds = hdf5.filter_fields(hdr, un_wanted_fields)
3030 filename = ' scanID_123.h5'
31- hdf5.export(hdr, filename, mds = db.mds , fields = fds)
31+ hdf5.export(hdr, filename, db = db, fields = fds)
3232
3333 Here I assume A, B, C are keywords for some vector data, like images. You can define them as un_wanted_fields.
3434If 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
5555 return doc
5656 return rebinner
5757
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' ))
5959
6060
6161
@@ -69,7 +69,7 @@ solution 2: partial function
6969 def rebinner (n , field , name , doc )
7070 make_rebinner = partial(rebinner, 3 , ' a' )
7171
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)
7373
7474
7575 solution 3: use class
@@ -86,7 +86,7 @@ solution 3: use class
8686 def __call__ ()self , name , doc ):
8787 ...
8888
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' ))
9090
9191 We can use base class from bluesky.
9292
@@ -95,6 +95,6 @@ solution 4: based on original export function
9595
9696.. code-block :: python
9797
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)
9999
100100 # use filter function as filter(name, doc, filter_kwargs)
0 commit comments