-
Notifications
You must be signed in to change notification settings - Fork 25
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
Multi-tensor map class #325
Comments
For point-by-point results I thought of it as an extension of "columnfile":
To have something on a regular grid, there seems to be a question of "array of structs" versus "struct of arrays" (https://en.wikipedia.org/wiki/AoS_and_SoA). I am thinking of "SoA" here but I think you have "AoS" above. Assuming the underlying data (the table of numbers above) stays the same, for SoA, I guess the regular grid is about making row selections to get the grains at a point in space. This could be one awkward array [nx][ny][ngrains=ragged] where each entry gives the row ids in the big table. Then we have to lock the main table unless we update these pointers. For the "sinogram" style reconstruction, the "columnfile" would give the list of grains found in indexing. The initial "map" would then point to the same row many times for all pixels in the same grain. After refinement, we would copy the initial grain, refine it, and get back a single grain at each point. Does this make any sense? (This also looks also like scipy.sparse where we have a series of arrays of (i,j,data) with duplicate entries.) |
I worry that having both a "SoA" carrying the raw data and an awkward array for row selections makes things very complicated. I think that the "SoA" approach could suffer a lot from slowdown when we are asking to get all the data at a specific grid point. Doing something like |
The AoS vs SoA question is whether to store the columnfile table data by rows or by columns (e.g. doesn't matter on paper, depends on how computers work, etc). So long as the table rows are sorted by position in space then it can be fast/easy to index into them for both layouts. With column storage, for the series of different arrays like UBI, UB, eps, sigma, etc, we should be able to share the "position in space indexing" pointers across all columns. Probably this can be done via any one of awkward/ragged/pydata_sparse_gcxs. Or we just have one array for each data item like
Maybe the next thing to do is IO? The input (for now) is the output from PBPmap which is already columnfile. This would just add a couple of look up tables. |
I think enforcing grouping gets tricky if we want to add a new UBI (or remove one) to/from an existing pixel? Otherwise I like this idea in theory. I think the thing to do is to try and write some refinement code, then probably the requirements we need/the most elegant approach will appear at some point... |
Solved by #339 - we settled on a columnfile in the end, with |
We need a new class (or extend
PBPMap
fromImageD11/ImageD11/sinograms/point_by_point.py
Line 113 in 8c895dd
The class needs to support the following conditions:
ri
,rj
like we use everywhere else)ubis
,eps
andnpks
depending on how many grains we found at that pointselbest
methods - for generating single-valued maps from multi-valued maps. A number of different methods could be used here.TensorMap
- results of tomographic refinementFrom what I can see,
AwkwardArray
seems like a good way to start:https://awkward-array.org/doc/main/getting-started/index.html
@jonwright what do you think?
The text was updated successfully, but these errors were encountered: