BCDA-APS / bluesky_training

Bluesky training, including instrument package
https://bcda-aps.github.io/bluesky_training/
Other
11 stars 0 forks source link

DOC clarify and generalize instruction to make XY plots from databroker. #148

Closed prjemian closed 1 year ago

prjemian commented 1 year ago
prjemian commented 1 year ago

FYI, this should not impact PR #143

rodolakis commented 1 year ago

I had one more comment I forgot about. In step 2: https://github.com/BCDA-APS/bluesky_training/blob/2fa14dd2e6d87b13801ffe16d9a5c4faf627ff56/docs/source/howto/_plot_x_y_databroker.ipynb#L53

I would not talk about step 3 (which makes the reader go back and forth), nor m1 or noisy since it is not relevant to this part of the code anyway. This can be introduced directly in step 3, where I would say:

3. Show the (primary) data Get all the data available from the primary stream, which is where bluesky stores the data acquired from a scan. databroker returns this data as an xarray Dataset: the run withscan_id=86 has a scan of detector vs. motor: (m1, noisy). We'll refer to these as data variables to be consistent with the xarray.Dataset (as shown in the table below).

Then Step 4 becomes:

4. Get data for the x and y axes The plotting steps become easier (and more general) if we create objects for each specific data variable to be plotted. Pick the m1 (motor readback value) and noisy data for x and y, respectively.

Agreed with removing Step 7.

rodolakis commented 1 year ago

One last modification needed:

2. Choose a specific run from a catalog Here, the class_data_examples catalog will be used.

=> remove the sentence that was moved to step 3.

You could add something like this though:

2. Choose a specific run from a catalog Here, the class_data_examples catalog will be used. We can create an instance of this catalog and assign it to the variable cat; run is a dictionary-like object that can be used to access the data from the scan_id=86.

Also, in Step 3, there is an extra space before scan in scan_id=86.

I believe that would be all!

prjemian commented 1 year ago

Decided to keep the scan_id=86 in step 2 since that is where it is used.

prjemian commented 1 year ago

Clipboard01 Clipboard02

rodolakis commented 1 year ago

That would work , but you did not like my suggestion?

2. Choose a specific run from a catalog Here, the class_data_examples catalog will be used. We can create an instance of this catalog and assign it to the variable cat; run is a dictionary-like object that can be used to access the data from the scan_id=86.

That way it explains a bit what you are doing with those 2 lines of code.

prjemian commented 1 year ago

That would work , but you did not like my suggestion?

Oops. I missed it. Adding that now.

prjemian commented 1 year ago

@rodolakis Is this ready to merge?