Make necessary updates to load HXN data from tiled#341
Make necessary updates to load HXN data from tiled#341psavery wants to merge 1 commit intoNSLS2:masterfrom
Conversation
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
|
Hi, @psavery , thank you putting this PR together -- I think this is a really great start! What we may need to do is to replace databroker completely and use the pure Tiled client instead (ideally pointing to the SQL-backed server), e.g. Ideally, any processing script/method would take an instance of the Tiled client as an argument and extract all necessary information (data and metadata) directly from it (instead of having several data-loading functions that rely on a global instance of I am happy to help you with this migration to Tiled; it shouldn't be very hard, and it looks like you've already got most of the parts covered. |
For this, I tried to take an approach such that the relevant functions, such as
map_data2D_hxn(), will run properly whetherdbis a v0DataBrokerinstance or a v2 instance (which uses tiled). This would enabledbto just be swapped out for a v2 instance when the time is right.There is a variable
is_tiledthat tries to determine whether v2 is being used or v0, and some of the logic, in just a few places, branches based upon whether tiled is being used or not.Some of the metadata needed to be accessed like
start_doc['dimensions']instead ofstart_doc.dimensions, but this appeared to work for both v0 and v2.I realize this does not take into account the changes in #339. But I think the changes here are simple enough to take into account once #339 is merged.
These changes appeared to work fine with DataBroker v0. I had an example using DataBroker v2 that appeared to have the metadata, but not the data itself. I think it loaded and formatted all the metadata correctly, but there is a little uncertainty as to whether loading the data in to the pandas frame at the end is correct - that is something we can determine once we have a real example.