caproto.ioc_examples.mini_beamline.MovingDot¶
-
class
caproto.ioc_examples.mini_beamline.
MovingDot
(prefix, *, macros=None, parent=None, name=None)[source]¶ ¶ Attribute
Suffix
Docs
Type
Notes
Alarm Group
ArraySizeX_RBV
ArraySizeX_RBV
Image array size X
int
Read-only
ArraySizeY_RBV
ArraySizeY_RBV
Image array size Y
int
Read-only
ArraySize_RBV
ArraySize_RBV
Image array size [Y, X]
int
Read-only
det
det
Detector image (480x640)
float
Read-only Get
exp
exp
float
Put
img_sum
img_sum
float
Read-only
mtrx
mtrx
float
mtry
mtry
float
shutter_open
shutter_open
Shutter open/close
int
Methods
group_read
(instance)Generic read called for channels without get defined
group_write
(instance, value)Generic write called for channels without put defined
Attributes
M
N
Xcen
Ycen
background
default_values
sigmax
sigmay
type_map
type_map_read_only
pvproperty methods
-
det.
getter
(self, instance)¶
Source code: det.getter
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
@det.getter async def det(self, instance): N = self.N M = self.M back = np.random.poisson(self.background, (N, M)) if not self.shutter_open.value: await self.img_sum.write([back.sum()]) return back.ravel() x = self.mtrx.value y = self.mtry.value Y, X = np.ogrid[:N, :M] X = X - M / 2 + x Y = Y - N / 2 + y X /= self.sigmax Y /= self.sigmay dot = np.exp(-(X**2 + Y**2) / 2) * np.exp(- (x**2 + y**2) / 100**2) I = self.parent.current.value # noqa e = self.exp.value measured = (self.parent.N_per_I_per_s * dot * e * I) ret = (back + np.random.poisson(measured)) await self.img_sum.write([ret.sum()]) return ret.ravel()
-