Skip to content

show_2d/Dataset2d.show: take scalebar sampling and units from Dataset2d - #317

Merged
arthurmccray merged 1 commit into
electronmicroscopy:devfrom
maclariz:show2d-dataset-calibration
Nov 12, 2026
Merged

arthurmccray merged 1 commit into
electronmicroscopy:devfrom
maclariz:show2d-dataset-calibration

Conversation

@maclariz

@maclariz maclariz commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

What problem this PR addreseses

show_2d was not automatically and reliably picking up the calibration from a dataset2d and putting that into a scale bar. This happened because it was converted to a plain array before display and the calibration was not passed. This is now fixed and passed to the scalebar params.

Additionally, I added something called display_units, which sets which units to display in. This need not be the ones listed in the calibration and appropriate unit conversions for real-space and reciprocal units are included. Everything from m to pm is supported, including Å.

This is tested on a sequence of dm3 images of a range of magnifications that I was importing and turning into labelled displays in a simple automated script for a research collaborator in another school. And eventually worked very nicely.

What should the reviewer(s) do

@arthurmccray arthurmccray left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@arthurmccray
arthurmccray merged commit 0eee637 into electronmicroscopy:dev Nov 12, 2026
4 checks passed
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.

2 participants