Skip to content

Updates to inspector plot: add rectangle mode and remove operation arg#528

Draft
nvaytet wants to merge 5 commits intomainfrom
rectangle-inspector
Draft

Updates to inspector plot: add rectangle mode and remove operation arg#528
nvaytet wants to merge 5 commits intomainfrom
rectangle-inspector

Conversation

@nvaytet
Copy link
Member

@nvaytet nvaytet commented Feb 13, 2026

Some updates to the inspector plot:

  • fixed slicing when used on data with a 2d coordinate
  • small optimization to avoid converting coords to midpoints every time a polygon is modified
  • added rectangle analog to feat: polygon inspector tool #518

A question arose while implementing this: there is an operation argument that decides which reduction operation to apply along the 3rd dimension into the paper. This is a sum by default, but can be a min, max or mean.
Now, when we select a region inside a rectangle or a polygon, we need to also reduce that along the x and y dimensions before sending to the 1d plot along z. The operation there is currently always a sum, and I don't think it would make sense to do anything else than sum?

So the question is: does it even make sense to have other operations along the z dimension?

Update: I decided to remove the operation in the end.

@nvaytet
Copy link
Member Author

nvaytet commented Feb 13, 2026

TODO: still need to write some tests

@nvaytet nvaytet changed the title Add rectangle inspector tool Updates to inspector plot: add rectangle mode and remove operation arg Feb 14, 2026
y = _coord_to_centers(da, ydim)
vx = poly['x']['value'].to(unit=x.unit).values
vy = poly['y']['value'].to(unit=y.unit).values
vx = poly['x']['value'].values
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to convert the unit here? By construction, the xy locations returned by the polygon info are in the correct canvas units.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant