Use pixel matrix for component ID mapping #401
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While looking into some 3D viewer stuff related to e.g. glue-viz/glue#2559, I noticed that the new approach to handling pixel component IDs introduced in #399 has a few cases that it misses.
In particular,
equivalent_pixel_cidsI think is too restrictive for the purposes of the data proxy FRB calculation. In particular, this runs into problems if we link the two dataset on the associated world coordinates, rather than the pixel coordinates directly - i.e. if I have two datasets A and B, and link my coordinates likePixel A <-- world2pix/pix2world --> World A <-- My link --> World B <-- world2pix/pix2world --> Pixel B
then the current approach won't find the datasets as compatible, even though this should be enough to display e.g. layer B if layer A is my reference data. The solution used here is to instead find the pixel component ID matrix and look at the relevant indices of true values. If nothing maps to a given index we just put
Noneinto the order.@astrofrog does this seem reasonable?