-
Notifications
You must be signed in to change notification settings - Fork 14
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
Rework LPD Mini components class #381
base: master
Are you sure you want to change the base?
Conversation
Is this MR still WIP or ready for review? |
Right, sorry, I think this is ready for review. We've settled on the source name for corrected data ( This is also less critical, though - we're not using this in the calibration code, and as the detector is a single source, it's relatively easy to access the data directly with normal EXtra-data functionality. The main place where this will be useful is to efficiently read e.g. the first pulse from each train. |
We briefly discussed the conundrum between potentially offering non-native/"default" axis orders like |
Thinking through that again, I'm not sure. Would we make reordering axes the default? If we don't, then to match other detectors you have to know that it's different and explicitly do something extra, in which case you could just as well call If we do reorder by default, then to use an |
I gravitate towards the option most helpful to novice programmers that may have a harder time doing the I was having a similar philosophical discussion the other day about TOF/REMI components I am working on, and it lead me to the conclusion the |
I'm honestly confused now about which way you're pushing for. At first I thought the most helpful thing for novice programmers was to do the reordering (to modules, frames, *px) by default, but that's the option that requires an extra keyword argument to use In isolation, I think the natural order from LPD Mini (frames, modules, *px) is actually better than doing the reordering - my experience suggests you select & reduce on the frames dimension more often. And having to change the axis order to use So I lean towards leaving this as is, and maybe as a separate PR introducing an |
I suspect the meaning got lost in translation, so let me try again: the group of people stumbling over a different shape and how to fix it does not intersect with those using I don't disagree about the natural order, but would keenly like to avoid different detectors returning different shapes.. There's already a lot of messiness out there with regard to shapes or other such details that I would like to not add to it |
I started on implementing this, but... the inconsistencies it leaves within the API are uglier than I thought. E.g. should I also realised that there's another difference from other detectors in things like pulseId & cellId - these will be 1D arrays, whereas for the other detectors they're 2D. And 1D is better! They're meant to be consistent across modules. So do we duplicate them along the module dimension, being actively unhelpful, just to match other detectors? I appreciate the argument that the API should prioritise novice users. But making the API inconsistent with itself in order to make it partially consistent with other detectors, and convoluting the code to make it so, feels like a bad trade-off. I think we're better off saying that LPD Mini works a bit differently from other detectors, and if you need to rearrange the axes, here's how to do it (incidentally showing people a numpy function that may be useful elsewhere). |
This was in need of a rework because we have discovered since adding it that LPD Mini is actually several smaller detectors recorded as a single source in the DAQ, rather than one 256 x 256 detector.
This exposes each module (with 2 tiles) as a 32 x 256 strip, as it is saved, rather than the 64 x 128 arrangement they make physically. The idea is that the geometry will be responsible for putting the data together as an image: European-XFEL/EXtra-geom#187
This is a WIP because I'm still figuring some parts out, and of course it needs tests and docs, but there's something there one can try - see https://max-jhub.desy.de/user-redirect/notebooks/Code/EXtra-data/LPD%20Mini%20test.ipynb