Open tacaswell opened 3 years ago
Example usage.
from databroker._drivers.msgpack import BlueskyMsgpackCatalog
from suitcase.msgpack import Serializer
def sanitize_start(doc):
doc["beamline_id"] = "MAD"
for k in ("group", "project"):
doc.pop(k, None)
doc["sample"]["type"] = "Cool Material"
return doc
cat = BlueskyMsgpackCatalog('/tmp/some_source/*.msgpack')
target = Serializer('/tmp/targetl')
for name, doc in scrub([cat[i] for i in cat], 0, 1000, sanitize_start):
target(name, doc)
test = BlueskyMsgpackCatalog("/tmp/*msgpack")
This is primarily useful if you want to obscure the origin of some data.