Conversation
There was a problem hiding this comment.
This notebook is missing from the docs index and thus not rendered in the built docs
There was a problem hiding this comment.
Line-comments aren't possible on Notebooks?
It's still not in the NeXus files, so a change is needed anyway in the future and this can be ignored in favor of that future change:
We now know where the actual Bragg peak monitor is located: 800 mm from the sample, 57 degrees rotated from the tank centerline (with the same sense and rotation axis as a4). Changing the location slightly changes the range of |Q| but doesn't otherwise change the overall impression.
| "\n", | ||
| "# Increase this number for more reliable results:\n", | ||
| "workflow[NumberOfSimulatedNeutrons] = 200_000" | ||
| "workflow[NumberOfSimulatedNeutrons] = 600_000" |
There was a problem hiding this comment.
Did you need to bump the number for building the docs? Did it not look right with 200_000?
There was a problem hiding this comment.
I needed to bump it up beacause the increased range.
The old number actually lead to some gaps in the table even for the old range.
| import scipp as sc | ||
| from matplotlib.axes import Axes | ||
| from matplotlib.patches import Circle | ||
| from plopp.widgets import Box |
There was a problem hiding this comment.
Depending on lazy_loader, this may now make ipywidgets a hard dependency of essspectroscopy. Not sure if we want that?
There was a problem hiding this comment.
Probably not. I moved the import into the function.
|
|
||
| def update_circle(q_range: tuple[float, float]) -> None: | ||
| lo_circle.radius, hi_circle.radius = q_range | ||
| q_map_fig.fig.canvas.draw_idle() |
There was a problem hiding this comment.
| q_map_fig.fig.canvas.draw_idle() | |
| q_map_fig.canvas.draw() |
This sfould also work
| lo_circle.radius, hi_circle.radius = q_range | ||
| q_map_fig.fig.canvas.draw_idle() | ||
|
|
||
| pp.View(pp.Node(update_circle, slider_node)) |
There was a problem hiding this comment.
Add a comment as to why this View is needed?
And maybe a TODO to remove it once we release the changes with the leaf nodes?
To avoid making ipywidgets a hard dependency.
|
I implemented a coloured range under the ROI. This was a little tricky because of MPL requiring different data formats for creating the fill, updating it, and for the lines. I hope we can reuse this elsewhere. |
| return self._r_outer | ||
|
|
||
| @property | ||
| def closed_xy(self) -> npt.NDArray[float]: |
There was a problem hiding this comment.
closed_xy and open_path -> standardize the names?
| ) | ||
|
|
||
|
|
||
| def make_q_map( |
There was a problem hiding this comment.
I am not clear on whether the below would be needed for ESSlivedata? If so, is there anything that can be made plotting-lib independent?
There was a problem hiding this comment.
How would that work? This code has to slice the data in the widget (plopp graph). So you would need to do that in the dashboard frontend. I didn't think this would work and so was going to implement something similar to #66
There was a problem hiding this comment.
It is just that I did not understand whether such a complicated setup code would also be needed make a regular plot.
There was a problem hiding this comment.
Or is that what you meant with
I will add extra providers to compute the Q projections directly for live data in a separate PR. Please check that the current implementation makes sense!
?
There was a problem hiding this comment.
Yes. This setup is only complicated because the code draws the circles and annulus into the plot. Slicing itself is pretty much trivial.
g5t
left a comment
There was a problem hiding this comment.
I think a fixed a3 step size is more useful than a fixed number of a3 steps. Fixing the limits as well would work, and a user (or NICOS) should know the scan limits in advance.
| events: sc.DataArray, | ||
| q_parallel_bins: int | sc.Variable, | ||
| q_perpendicular_bins: int | sc.Variable, | ||
| sample_rotation_bins: int | sc.Variable, |
There was a problem hiding this comment.
Maybe a bit too particular:
when the range of data left in sliced after the |Q| slicing below changes, this constant-number-of-a3-bins approach causes the bin-widths to change. Instead I think a constant a3-bin-width with overall bin-limits set by the range in sliced would be better (or just an explicit bin axis, e.g., sc.linspace(dim='a3', start=0, stop=360, step=0.5, unit='deg'))
There was a problem hiding this comment.
I changed it to a constant bin width. That should be enough for now. We can change to passing concrete bin edges later if need be.
There was a problem hiding this comment.
Line-comments aren't possible on Notebooks?
It's still not in the NeXus files, so a change is needed anyway in the future and this can be ignored in favor of that future change:
We now know where the actual Bragg peak monitor is located: 800 mm from the sample, 57 degrees rotated from the tank centerline (with the same sense and rotation axis as a4). Changing the location slightly changes the range of |Q| but doesn't otherwise change the overall impression.
Part of #67. This adds a new single crystal diffraction workflow for BIFROST's Bragg peak monitor. I separated it from the main workflow because we want need to treat the monitor as a detector and handle it differently from the inelastic detectors.
The workflow will need some adjustments to make it properly load a Bragg peak monitor from nexus. But we can only really do that once we have a file.
I will add extra providers to compute the Q projections directly for live data in a separate PR. Please check that the current implementation makes sense!