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

WIP: Add initial support for ASI MPX3 detectors #118

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
29 changes: 29 additions & 0 deletions src/libertem_live/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
from libertem_live.detectors.asi_tpx3 import (
AsiTpx3DetectorConnection, AsiTpx3ConnectionBuilder, AsiTpx3Acquisition,
)
from libertem_live.detectors.asi_mpx3 import (
AsiMpx3DetectorConnection, AsiMpx3ConnectionBuilder, AsiMpx3Acquisition,
)

tracer = trace.get_tracer(__name__)

Expand Down Expand Up @@ -67,6 +70,13 @@ def make_connection(
) -> "AsiTpx3ConnectionBuilder":
...

@overload
def make_connection(
self,
detector_type: Literal['asi_mpx3'],
) -> "AsiMpx3ConnectionBuilder":
...

@overload
def make_connection(
self,
Expand All @@ -92,12 +102,14 @@ def make_connection(
self,
detector_type: Union[
Literal['asi_tpx3'],
Literal['asi_mpx3'],
Literal['dectris'],
Literal['merlin'],
Literal['memory']
],
) -> Union[
"AsiTpx3ConnectionBuilder",
"AsiMpx3ConnectionBuilder",
"DectrisConnectionBuilder",
"MerlinConnectionBuilder",
"MemoryConnectionBuilder",
Expand Down Expand Up @@ -126,6 +138,9 @@ def make_connection(
if detector_type == 'asi_tpx3':
from libertem_live.detectors.asi_tpx3 import AsiTpx3ConnectionBuilder
return AsiTpx3ConnectionBuilder()
if detector_type == 'asi_mpx3':
from libertem_live.detectors.asi_mpx3 import AsiMpx3ConnectionBuilder
return AsiMpx3ConnectionBuilder()
elif detector_type == 'merlin':
from libertem_live.detectors.merlin import MerlinConnectionBuilder
return MerlinConnectionBuilder()
Expand All @@ -150,6 +165,19 @@ def make_acquisition(
) -> "AsiTpx3Acquisition":
...

@overload
def make_acquisition(
self,
*,
conn: "AsiMpx3DetectorConnection",
nav_shape: Optional[Tuple[int, ...]] = None,
frames_per_partition: Optional[int] = None,
controller: Optional[AcquisitionController] = None,
pending_aq: Optional[PendingAcquisition] = None,
hooks: Optional[Hooks] = None,
) -> "AsiMpx3Acquisition":
...

@overload
def make_acquisition(
self,
Expand Down Expand Up @@ -200,6 +228,7 @@ def make_acquisition(
hooks: Optional[Hooks] = None,
) -> Union[
"AsiTpx3Acquisition",
"AsiMpx3Acquisition",
"DectrisAcquisition",
"MerlinAcquisition",
"MemoryAcquisition",
Expand Down
7 changes: 7 additions & 0 deletions src/libertem_live/detectors/asi_mpx3/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .connection import AsiMpx3DetectorConnection, AsiMpx3ConnectionBuilder
from .acquisition import AsiMpx3Acquisition

__all__ = [
"AsiMpx3ConnectionBuilder", "AsiMpx3DetectorConnection",
"AsiMpx3Acquisition",
]
Loading