Skip to content

Commit

Permalink
Merge pull request #920 from lnls-sirius/update-dvf
Browse files Browse the repository at this point in the history
Update DVF
  • Loading branch information
anacso17 authored Mar 13, 2023
2 parents de05d6b + 173a062 commit e0b2bd4
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions siriuspy/siriuspy/devices/dvf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class DEVICES:
'ACQUISITION_TIME_MIN', # [s]
'ACQUISITION_TIME_DEFAULT', # [s]
'EXPOSURE_TIME_DEFAULT', # [s]
'IMAGE_SIZE_V', # [pixel]
'IMAGE_SIZE_H', # [pixel]
'IMAGE_SIZE_Y', # [pixel]
'IMAGE_SIZE_X', # [pixel]
'IMAGE_PIXEL_SIZE', # [um]
'OPTICS_MAGNIFICATION_FACTOR', # source to image
)
Expand All @@ -46,7 +46,7 @@ class DEVICES:
'cam1:ArrayCallbacks', 'cam1:ArrayCallbacks_RBV',
'cam1:AcquireTime', 'cam1:AcquireTime_RBV',
'cam1:AcquirePeriod', 'cam1:AcquirePeriod_RBV',
'cam1:Acquire',
'cam1:Acquire', 'cam1:Acquire_RBV',
'image1:EnableCallbacks', 'image1:EnableCallbacks_RBV',
'image1:ArrayData',
)
Expand All @@ -59,9 +59,10 @@ def __init__(self, devname):
# call base class constructor
super().__init__(devname, properties=DVF._properties)

@property
def parameters(self):
"""Return DVF parameters."""
return self._dev2params[self.devname]
return DVF._dev2params[self.devname]

@property
def exposure_time(self):
Expand Down Expand Up @@ -92,22 +93,22 @@ def acquisition_status(self):
return self['cam1:Acquire']

@property
def image_sizeh(self):
"""Image horizontal size (pixels)."""
def image_sizex(self):
"""Image second dimension size (pixels)."""
params = self.parameters
return params.IMAGE_SIZE_H
return params.IMAGE_SIZE_X

@property
def image_sizev(self):
"""Image vertical size (pixels)."""
def image_sizey(self):
"""Image first dimension size (pixels)."""
params = self.parameters
return params.IMAGE_SIZE_V
return params.IMAGE_SIZE_Y

@property
def image(self):
"""Return DVF image formatted as a (sizey, sizex) matriz."""
"""Return DVF image formatted as a (sizey, sizex) matrix."""
params = self.parameters
shape = (params.IMAGE_SIZE_V, params.IMAGE_SIZE_H)
shape = (params.IMAGE_SIZE_Y, params.IMAGE_SIZE_X)
data = self['image1:ArrayData']
image = _np.reshape(data, shape)
return image
Expand All @@ -119,8 +120,8 @@ def image_pixel_size(self):
return params.IMAGE_PIXEL_SIZE

@property
def optics_magnefication_factor(self):
"""Source to image magnefication factor."""
def optics_magnification_factor(self):
"""Source to image magnification factor."""
params = self.parameters
return params.OPTICS_MAGNIFICATION_FACTOR

Expand Down

0 comments on commit e0b2bd4

Please sign in to comment.