-
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
Compatibility with cfelpyutils 2.x & read/write bad regions from .geom file #114
Conversation
ss_pixels = d['max_ss'] - d['min_ss'] + 1 | ||
fs_pixels = d['max_fs'] - d['min_fs'] + 1 | ||
ss_pixels = d['orig_max_ss'] - d['orig_min_ss'] + 1 | ||
fs_pixels = d['orig_max_fs'] - d['orig_min_fs'] + 1 |
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.
These fields appear to have been renamed in cfelpyutils. I couldn't work out why by looking at the code, and I didn't get any answer from CFEL when I asked. 🤷
I've now extended this to try to read the bad (mask) regions from a The mask from the |
I think in HEADER_TEMPLATE = """\
; {detector} geometry file written by EXtra-geom {version}
; You may need to edit this file to add:
; - data and mask locations in the file
; - mask_good & mask_bad values to interpret the mask
; - adu_per_eV & photon_energy
; - clen (detector distance) since now only mask_good & mask_bad are not copied from the original geometry file and everything else is. |
I have tried to read the JUNGFRAU geometry and then to write it back into the new geometry file. While looking into the files I can see that convention for the panels and asics naming got broken, e.g.: LGTM 👍 |
So was the geometry file you tested with starting from p1a1? And what are the ss/fs coordinates for p1a1? The AGIPD .geom file I have starts - |
Got it, thanks. That looks like a really good test case that this machinery is working correctly. The ASICs for modules 1-4 will be renumbered in reverse, but for 5-8 just shifted to count from 0 rather than 1. Separate from this PR, we could have an offset so JUNGFRAU modules are numbered from 1 rather than from 0, if you think that would make the resulting .geom files easier to understand. But preserving that numbering scheme of tiles within modules would be trickier, and I don't want to spend too much time on roundtripping .geom files.
This is a valid point, but it's only true if you start from a I wonder if we should have a separate method which can modify an existing |
Right, thank you, indeed there is no need to modify the comment. Maybe a better option would be to change the naming convention to have it the same for all detectors?) Right now it is pretty hard to understand JUNGFRAU layout without an image. |
I wish we could make the naming/numbering convention the same for all detectors! But it's not something we have much control over. |
Switch from cfelpyutils 1.x to 2.x. I'm not attempting to bridge the gap and make it work with both - though we could, if there's a need for that.
One minor concrete benefit is that we now get photon energy from the .geom file, so we can store that and write it back along with some other values.