Skip to content
Draft
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
673 changes: 673 additions & 0 deletions examples/bcdi_pipeline_example_xfel.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ dependencies = [
"tabulate",
"xrayutilities>=1.7.3",
"pyyaml",
"damnit",
"EXtra-data",
]

[project.optional-dependencies]
Expand Down
11 changes: 11 additions & 0 deletions src/cdiutils/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,17 @@ def from_setup(
sample_surface_normal=[0, 1, 0], # default sample facing up
name="ID27",
)
if beamline.lower() == "xfel":
geometry = cls(
sample_circles=["y-", "x+", "z+"], # theta, chi, phi
detector_circles=["y-"], # twotheta
detector_axis0_orientation="y-",
detector_axis1_orientation="z-",
beam_direction=[1, 0, 0],
sample_surface_normal=[0, 0, 1],
name="XFEL",
is_cxi=False,
)
if geometry is None:
raise NotImplementedError(
f"The beamline name {beamline} is not valid. Available:\n"
Expand Down
3 changes: 3 additions & 0 deletions src/cdiutils/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .p10 import P10Loader
from .sixs import SIXSLoader
from .vtk import save_as_vti
from .xfel import XFELLoader, load_xfel

__all__ = [
"Loader",
Expand All @@ -25,6 +26,8 @@
"SIXSLoader",
"CristalLoader",
"NanoMAXLoader",
"XFELLoader",
"load_xfel",
"CXIFile",
"CXIExplorer",
"save_as_cxi",
Expand Down
5 changes: 5 additions & 0 deletions src/cdiutils/io/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ def from_setup(cls, beamline_setup: str, **metadata) -> "Loader":
"Only 2019 and 2022 versions are available for now. Specify "
"the version in the beamline_setup."
)
if beamline_setup.lower() == "xfel":
from . import XFELLoader

return XFELLoader(**metadata)
if "p10" in beamline_setup.lower():
from . import P10Loader

Expand Down Expand Up @@ -802,6 +805,8 @@ def get_mask(
mask = np.zeros(shape=(512, 1028))
elif detector_name.lower() == "merlin":
mask = np.zeros(shape=(512, 512))
elif detector_name.lower() == "agipd":
mask = np.zeros(shape=(1325, 1196))
else:
raise ValueError(f"Invalid detector name: {detector_name}")
if channel:
Expand Down
Loading
Loading