Skip to content

Add i22 beamline and devices #332

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

Closed
wants to merge 15 commits into from
Closed
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
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ classifiers = [
description = "Ophyd devices and other utils that could be used across DLS beamlines"
dependencies = [
"ophyd",
"ophyd_async@git+https://github.com/bluesky/ophyd-async@ec5729640041ee5b77b4614158793af3a34cf9d8", #Use a specific branch from ophyd async until https://github.com/bluesky/ophyd-async/pull/101 is merged
"ophyd_async@git+https://github.com/bluesky/ophyd-async",
"bluesky",
"pyepics",
"dataclasses-json",
Expand All @@ -23,9 +23,9 @@ dependencies = [
"requests",
"graypy",
"pydantic<2.0",
"opencv-python-headless", # For pin-tip detection.
"aioca", # Required for CA support with ophyd-async.
"p4p", # Required for PVA support with ophyd-async.
"opencv-python-headless", # For pin-tip detection.
"aioca", # Required for CA support with ophyd-async.
"p4p", # Required for PVA support with ophyd-async.
"numpy",
]

Expand Down
82 changes: 82 additions & 0 deletions src/dodal/beamlines/i22.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
from ophyd_async.panda import PandA

from dodal.beamlines.beamline_utils import device_instantiation, get_directory_provider
from dodal.beamlines.beamline_utils import set_beamline as set_utils_beamline
from dodal.devices.i22.pilatus import I22HDFStatsPilatus
from dodal.devices.linkam3 import Linkam3
from dodal.devices.tetramm import TetrammDetector
from dodal.log import set_beamline as set_log_beamline
from dodal.utils import get_beamline_name

BL = get_beamline_name("i22")
set_log_beamline(BL)
set_utils_beamline(BL)


def saxs(
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
) -> I22HDFStatsPilatus:
return device_instantiation(
I22HDFStatsPilatus,
"saxs",
"-EA-PILAT-01:",
wait_for_connection,
fake_with_ophyd_sim,
directory_provider=get_directory_provider(),
)


def waxs(
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
) -> I22HDFStatsPilatus:
return device_instantiation(
I22HDFStatsPilatus,
"waxs",
"-EA-PILAT-03:",
wait_for_connection,
fake_with_ophyd_sim,
directory_provider=get_directory_provider(),
)


def panda1(
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
) -> PandA:
return device_instantiation(
PandA, "panda1", "-EA-PANDA-01:", wait_for_connection, fake_with_ophyd_sim
)


def linkam(
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
) -> Linkam3:
return device_instantiation(
Linkam3, "linkam", "-EA-TEMPC-05", wait_for_connection, fake_with_ophyd_sim
)


def incident_beam(
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
) -> TetrammDetector:
return device_instantiation(
TetrammDetector,
"incident_beam",
"-EA-XBPM-02:",
wait_for_connection,
fake_with_ophyd_sim,
directory_provider=get_directory_provider(),
temperature="Temperature",
)


def transmitted_beam(
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
) -> TetrammDetector:
return device_instantiation(
TetrammDetector,
"transmitted_beam",
"-EA-TTRM-02:",
wait_for_connection,
fake_with_ophyd_sim,
directory_provider=get_directory_provider(),
)
106 changes: 97 additions & 9 deletions src/dodal/beamlines/p38.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
from dodal.beamlines.beamline_utils import device_instantiation
# from ophyd_async.panda import PandA

from dodal.beamlines.beamline_utils import device_instantiation, get_directory_provider
from dodal.beamlines.beamline_utils import set_beamline as set_utils_beamline
from dodal.devices.areadetector import AdAravisDetector

# from dodal.devices.areadetector import AdAravisDetector
from dodal.devices.areadetector.adaravis import SumHDFAravisDetector

# from dodal.devices.linkam3 import Linkam3
# from dodal.devices.tetramm import TetrammDetector
from dodal.log import set_beamline as set_log_beamline
from dodal.utils import get_beamline_name

Expand All @@ -9,25 +16,106 @@
set_utils_beamline(BL)


def d11(
def d3(
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
) -> AdAravisDetector:
) -> SumHDFAravisDetector:
return device_instantiation(
AdAravisDetector,
"D11",
"-DI-DCAM-03:",
SumHDFAravisDetector,
"D3",
"-DI-DCAM-01:",
wait_for_connection,
fake_with_ophyd_sim,
directory_provider=get_directory_provider(),
)


# FIXME: Requires implementation, currently disconnected
# def d4(
# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
# ) ->


# FIXME: Currently disconnected
# def d11(
# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
# ) -> SumHDFAravisDetector:
# return device_instantiation(
# SumHDFAravisDetector,
# "D11",
# "-DI-DCAM-03:",
# wait_for_connection,
# fake_with_ophyd_sim,
# directory_provider=get_directory_provider(),
# )


def d12(
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
) -> AdAravisDetector:
) -> SumHDFAravisDetector:
return device_instantiation(
AdAravisDetector,
SumHDFAravisDetector,
"D12",
"-DI-DCAM-04:",
wait_for_connection,
fake_with_ophyd_sim,
directory_provider=get_directory_provider(),
)


# FIXME: Requires implementation, currently disconnected
# def d13(
# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
# ) ->


# def linkam(
# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
# ) -> Linkam3:
# return device_instantiation(
# Linkam3, "linkam", "-EA-LINKM-02:", wait_for_connection, fake_with_ophyd_sim
# )


# FIXME: Times out
# def tetramm(
# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
# ) -> TetrammDetector:
# return device_instantiation(
# TetrammDetector,
# "tetramm",
# "-EA-XBPM-01:",
# wait_for_connection,
# fake_with_ophyd_sim,
# directory_provider=get_directory_provider(),
# )


# FIXME: Currently disconnected
# def panda1(
# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
# ) -> PandA:
# return device_instantiation(
# PandA, "panda1", "-EA-PANDA-01:", wait_for_connection, fake_with_ophyd_sim
# )


# FIXME: Times out
# def panda2(
# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
# ) -> PandA:
# return device_instantiation(
# PandA,
# "panda2",
# "-EA-PANDA-02:",
# wait_for_connection,
# fake_with_ophyd_sim,
# )


# FIXME: Currently disconnected
# def panda3(
# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
# ) -> PandA:
# return device_instantiation(
# PandA, "panda3", "-EA-PANDA-02:", wait_for_connection, fake_with_ophyd_sim
Comment on lines +115 to +120
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# FIXME: Currently disconnected
# def panda3(
# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
# ) -> PandA:
# return device_instantiation(
# PandA, "panda3", "-EA-PANDA-02:", wait_for_connection, fake_with_ophyd_sim
# FIXME: Currently disconnected
# def panda3(
# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
# ) -> PandA:
# return device_instantiation(
# PandA, "panda3", "-EA-PANDA-03:", wait_for_connection, fake_with_ophyd_sim

I presume?

# )
2 changes: 2 additions & 0 deletions src/dodal/devices/areadetector/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from .adaravis import AdAravisDetector
from .adsim import AdSimDetector
from .adutils import Hdf5Writer, SynchronisedAdDriverBase
from .pilatus import HDFStatsPilatus

__all__ = [
"AdSimDetector",
"SynchronisedAdDriverBase",
"HDFStatsPilatus",
"Hdf5Writer",
"AdAravisDetector",
]
Loading