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

FormatSMVTimePix_SU mask out central cross of virtual pixels #683

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/683.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``FormatSMVTimePix_SU``: Always mask out the central cross of virtual pixels that have been reconstructed from wide edge pixels.
16 changes: 15 additions & 1 deletion src/dxtbx/format/FormatSMVTimePix_SU.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
from iotbx.detectors import SMVImage
from scitbx import matrix

from dials.array_family import flex

Check warning on line 14 in src/dxtbx/format/FormatSMVTimePix_SU.py

View check run for this annotation

Codecov / codecov/patch

src/dxtbx/format/FormatSMVTimePix_SU.py#L14

Added line #L14 was not covered by tests

from dxtbx.format.FormatSMV import FormatSMV
from dxtbx.masking import mask_untrusted_rectangle

Check warning on line 17 in src/dxtbx/format/FormatSMVTimePix_SU.py

View check run for this annotation

Codecov / codecov/patch

src/dxtbx/format/FormatSMVTimePix_SU.py#L17

Added line #L17 was not covered by tests
from dxtbx.model.beam import Probe
from dxtbx.model.detector import Detector

Expand Down Expand Up @@ -314,7 +317,9 @@
class FormatSMVTimePix_SU_516x516(FormatSMVTimePix_SU):
"""A class for reading SMV format images for the Timepix-based electron
detector where the wider edge pixels have been split into three normal-sized
pixels. The whole 516*516 detector can then be described as a single panel"""
pixels. The whole 516*516 detector can then be described as a single panel.
We choose to mask out the edge pixels, as they do not correctly represent
reflection profiles."""

@staticmethod
def understand(image_file):
Expand All @@ -329,6 +334,15 @@

return True

def get_static_mask(self):

Check warning on line 337 in src/dxtbx/format/FormatSMVTimePix_SU.py

View check run for this annotation

Codecov / codecov/patch

src/dxtbx/format/FormatSMVTimePix_SU.py#L337

Added line #L337 was not covered by tests
"""Return the static mask that excludes the central cross of pixels."""

mask = flex.bool(flex.grid((516, 516)), True)
mask_untrusted_rectangle(mask, 0, 516, 255, 261)
mask_untrusted_rectangle(mask, 255, 261, 0, 516)

Check warning on line 342 in src/dxtbx/format/FormatSMVTimePix_SU.py

View check run for this annotation

Codecov / codecov/patch

src/dxtbx/format/FormatSMVTimePix_SU.py#L340-L342

Added lines #L340 - L342 were not covered by tests

return (mask,)

Check warning on line 344 in src/dxtbx/format/FormatSMVTimePix_SU.py

View check run for this annotation

Codecov / codecov/patch

src/dxtbx/format/FormatSMVTimePix_SU.py#L344

Added line #L344 was not covered by tests

def _goniometer(self):
"""Return a model for a simple single-axis goniometer. For this beamline
this should be close to the provided values and neither aligned with the
Expand Down
Loading