-
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
Fix write_crystfel_geom offset unit #102
Conversation
I have no idea why the test failed... |
extra_geom/crystfel_fmt.py
Outdated
@@ -54,7 +54,8 @@ def _crystfel_format_vec(vec): | |||
|
|||
def frag_to_crystfel(fragment, p, a, ss_slice, fs_slice, dims, pixel_size): | |||
tile_name = 'p{}a{}'.format(p, a) | |||
c = fragment.corner_pos / pixel_size | |||
c = fragment.corner_pos | |||
c[:2] = c[:2] / pixel_size |
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.
This will modify fragment.corner_pos
, so exporting a geometry object to a .geom
file will change it. This is because c
is a reference to the existing array, not a copy.
For clarity, I think it's better to make a separate array with positions in pixel units, rather than mixing pixel units and metres in the same array.
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.
Does it mean the corner_pos
needs to be redefined here if one will have a separate variable for the offset?
Please see the current workaround: |
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.
Thanks Jun, this looks fine. I've made a little simplification, which I'll apply now and merge it.
Fix issue #101