diff --git a/ophyd_devices/epics/__init__.py b/ophyd_devices/epics/__init__.py index b91a7eb..b422915 100644 --- a/ophyd_devices/epics/__init__.py +++ b/ophyd_devices/epics/__init__.py @@ -7,6 +7,7 @@ from .devices.DelayGeneratorDG645 import DelayGeneratorDG645 from .devices.InsertionDevice import InsertionDevice from .devices.slits import SlitH, SlitV from .devices.specMotors import ( + Bpm4i, EnergyKev, GirderMotorPITCH, GirderMotorROLL, diff --git a/ophyd_devices/epics/devices/SpmBase.py b/ophyd_devices/epics/devices/SpmBase.py index be5a1d6..f996bd3 100644 --- a/ophyd_devices/epics/devices/SpmBase.py +++ b/ophyd_devices/epics/devices/SpmBase.py @@ -57,7 +57,7 @@ class SpmSim(SpmBase): # Define normalized 2D gaussian def gaus2d(x=0, y=0, mx=0, my=0, sx=1, sy=1): return np.exp( - -((x - mx) ** 2.0 / (2.0 * sx ** 2.0) + (y - my) ** 2.0 / (2.0 * sy ** 2.0)) + -((x - mx) ** 2.0 / (2.0 * sx**2.0) + (y - my) ** 2.0 / (2.0 * sy**2.0)) ) # Generator for dynamic values @@ -73,10 +73,10 @@ class SpmSim(SpmBase): beam = self._simFrame() total = np.sum(beam) - np.sum(beam[24:48, :]) rnge = np.floor(np.log10(total) - 0.0) - s1 = np.sum(beam[0:16, :]) / 10 ** rnge - s2 = np.sum(beam[16:24, :]) / 10 ** rnge - s3 = np.sum(beam[40:48, :]) / 10 ** rnge - s4 = np.sum(beam[48:64, :]) / 10 ** rnge + s1 = np.sum(beam[0:16, :]) / 10**rnge + s2 = np.sum(beam[16:24, :]) / 10**rnge + s3 = np.sum(beam[40:48, :]) / 10**rnge + s4 = np.sum(beam[48:64, :]) / 10**rnge self.s1w.set(s1).wait() self.s2w.set(s2).wait() diff --git a/ophyd_devices/epics/devices/XbpmBase.py b/ophyd_devices/epics/devices/XbpmBase.py index 8a2a853..9035412 100644 --- a/ophyd_devices/epics/devices/XbpmBase.py +++ b/ophyd_devices/epics/devices/XbpmBase.py @@ -87,7 +87,7 @@ class XbpmSim(XbpmBase): # define normalized 2D gaussian def gaus2d(x=0, y=0, mx=0, my=0, sx=1, sy=1): return np.exp( - -((x - mx) ** 2.0 / (2.0 * sx ** 2.0) + (y - my) ** 2.0 / (2.0 * sy ** 2.0)) + -((x - mx) ** 2.0 / (2.0 * sx**2.0) + (y - my) ** 2.0 / (2.0 * sy**2.0)) ) # Generator for dynamic values @@ -103,10 +103,10 @@ class XbpmSim(XbpmBase): beam = self._simFrame() total = np.sum(beam) rnge = np.floor(np.log10(total) - 0.0) - s1 = np.sum(beam[32:64, 32:64]) / 10 ** rnge - s2 = np.sum(beam[0:32, 32:64]) / 10 ** rnge - s3 = np.sum(beam[32:64, 0:32]) / 10 ** rnge - s4 = np.sum(beam[0:32, 0:32]) / 10 ** rnge + s1 = np.sum(beam[32:64, 32:64]) / 10**rnge + s2 = np.sum(beam[0:32, 32:64]) / 10**rnge + s3 = np.sum(beam[32:64, 0:32]) / 10**rnge + s4 = np.sum(beam[0:32, 0:32]) / 10**rnge self.s1w.set(s1).wait() self.s2w.set(s2).wait() diff --git a/ophyd_devices/epics/devices/__init__.py b/ophyd_devices/epics/devices/__init__.py index f1a0cac..534071f 100644 --- a/ophyd_devices/epics/devices/__init__.py +++ b/ophyd_devices/epics/devices/__init__.py @@ -3,20 +3,20 @@ from .slits import SlitH, SlitV from .XbpmBase import XbpmBase, XbpmCsaxsOp from .SpmBase import SpmBase from .InsertionDevice import InsertionDevice -from .specMotors import ( - PmMonoBender, - PmDetectorRotation, +from .devices.specMotors import ( + Bpm4i, + EnergyKev, + GirderMotorPITCH, + GirderMotorROLL, GirderMotorX1, GirderMotorY1, - GirderMotorROLL, GirderMotorYAW, - GirderMotorPITCH, MonoTheta1, MonoTheta2, - EnergyKev, + PmDetectorRotation, + PmMonoBender, ) - # Standard ophyd classes from ophyd import EpicsSignal, EpicsSignalRO, EpicsMotor from ophyd.sim import SynAxis, SynSignal, SynPeriodicSignal diff --git a/ophyd_devices/epics/devices/specMotors.py b/ophyd_devices/epics/devices/specMotors.py index 04e83b6..3bbd8fc 100644 --- a/ophyd_devices/epics/devices/specMotors.py +++ b/ophyd_devices/epics/devices/specMotors.py @@ -20,11 +20,9 @@ from ophyd import ( Device, Signal, Component, - DynamicDeviceComponent, Kind, ) from ophyd.pseudopos import pseudo_position_argument, real_position_argument -from ophyd.utils.epics_pvs import data_type class PmMonoBender(PseudoPositioner): @@ -149,12 +147,6 @@ class VirtualEpicsSignalRO(EpicsSignalRO): raw = super().get(*args, **kwargs) return self.calc(raw) - # def describe(self): - # val = self.get() - # d = super().describe() - # d[self.name]["dtype"] = data_type(val) - # return d - class MonoTheta1(VirtualEpicsSignalRO): """Converts the pusher motor position to theta angle""" @@ -237,7 +229,11 @@ class Bpm4i(Device): ch2 = Component(EpicsSignalRO, "S3", auto_monitor=True, kind=Kind.omitted, name="ch2") ch3 = Component(EpicsSignalRO, "S4", auto_monitor=True, kind=Kind.omitted, name="ch3") ch4 = Component(EpicsSignalRO, "S5", auto_monitor=True, kind=Kind.omitted, name="ch4") - sum = Component(CurrentSum, kind=Kind.hinted, name="sum",) + sum = Component( + CurrentSum, + kind=Kind.hinted, + name="sum", + ) if __name__ == "__main__":