-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add motor info to QNexuswidget #1088
Conversation
Please rebase your work on current master that includes #1087 |
d8d93ba
to
55ae83c
Compare
Some comments: PyMca is used at other facilities than the ESRF and former ESRF files did not look like current ones. I would aim at using something similar to the function getPositionersGroup(h5file, path) in PyMca5.PyMcaCore.NexusTools.py That would make the use of the new feature not restricted to ESRF. For instance, A getStartingPositionersGroup in PyMca5.PyMcaCore.NexusTools.py seems to me more appropriate. It could use your hard-coded specific call and default to getPositionersGroup if nothing found. That would imply that if one positioner is an array of positions, the first position is used as starting point to allow the use of get_motor_positions. |
I tried to address your suggestions. Is there anything else to be done? |
Yes. It continues to be ESRF centric and only applicable to files generated recently. Please take a look at NexusTools.getPositionersGroup There you will find a more generic approach to figure out the positioners associated to a scan. In absence of the new ESRF |
The proposed feature should be of use on old and new ESRF files as well as Sardana HDF5 files. |
What makes you think |
Prior to it there was a group inside NXinstrument named |
If it serves as reminder, |
For reference: |
|
So what needs to be done is
Is that correct? |
One cannot escape to having two different functions (or a function with keywords). You need to keep into account that to match the SPEC behaviour, you want the motor values associated to the positions when the command was issued. If the information is not available, then one uses the group provided by getPositionersGroup What you propose should work for this issue, but when I look for the positioners group in PyMca, I actually want the group containing the scanned ones because I want the positions during the scan and not when the command was issued. So, I would just extend the getStartingPositionersGroup to handle the case positioners_start is not there and it gets the getPositionersGroup instead. The handling of 1D data instead of 0D would indeed be necessary. If you want to centralize the dimensions handling as getStartingPositionersAndValues or getStartingPositioners with a keyword to get the values, or whatever, I am pretty sure it can avoid duplicating code somewhere else. |
We added the function getStartingPositionerValues which calls the function getStartingPositionersGroup which falls back to the function getPositionersGroup. Is that what you had in mind to be more generic ? |
Yes, it is. Thank you. Please, just make the new functionality is available only at NXentry level. |
We thought it would be easier if you could click anywhere in the scan and see the list of motors. |
I understand your point of view, but I always keep in mind PyMca is used to deal with HDF5 files from many sources (and not even Nexus files). My point of view is that in many cases the motors information will not be there. To have systematically a |
Now we can access to the motor positions only at NXentry level. Is that what you expected ? |
Thanks a lot. I just added the license header to the new file prior to the merge. |
Needs #1087 first