-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Relm-Arrowny/12-create-ophy-device-for-pi…
…mte-area-detector 12 create ophy device for pimte area detector
- Loading branch information
Showing
35 changed files
with
3,577 additions
and
32 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ | |
"source.organizeImports.ruff": "explicit" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from typing import Sequence | ||
|
||
from bluesky.protocols import Hints | ||
from ophyd_async.core import DirectoryProvider, SignalR, StandardDetector | ||
from ophyd_async.epics.areadetector.drivers import ADBaseShapeProvider | ||
from ophyd_async.epics.areadetector.writers import HDFWriter, NDFileHDF, NDPluginStats | ||
|
||
from i10_bluesky.epics.drivers.pimte1_driver import Pimte1Driver | ||
from i10_bluesky.epics.pimte_controller import PimteController | ||
|
||
|
||
class HDFStatsPimte(StandardDetector): | ||
_controller: PimteController | ||
_writer: HDFWriter | ||
|
||
def __init__( | ||
self, | ||
prefix: str, | ||
directory_provider: DirectoryProvider, | ||
name: str, | ||
config_sigs: Sequence[SignalR] = (), | ||
**scalar_sigs: str, | ||
): | ||
self.drv = Pimte1Driver(prefix + "CAM:") | ||
self.hdf = NDFileHDF(prefix + "HDF5:") | ||
self.stats = NDPluginStats(prefix + "STAT:") | ||
# taken from i22 but this does nothing atm | ||
|
||
super().__init__( | ||
PimteController(self.drv), | ||
HDFWriter( | ||
self.hdf, | ||
directory_provider, | ||
lambda: self.name, | ||
ADBaseShapeProvider(self.drv), | ||
sum="StatsTotal", | ||
**scalar_sigs, | ||
), | ||
config_sigs=config_sigs, | ||
name=name, | ||
) | ||
|
||
@property | ||
def hints(self) -> Hints: | ||
return self._writer.hints |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from ophyd_async.core import Device | ||
from ophyd_async.epics.motion.motor import Motor | ||
|
||
|
||
class DetectorSlits(Device): | ||
|
||
def __init__(self, prefix: str, name="") -> None: | ||
self.dsu = Motor(prefix + "-01:TRANS") | ||
self.dsd = Motor(prefix + "-02:TRANS") | ||
super().__init__(name=name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
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.log import set_beamline as set_log_beamline | ||
from dodal.utils import get_beamline_name | ||
|
||
from i10_bluesky.devices.pimteAD import HDFStatsPimte | ||
|
||
BL = get_beamline_name("BL10I") | ||
set_log_beamline(BL) | ||
set_utils_beamline(BL) | ||
|
||
|
||
def pimte( | ||
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False | ||
) -> HDFStatsPimte: | ||
return device_instantiation( | ||
HDFStatsPimte, | ||
"pimte", | ||
"-EA-PILAT-01:", | ||
wait_for_connection, | ||
fake_with_ophyd_sim, | ||
directory_provider=get_directory_provider(), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from ophyd import Component, Device, EpicsSignal | ||
|
||
|
||
class ScaleCard(Device): | ||
for i in range(1, 2): | ||
macr17 = Component(EpicsSignal, ":SCALER1.S' + str(i) + '") | ||
|
||
|
||
""" | ||
class Scaler(StandardReadable): | ||
#basic slits class | ||
def __init__(self, prefix: str, suffix: str, name:str ="") -> None: | ||
# Define some signals | ||
self.value = epics_signal_r(float, prefix + suffix) | ||
# Set name and signals for read() and read_configuration() | ||
self.set_readable_signals( | ||
read=[self.value], | ||
#config=[self.mode], | ||
) | ||
super().__init__(name=name) | ||
""" |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from enum import Enum | ||
|
||
from ophyd_async.epics.areadetector.drivers.ad_base import ADBase | ||
from ophyd_async.epics.areadetector.utils import ad_r, ad_rw | ||
from ophyd_async.epics.signal import epics_signal_rw | ||
|
||
|
||
class Pimte1Driver(ADBase): | ||
def __init__(self, prefix: str) -> None: | ||
self.trigger_mode = ad_rw(Pimte1Driver.TriggerMode, prefix + "TriggerMode") | ||
self.initialize = ad_rw(int, prefix + "Initialize") | ||
self.set_temperture = epics_signal_rw(float, prefix + "SetTemperature") | ||
self.read_backtemperture = ad_r(float, prefix + "MeasuredTemperature") | ||
self.speed = ad_rw(Pimte1Driver.SpeedMode, prefix + "SpeedSelection") | ||
super().__init__(prefix) | ||
|
||
class SpeedMode(str, Enum): | ||
adc_50Khz = "0: 50 KHz - 20000 ns" | ||
adc_100Khz = "1: 100 kHz - 10000 ns" | ||
adc_200Khz = "2: 200 kHz - 5000 ns" | ||
adc_500Khz = "3: 500 kHz - 2000 ns" | ||
adc_1Mhz = "4: 1 MHz - 1000 ns" | ||
adc_2Mhz = "5: 2 MHz - 500 ns" | ||
|
||
class TriggerMode(str, Enum): | ||
internal = "Free Run" | ||
ext_trigger = "Ext Trigger" | ||
bulb_mode = "Bulb Mode" |
Oops, something went wrong.