Added to ini files

This commit is contained in:
Mohacsi Istvan 2022-11-29 17:10:31 +01:00
parent f3a14ab8b4
commit 60708d54cb
5 changed files with 23 additions and 26 deletions

View File

@ -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,

View File

@ -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()

View File

@ -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()

View File

@ -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

View File

@ -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__":