Conversation
YooSunYoung
left a comment
There was a problem hiding this comment.
Looks good to me...! Just some minor questions/suggestions.
| events.bins.coords[c] = sc.bins_like( | ||
| events, sc.midpoints(events.coords[c]) | ||
| ) | ||
| events = events.bins.concat(image_dims) |
There was a problem hiding this comment.
Why do we have to concatenate it? Is it faster if we do?
| events = events.bins.concat(image_dims) |
There was a problem hiding this comment.
The problem is that if we don't concatenate the bins then when we bin it again with new bin-edges in x and y we might run out of memory because of scipp/scipp#3872.
Does that answer the question?
There was a problem hiding this comment.
Yes it does...!
So it'll be not necessary if the bug is fixed right...?
Neverthless, I'm okay with it. It shoudn't be blocked by the bug fix...
There was a problem hiding this comment.
Yes if the bug is fixed we should be fine without it.
|
|
||
| events.bins.coords['x'] = sc.bins_like(events, sc.midpoints(events.coords['x'])) | ||
| events.bins.coords['y'] = sc.bins_like(events, sc.midpoints(events.coords['y'])) | ||
| events = events.bins.concat(['x', 'y']) |
There was a problem hiding this comment.
| events = events.bins.concat(['x', 'y']) |
Here too. I think putting the event coordinate should be enough.
There was a problem hiding this comment.
Same issue here, if we bin again in x and y when there are already x and y dimensions then we might run out of memory.
| del events.bins.coords['x'] | ||
| del events.bins.coords['y'] |
There was a problem hiding this comment.
Is it because they are usually dropped by reduction workflows?
There was a problem hiding this comment.
Yes, it's to make it look like typical detector event data in our workflows.
Typically we don't have pixel positions on the event data.
|
Although, now that I'm thinking more about it, we don't typically have 'x' and 'y' coords on our detector data either 🤔 and this method currently requires that. There might be a better / simpler way to do it that does not require any coordinates on the input data. |
… in each dimension
|
The old implementation had some issues.
These issues are solved if we "fold" the original fine grid to coarser grids instead of re-binning the events, so that is the approach taken in the new implementation. |
One thing to be clear here: It's usually easy to fold the data along But I think the new signature is much better...! |
Fixes #273
and allows binned data in the max resolution finder function.