-
Notifications
You must be signed in to change notification settings - Fork 8
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
Define usage of NXtransformations and NXcoordinate_system(_set) #144
Define usage of NXtransformations and NXcoordinate_system(_set) #144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The aspect of what it practically means if @depends_on points to an NXcoordinate_system off course depends on the actual implementation.
The aspect of converting the handedness of CO systems is not covered by NXtransformations, but I think we can just ignore this for now...
@sanbrock, @rettigl, and I had another discussion today and came up with the following idea.
For the future, @sanbrock suggested another option: add everything that is now in NXcoordinate_system to NXtransformations, thus making it possible to describe non-affine transformations and changes in handedness by NXtransformations. In that case, we would add the following to NXtransformations: NXtransformations:
BASE_COORDINATE_CHANGE(NX_NUMBER):
@x(NX_NUMBER):
@y(NX_NUMBER):
@z(NX_NUMBER):
@offset(NX_NUMBER): What do you think @FAIRmat-NFDI/areab? |
Do I understand it correctly, that with this you stuffed an NXtransformation into the NXtransformation, the former one forcing a trasnlation shift along a vector, the second being whatever usual transformation (translation or rotation) it would have anyway been? |
No, there is no nesting of NXtransformations. The idea (please correct me if I am wrong @mkuehbach) is that in Then, any The main idea why we want to use |
So, basically complement the NXtransformations with a coordinate system defined by 3 base (unit) vectors. With this, transferring the so-far free text definition to this base class. The base vectors can be right-handed or left handed, and the vector in the NXtransformation is then meant to be in this coordinate system. |
NIAC conceptualized that NXtransformation can be connected into a graph with one single-directed edge between two nodes (NXtransformation) instances (a typical triplet). There is no parent-child relationship implied via this conceptually, therefore yeah no nesting of NXtransformations. Now NXcoordinate_system and NXtransformations: What I proposed is indeed NXcoordinate_system as an explicit way to say I have that many coordinate systems with the i) possibility to define their base vectors explicitly as childs of respective NXcoordinate_system instance see fields x,y,z, ii) lately the connection between NXtransformations and NXcoordinate_system has been discussed rightly so, I support to define base vectors as childs in an NXcoordinate_system instance but then there have to be three disjoint NXtransformations instances one for each base vector (if parallelepiped is to be spanned). In my opinion another possibility to achieve the same thing: State explicitly what your coordinate system is. |
This is what I don't understand about NXcoordinate_system. From what you said here, I can (arbitrarily) define three vector x, y, and z, but how do I say with respect to what I define these? Would they not have to explicitly defined w.r.t. to McStas or another CS? My idea was that you define these vectors and use the depends_on attribute of NXcoordinate_system to say what these vectors are in another CS.
We also discussed this. The alternative would be to define a new attribute in NXtransformations (how about |
For orthonormal coordinate systems, one can can discribe it simply with one or more NXtransformation matrices, and the new base vectors are the MCstas base vectors times the resulting matrix, no? This is the use case I need. My idea is to create the NXcoordinate instance, and define the depends_on and NXtransformation chain within to define this matrix (even not give the vectors, as these result from the transformations).
"." itself is not a transformation, but rather a coordinate system, so I would say we should extend the use of @depends_on to allow to point to other NXcoordinate system instances. |
Discussing it with NIAC yesterday, it is indeed supported to extend NXtransformatinos so it does not only support rotation and translation but also "general" transformation described by an arbitrary transformation matrix (in fact x,y,z of our coordinate_system does describe such matrix by providing its column vectors). Hence, a base change is just yet another transformation type which can be part of the @depends_on chain wherever it is needed (not only at the end; and not only at a single point in the chain). |
Much of the last three comments I second. One point I would like to make more clear: It is alright that McStas is a convention some people wish to use. Fact is that it is one of many possible ones and NXcoordinate_system is an attempt to show that NeXus user are not necessarily required to use McStas if they dont want to. On @lukaspie your point where is an instance of coordinate system embedded in: that is to some extend always arbitrary at the origin of the chain. A map of the globe is in world coordinate system where is that embedded in a cosmology-based reference frame but where is that embedded in... exactly it is defined as is. Therefore, we have the free-text fields in like "edge of the table etc". Now on generalizing NXtransformation: Yeah that is probably a useful strategy for the future. The definition of say base vectors (vectors in general in maths) is within a reference frame, say we define a vector as a tuple of numbers in |
@lukaspie What is the status of this? As both NXxps and NXmpes_arpes use the transformations in NXcoordinate_system, I would suggest to merge this now (however, rn the transformations are actually not included!) |
My plan was to present/discuss this tomorrow in the TF meeting. @sanbrock actually had another idea how we could change EDIT: I added |
cccc840
to
089841f
Compare
089841f
to
1e4929e
Compare
Feedback from today's TF meeting:
@rettigl based on these discussion in the TF, I would say we can merge this PR now and then figure out all the new discussions in #235. Do you agree? |
either outdated or will be handled elsewhere
Fixes #143.
EDIT: an example for converting from one CS to another by using
NXcoordinate_system/(NXtransformations)
can be found here.