Skip to content
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

Added 'pm' and 'mm' for very small and large scans #801

Conversation

ns-rse
Copy link
Collaborator

@ns-rse ns-rse commented Feb 12, 2024

As #796 seeks to address an issue with non-square images that were 1 pixel wide it makes sense to have such scenarios
tested.

  • The pytest.param() function is used to add meaningful identifiers to each of the tests.
  • Adds a 1x512 pixel scan to the parameters (denoted pn units; rectangular (thin)).
  • Conversely adds a 512x1 pixel scan to the parameters (denoted pm units; rectangular (tall))

I'm unsure...

  • whether the tall test makes sense but then I'm also don't know why there would be an image that is only 1 pixel wide.
  • why the expected_px2nm is always based on the x-axis size and whether this would be an issue?

As #796 seeks to address an issue with non-square images that were 1 pixel wide it makes sense to have such scenarios
tested.

+ The `pytest.param()` function is used to add meaningful identifiers to each of the tests.
+ Adds a `1x512` pixel scan to the parameters (denoted `pn units; rectangular (thin)`).
+ Conversely adds a `512x1` pixel scan to the parameters (denoted `pm units; rectangular (tall)`)

I'm unsure...

+ whether the `tall` test makes sense but then I'm also don't know why there would be an image that is only 1 pixel wide.
+ why the `expected_px2nm` is always based on the x-axis size and whether this would be an issue?
@MaxGamill-Sheffield
Copy link
Collaborator

The error and associated fix in #796 were only discovered by the 1x512px image, not the cause of it. The microscope thought it foolish to record the 0.87nm long direction in 'nm' but instead 'pm'., not because of the non-squareness of the image, and thus the 'pm' test has already been added. Apologies if this wasn't clear.

As the function currently requires each pixel to be square (the indexing of 0 in io.py ~ line 530), modifying these values currently does nothing. I'll merge and add the tests as they should be useful for the non-square pixel work that is currently being worked on and to avoid writing these tests again (only modifying them) at a later date 👍

@MaxGamill-Sheffield MaxGamill-Sheffield merged commit de3ac4b into maxgamill-sheffield/pm-in-spm-dict Feb 13, 2024
2 checks passed
@MaxGamill-Sheffield MaxGamill-Sheffield deleted the ns-rse/non-square-tests branch February 13, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Input and Output
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants