-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intrument view cleanup proposal #1230
Comments
|
Yes I know it sounds advanced. I actually got something basic, a proof of concept, working in the instrument view with just a few lines of code, so it's actually not so complex to achieve. It is however going against the current idea that we should be simplifying things, rather than adding more functionality. It was just an idea I came up with when talking about how none of the different projections in Mantid work perfectly for Loki, and if we could come up with something new/different. |
One difficulty with this is that in Which is why I thought of changing the opacities via an RGBA color. You can even set the opacity to zero, which would look as if there are no other points there. |
This sounds like a good option then to combine with the |
The question on the binning is important I think. On one hand, it would be really nice to have a range selection slider that you can also drag around, exactly like the slider in the Mantid instrument view (e.g. something that looks like the slider here: https://ghusse.github.io/jQRangeSlider/) On the other hand, we need to keep in mind the reproducibility aspect of things, and if we add too many widgets, the user can no longer know how he/she obtained the figure after playing with it for a while. Binning manually beforehand would help here. Adaptive binning is something we talked about for realigned data also, so maybe doing so with such a slider would be nice, and could be introduced as a more generic feature, instead of purely for the instrument view. |
The instrument view code has become quite large, with many different functionalities, and is in dire need of a cleanup/refactor.
This outlines suggestions for the work to be done:
Split the code into multiple files, and put them into a sub-directory -> this has been done as part of Rewrite plotting #1324
Add unit testing for the different functions inside the instrument view -> this will be done as part of unit testing for all plotting code. See Refactor plotting code #1323 .
After internal discussions in the scipp team and also talking to LOKI scientists, we propose that the instrument view should be a purely 3D tool, leaving the 2D (spherical, cylindrical) projections to the classical 2D matplotlib plotting that is used elsewhere in scipp, via the use of
groupby
andrealgned
data. Usinggroupby
is much more flexible than having a small set of predefined hard-coded projections, and removing the 2D projections from the instrument view code would simplify things quite a lot.Axes labeling is currently not great, with the size of the tick labels depending on the pixel size, which does not work well in most cases:
![Screenshot_2020-06-30_11-37-35](https://user-images.githubusercontent.com/39047984/86110673-2711f280-bac6-11ea-98eb-906c7811f34d.png)
A maybe better solution would be to draw a box outline around the pixels, and add labels on the sides of the box. They would then be scaled according to the size of the box.
Camera initial
lookAt
andposition
could be based on the centre of the box outline, instead of being[0, 0, 0]
by default, which should allieviate problems when an instrument has all its detectors far away from the origin (also the origin could be defined as the sample, or the source chopper, or anything, so always pointing at the origin makes little sense, we need to look at the detectors).2D projections in Mantid were used to unwrap detectors, making it possible in some cases to look at detectors that are buried inside a group of detectors (we are especially thiking at the side-by-side view which would ensure a 2D view with no overlapping pixels, as all other 2D views would still show overlap in the case of LOKI where straws are 'hiding' behind each other). An alternative to this could be to have some cut slices that can be moved through the instrument. A possible implementation for this would be to set the opacity of most pixels to something very low, and have a plane of high-opacity pixels, revealing the internals of deeply embedded detector arrangements. In addition, it is not clear how the Mantid side-by-side view would work for volumetric detectors. A quick mock up of this using
![Screenshot at 2020-06-30 12-15-42](https://user-images.githubusercontent.com/39047984/86114882-71e23900-bacb-11ea-9f89-5c83993895b9.png)
pythreejs
is shown below:The text was updated successfully, but these errors were encountered: