Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4449454
Fixed typo in Beam constructor and removed unnecessary comments.
toastisme Feb 23, 2022
bcd3cd2
Rename newsfragments/XXX.misc to newsfragments/488.misc
DiamondLightSource-build-server Feb 23, 2022
a9a2d50
Added back in comment explaining units for s0 in BeamBase.
toastisme Feb 24, 2022
e74ef34
Added TOFBeam to beam.h and beam.cc
toastisme Feb 25, 2022
c540eb9
Added derived TOFBeam methods to beam.cc and fixed some method errors.
toastisme Feb 25, 2022
5f6fc3f
Added TOFBeam typehints in dxtbx_model_ext.pyi
toastisme Feb 25, 2022
4dd78a0
Added AbstractBeamFactory. Added BeamBaseFactory. Added TOFBeamFactor…
toastisme Feb 28, 2022
d8e713d
Added __id__ to to_dict beam methods in beam.cc
toastisme Feb 28, 2022
47e3aa0
Replaced BeamFactory with BeamBaseFactory in areas of the code not sp…
toastisme Feb 28, 2022
0e305ae
Added transmission and flux to beam phil params.
toastisme Feb 28, 2022
d9ddc88
Made BeamFactory.make_beam consistent with AbstractBeamFactory and ad…
toastisme Feb 28, 2022
13d3ac7
Change BeamBaseFactory back to BeamFactory in Format.py
toastisme Feb 28, 2022
d4ec562
Fixed typo in TOFBeam.get_wavelength() and added another test.
toastisme Feb 28, 2022
062c765
.short_caption added to flux and transmission phil params.
toastisme Mar 1, 2022
d1ac88a
Add .short_caption for sample_to_moderator_distance for beam.py phil …
toastisme Mar 1, 2022
9d2c8ab
Use scitbx/constants.h for Planck and m_n in beam.h
toastisme Mar 1, 2022
1f1c6f9
Merge remote-tracking branch 'origin/main' into add_tof_beam
ndevenish Mar 2, 2022
7e8dbd4
Merge remote-tracking branch 'origin/main' into add_tof_beam
ndevenish Jun 8, 2022
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/488.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Typo in Beam constructor involving transmission and flux has been fixed.
2 changes: 1 addition & 1 deletion src/dxtbx/datablock.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def datablocks_from_dict(obj, check_format=True, directory=None):

def load_models(obj):
try:
beam = dxtbx.model.BeamFactory.from_dict(blist[obj["beam"]])
beam = dxtbx.model.BeamBaseFactory.from_dict(blist[obj["beam"]])
except Exception:
beam = None
try:
Expand Down
62 changes: 62 additions & 0 deletions src/dxtbx/dxtbx_model_ext.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,68 @@ class Beam(BeamBase):
def from_dict(data: Dict) -> Beam: ...
def to_dict(self) -> Dict: ...

class TOFBeam(Beam):
@overload
def __init__(self, beam: TOFBeam) -> None: ...
@overload
def __init__(
self, direction: Vec3Float, sample_to_moderator_distance: float
) -> None: ...
@overload
def __init__(
self,
direction: Vec3Float,
sample_to_moderator_distance: float,
divergence: float,
sigma_divergence: float,
polarization_normal: Vec3Float,
polarization_fraction: float,
flux: float,
transmission: float,
deg: bool = ...,
) -> None: ...
def get_sample_to_moderator_distance(self) -> float: ...
def get_reflection_tof(self) -> float: ...
def get_reflection_s1_length(self) -> float: ...
@overload
def get_wavelength(self) -> float: ...
def get_wavelength(
self, reflection_tof: float, reflection_s1_length: float
) -> float: ...
@overload
def get_s0(self) -> Vec3Float: ...
def get_s0(
self, reflection_tof: float, reflection_s1_length: float
) -> Vec3Float: ...
def set_sample_to_moderator_distance(
self, sample_to_moderator_distance: float
) -> None: ...
def set_reflection(
self, reflection_tof: float, reflection_s1_length: float
) -> None: ...
@overload
def is_similar_to(
self,
other: BeamBase,
wavelength_tolerance: float = ...,
direction_tolerance: float = ...,
polarization_normal_tolerance: float = ...,
polarization_fraction_tolerance: float = ...,
) -> bool: ...
def is_similar_to(
self,
other: TOFBeam,
wavelength_tolerance: float = ...,
direction_tolerance: float = ...,
polarization_normal_tolerance: float = ...,
polarization_fraction_tolerance: float = ...,
) -> bool: ...
def clear_reflection(self) -> None: ...
def has_reflection(self) -> bool: ...
@staticmethod
def from_dict(data: Dict) -> TOFBeam: ...
def to_dict(self) -> Dict: ...

class CrystalBase:
@property
def num_scan_points(self) -> int: ...
Expand Down
7 changes: 6 additions & 1 deletion src/dxtbx/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from scitbx.array_family import flex

from dxtbx.imageset import ImageGrid, ImageSequence, ImageSet
from dxtbx.model.beam import BeamFactory
from dxtbx.model.beam import BeamBaseFactory, BeamFactory, TOFBeamFactory
from dxtbx.model.crystal import CrystalFactory
from dxtbx.model.detector import DetectorFactory
from dxtbx.model.goniometer import GoniometerFactory
Expand Down Expand Up @@ -49,6 +49,7 @@
ScanBase,
SimplePxMmStrategy,
Spectrum,
TOFBeam,
VirtualPanel,
VirtualPanelFrame,
get_mod2pi_angles_in_range,
Expand Down Expand Up @@ -84,6 +85,7 @@
ScanBase,
SimplePxMmStrategy,
Spectrum,
TOFBeam,
VirtualPanel,
VirtualPanelFrame,
get_mod2pi_angles_in_range,
Expand All @@ -96,7 +98,10 @@
__all__ = (
"Beam",
"BeamBase",
"TOFBeam",
"BeamBaseFactory",
"BeamFactory",
"TOFBeamFactory",
"Crystal",
"CrystalBase",
"CrystalFactory",
Expand Down
Loading