Open prjemian opened 5 years ago
@jphammonds:
I have used a tool that allows viewing (and editing!) of the mongodb. It knows nothing about databroker. It's the only raw mongodb viewing I am using now. Certainly there must be others but this one was free and available when I looked. So, I put it on our APS common file server. (There is also a .bat version of the starter for Windows.)
Caution: Since it allows editing, be very judicious in how and when you use this!
You run mViewer by starting a local web server with a port number:
path/to/start_mviewer.sh 8086
access it from a browser session:
/bin/google-chrome http://localhost:8086/index.html
mongodb viewer hints:
host:
So far, there is a big opportunity for someone to make a plotting tool. None exists now, so I believe.
You have probably found the databroker tutorial: http://nsls-ii.github.io/databroker/tutorial.html
I suggest starting with the simple:
db[...].table(stream_name='...').plot()
Separately, we are working on a GUI that sits on top of databroker and lets you search, browse, and visualize Runs. I spent a couple hours on it today, in fact.
We plan to build our tools on top of the databroker API and avoid interacting with Mongo directly so that the tools we write can work equally well on top of any storage backend. We have some prototypes that provide a db
object on top of a directory of local files, an HTTP client, etc.
Dan,
I have tried the plot as you have suggested below but I am getting errors with this. A plot window pops up but it is empty.
I am able to list the table:
In [10]: db[-1].table(stream_name="depSys_gun_selector_mps1_voltage_rbv_monitor") Out[10]: time depSys_gun_selector_mps1_voltage_rbv seq_num 1 2019-04-16 16:26:15.623624086 2.8 2 2019-04-16 16:26:15.953511953 2.7 3 2019-04-16 16:26:16.728308678 2.8 4 2019-04-16 16:26:17.556593180 2.7 5 2019-04-16 16:26:19.191735268 379.8 6 2019-04-16 16:26:20.172238111 373.1 7 2019-04-16 16:26:21.005825043 372.8 8 2019-04-16 16:26:21.821944237 372.6 9 2019-04-16 16:26:22.647333145 372.5 10 2019-04-16 16:26:23.454028368 372.3 11 2019-04-16 16:26:24.260576248 372.2 12 2019-04-16 16:26:25.856822968 372.0 13 2019-04-16 16:26:26.659313917 371.7 14 2019-04-16 16:26:27.460757971 371.3 15 2019-04-16 16:26:28.245575190 373.5 16 2019-04-16 16:26:29.042916298 374.9 17 2019-04-16 16:26:29.891757250 370.7 18 2019-04-16 16:26:30.712952137 370.3 19 2019-04-16 16:26:31.478217125 370.2 20 2019-04-16 16:26:32.246970654 370.1 21 2019-04-16 16:26:33.029160023 370.0 22 2019-04-16 16:26:34.624567747 372.3 23 2019-04-16 16:26:35.452236652 374.2 24 2019-04-16 16:26:36.240039587 370.9 25 2019-04-16 16:26:37.073646069 370.8 26 2019-04-16 16:26:37.866647482 371.3 27 2019-04-16 16:26:38.682386875 371.4 28 2019-04-16 16:26:39.429312944 371.0 29 2019-04-16 16:26:40.259035587 370.9 30 2019-04-16 16:26:41.053616285 374.1 ... ... ... 57 2019-04-16 16:27:08.245858669 370.8 58 2019-04-16 16:27:09.029613972 370.0 59 2019-04-16 16:27:09.869656086 370.1 60 2019-04-16 16:27:10.643858671 370.0 61 2019-04-16 16:27:12.232585907 369.8 62 2019-04-16 16:27:13.074648380 370.2 63 2019-04-16 16:27:13.869327068 374.2 64 2019-04-16 16:27:14.632007122 372.8 65 2019-04-16 16:27:15.459666491 370.5 66 2019-04-16 16:27:16.241833925 371.0 67 2019-04-16 16:27:17.102390528 371.3 68 2019-04-16 16:27:18.688259363 371.1 69 2019-04-16 16:27:19.437182426 370.8 70 2019-04-16 16:27:20.284363270 372.7 71 2019-04-16 16:27:21.052206039 374.6 72 2019-04-16 16:27:21.891086102 370.5 73 2019-04-16 16:27:22.680588484 370.0 74 2019-04-16 16:27:23.463406324 370.1 75 2019-04-16 16:27:25.054121017 369.9 76 2019-04-16 16:27:25.880553722 369.8 77 2019-04-16 16:27:26.673506260 370.6 78 2019-04-16 16:27:27.444765806 374.8 79 2019-04-16 16:27:28.281283140 371.9 80 2019-04-16 16:27:29.083446503 370.6 81 2019-04-16 16:27:29.853262186 371.1 82 2019-04-16 16:27:30.626524687 371.3 83 2019-04-16 16:27:31.452813148 371.4 84 2019-04-16 16:27:32.278028011 199.0 85 2019-04-16 16:27:33.114491940 7.8 86 2019-04-16 16:27:33.916901350 2.7
[86 rows x 2 columns]
But when I try to plot I get the following:
ValueError Traceback (most recent call last)
I should mention that tools to look at the info in the database are really needed. I do not think that the users are going to really want to use the command line for this. The guy I am working with mentioned that he thought part of the reason for going with BlueSky was that since it would be used by a number of beamlines that there would be tools like this to go along with it. I am trying to move back to another project at the moment (totally unrelated) so I don’t have time right now to get to this.
John
From: Dan Allan notifications@github.com Reply-To: NSLS-II/databroker reply@reply.github.com Date: Tuesday, April 16, 2019 at 10:15 PM To: NSLS-II/databroker databroker@noreply.github.com Cc: "JPHammonds@anl.gov" jphammonds@anl.gov, Mention mention@noreply.github.com Subject: Re: [NSLS-II/databroker] Any plans for a visualization tool for databroker? (#399)
I suggest starting with the simple:
db[...].table(stream_name='...').plot()
Separately, we are working on a GUI that sits on top of databroker and lets you search, browse, and visualize Runs. I spent a couple hours on it today, in fact.
We plan to build our tools on top of the databroker API and avoid interacting with Mongo directly so that the tools we write can work equally well on top of any storage backend. We have some prototypes that provide a db object on top of a directory of local files, an HTTP client, etc.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/NSLS-II/databroker/issues/399#issuecomment-483920914, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIn0MIiyvJsdg5R15mOcBNffCD0P8ug-ks5vhpGfgaJpZM4czjHu.
@JPHammonds We have finally made some good progress on this. See https://github.com/bluesky/bluesky-browser
It's not quite ready for users---still a bit too easy to crash---and it needs docs, but I expect it to be stable enough in a month or two.
This query at APS today from @jphammonds expresses the basic question:
Are there any tools to visually inspect the tables in the databases? For instance, I am setting up to monitor pvs during the run by setting monitors in the preprocessor’s Supplemental Data. Anything that allows browsing the runs (such as db[#]) and see the items available for plotting?
I am also recording some items at certain points in the cycle. Any way to view this?
I would assume a tool like this would simply live outside of bluesky & examine the mongo db independently.
For example, bluesky_snapshot_viewer (a GUI created by:
apstools.callbacks.SnapshotReport()
) is a tool to visualize a specific type of scan (abluesky_snapshot
)