Skip to content

Commit

Permalink
FormatROD set beam probe to electron for ED (cctbx#728)
Browse files Browse the repository at this point in the history
* Use a short-wavelength heuristic to set beam probe to electron.

The CAP format does actually have a header value to identify an
ED experiment (see b_is_microed_experiment in sources). However
we do not have a complete header reader in this format class so
we cannot reliably find this value.
  • Loading branch information
dagewa authored Apr 26, 2024
1 parent 60782d7 commit 8f409a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions newsfragments/728.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``FormatROD``: set the beam probe to "electron" for 3D ED experiments.
11 changes: 10 additions & 1 deletion src/dxtbx/format/FormatROD.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

from dxtbx.ext import uncompress_rod_TY6
from dxtbx.format.Format import Format
from dxtbx.model.beam import Probe


class FormatROD(Format):
Expand Down Expand Up @@ -283,11 +284,19 @@ def get_beam(self, index=None):
return Format.get_beam(self)

def _beam(self):

wavelength = self._bin_header["alpha1_wavelength"]
if wavelength <= 0.05:
probe = Probe.electron
else:
probe = Probe.xray

return self._beam_factory.make_polarized_beam(
sample_to_source=(0.0, 0.0, 1.0),
wavelength=self._bin_header["alpha1_wavelength"],
wavelength=wavelength,
polarization=(0, 1, 0),
polarization_fraction=0.5,
probe=probe,
)

def get_detector(self, index=None):
Expand Down

0 comments on commit 8f409a9

Please sign in to comment.