Skip to content

Commit

Permalink
FormatSMVTimePix_SU mask out central cross of virtual pixels (#683)
Browse files Browse the repository at this point in the history
* Always mask out the central cross of pixels, as even if these have
got reasonable intensity values, they do not correctly represent
the reflection profiles. This also means handling between the 4-
panel 512*512 pixel model (which excludes the edge pixels between
the panels) and the 516*516 pixel model are now consistent. Both
versions now exclude these special edge pixels.
  • Loading branch information
dagewa authored and graeme-winter committed Feb 5, 2024
1 parent 1f27805 commit c3837e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
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

from dxtbx.format.FormatSMV import FormatSMV
from dxtbx.masking import mask_untrusted_rectangle
from dxtbx.model.beam import Probe
from dxtbx.model.detector import Detector

Expand Down Expand Up @@ -314,7 +317,9 @@ def get_raw_data(self):
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 @@ def understand(image_file):

return True

def get_static_mask(self):
"""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)

return (mask,)

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

0 comments on commit c3837e8

Please sign in to comment.