-
Notifications
You must be signed in to change notification settings - Fork 4
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
What do the origin & coordinate axes represent? #10
Comments
That's a really good question. On the one hand, the But on the other hand, if we want |
Hi both, excuse my ignorance (which did not harm for my purposes so far) but I've always - weakly - assumed the z-Direction would be in the |
I forgot to add, I'm talking about the CrystFEL geom file here |
As things stand, the z coordinate of a panel corner does get translated to coffset when we write a .geom file: EXtra-geom/extra_geom/crystfel_fmt.py Lines 74 to 76 in ac76cc5
CrystFEL says Z is along the beam, but treating it as perpendicular to the detector plane is convenient for assembling detector images (we can ignore the Z component). So long as the detector plane is perpendicular to the beam, these are equivalent. But detectors could be positioned differently, and then it will matter. I suspect we'll ultimately want a way to transform between instrument coordinates (z along the beam, origin at the interaction point) and detector-local coordinates (z perpendicular to the detector plane, origin at the PONI). But working out how to make that clear (given how confusing coordinates already are) and what we work with by default, won't be easy. |
Thanks for your partial confirmation, it gets a bit clearer now. |
Respectively: do we use a hybrid definition when writing the .geom file? |
Sorry I have been myself unclear. Reading your first statement, a complementary question would be: where does the z-coordinate of a panel corner come from in the first place (before translating to |
There's a closely related question about where Normally, in CrystFEL .geom files you give a single number for clen, the distance from the sample to the detector plane, and then coffset is relative to that - corresponding to our z coordinate from the detector plane. But the format also allows you to put in a separate clen for each panel, if you prefer. (.geom files also have a
If you read in a .geom file, it comes from coffset. Geometry objects created by other methods (like |
We need to make up our minds somehow, just to be consistent. I came across this issue when I started to implement the generic |
I would suggest that, for now, you implement the same behaviour as when we read CrystFEL geometry for a named detector like AGIPD - skip clen (I'm working on a separate branch to store & write back other fields from CrystFEL), and use coffset as the z coordinate. I.e. we're working with coordinates based on the detector plane, and making some assumptions about how that shows up in CrystFEL. Even if this isn't the best scheme, doing the same thing for generic geometry means we can extend it in the same way later. If we do something different for generic geometry and named detectors, it will be an extra complication as and when we get round to implementing a distinction between 'lab space' and 'detector space' geometry. |
Ups, did not want to close the issue, just abort a comment, sorry! |
No problem 😄 . If you can close issues, I guess you probably have the reopen button too. |
Sure 😄 The actual "problem" for me was that the comment options are |
The origin for physical coordinates in EXtra-geom is meant to be a meaningful centre point, e.g. for azimuthal integration. But we've been a bit vague so far on what exactly that is: detector centre, the point where the beam intersects the detector plane, or the point where a ray from the interaction point would be normal to the detector plane (PyFAI's 'PONI' or Point Of Normal Incidence).
Also, should the x, y, z directions always be in the lab coordinate system (where +z is along the beam), or based on the detector, so that x & y are in the detector plane, and z only measures deviations from that plane.
When the detector is directly downstream and perpendicular to the beam, these options are equivalent, so it's not important to distinguish between them. But if a detector can be used at an angle, it will quickly become important.
I think that the most practical option is to use the PONI and coordinates based on the detector plane, so that it's always easy to see the detector layout by ignoring the z dimension. But we might want ways to translate between detector-local geometry and lab coordinates.
Prompted by discussion with @dallanto on #6.
The text was updated successfully, but these errors were encountered: