TwiceAsNice  2019-02-18
Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | List of all members
Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl Class Reference
Inheritance diagram for Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl:
Inheritance graph
Collaboration diagram for Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl:
Collaboration graph

Public Member Functions

def autofocusNumber (self)
 
def autofocusNumber (self, val)
 
def autofocusOffset (self)
 
def autofocusOffset (self, val)
 
def autostart (self)
 
def autostart (self, val)
 
def gain (self)
 
def gain (self, val)
 
def limit (self)
 
def limit (self, val)
 
def medianSize (self)
 
def medianSize (self, val)
 
def numImages (self)
 
def numImages (self, val)
 
def snr (self)
 
def snr (self, val)
 
def tracking (self)
 
def tracking (self, val)
 
def zTracking (self)
 
def zTracking (self, val)
 
def numIterations (self)
 
def bin1Mask (self)
 
def bin2Mask (self)
 
def bin4Mask (self)
 
def referenceImage (self)
 
def referenceImage (self, img)
 
def currentImage (self)
 
def currentImage (self, img)
 
def currentImageOverlay (self)
 
def currentImageOverlay (self, spdList)
 
def thresholdImage (self)
 
def thresholdImage (self, img)
 
def __init__ (self, _svcName)
 
def init (self)
 
def idleOffline (self)
 
def idleOnline (self)
 
def abort (self)
 
def stop (self)
 
def start (self)
 
def setReference (self)
 
def resetBuffers (self)
 
def centerCCD (self, x, y)
 
def autofocus (self)
 
def autofocusPMin (self)
 
def autofocusLineFit (self)
 
def moveToAltitude (self, position)
 
def getShift (self)
 
def trackShift (self, shift)
 
def getCrossCorrelation (self, newImage)
 
def getContourCircle (self, numMeasurements=1)
 
def getMetaPupilMask (self)
 
def getThresholdMask (self, image, snr)
 
def moveXYMotor (self, x, y, logMovement=False)
 
def moveZMotor (self, z)
 
def coAddQuadrants (self, image, ccdBinning)
 
def autofocusNumber (self)
 
def autofocusNumber (self, val)
 
def autofocusOffset (self)
 
def autofocusOffset (self, val)
 
def autostart (self)
 
def autostart (self, val)
 
def gain (self)
 
def gain (self, val)
 
def limit (self)
 
def limit (self, val)
 
def medianSize (self)
 
def medianSize (self, val)
 
def numImages (self)
 
def numImages (self, val)
 
def snr (self)
 
def snr (self, val)
 
def tracking (self)
 
def tracking (self, val)
 
def zTracking (self)
 
def zTracking (self, val)
 
def numIterations (self)
 
def bin1Mask (self)
 
def bin2Mask (self)
 
def bin4Mask (self)
 
def referenceImage (self)
 
def referenceImage (self, img)
 
def currentImage (self)
 
def currentImage (self, img)
 
def currentImageOverlay (self)
 
def currentImageOverlay (self, spdList)
 
def thresholdImage (self)
 
def thresholdImage (self, img)
 
def __init__ (self, _svcName)
 
def init (self)
 
def idleOffline (self)
 
def idleOnline (self)
 
def abort (self)
 
def stop (self)
 
def start (self)
 
def setReference (self)
 
def resetBuffers (self)
 
def centerCCD (self, x, y)
 
def autofocus (self)
 
def autofocusPMin (self)
 
def autofocusLineFit (self)
 
def moveToAltitude (self, position)
 
def getShift (self)
 
def trackShift (self, shift)
 
def getCrossCorrelation (self, newImage)
 
def getContourCircle (self, numMeasurements=1)
 
def getMetaPupilMask (self)
 
def getThresholdMask (self, image, snr)
 
def moveXYMotor (self, x, y, logMovement=False)
 
def moveZMotor (self, z)
 
def coAddQuadrants (self, image, ccdBinning)
 
- Public Member Functions inherited from BasdaService.WorkerSkeleton
def __init__ (self, _svcName)
 
def cmdStart (self, _str)
 initiate a command. More...
 
def cmdDone (self)
 actions after terminating the command. More...
 
def cmdPercent (self, _i)
 declare the command be partially completed. More...
 
def cmdAction (self, _i, _str)
 declare the command be partially completed. More...
 
def __init__ (self, _svcName)
 
def cmdStart (self, _str)
 initiate a command. More...
 
def cmdDone (self)
 actions after terminating the command. More...
 
def cmdPercent (self, _i)
 declare the command be partially completed. More...
 
def cmdAction (self, _i, _str)
 declare the command be partially completed. More...
 
- Public Member Functions inherited from BasdaService.Worker
def __init__ (self, _svcName)
 
def name (self)
 
def config (self, _node)
 
def cfg (self, _node)
 
def var (self, _node)
 
def abort (self)
 dummy (does nothing) More...
 
def stop (self)
 dummy (does nothing) More...
 
def init (self)
 dummy (does nothing) More...
 
def deinit (self)
 dummy (does nothing) More...
 
def activate (self)
 dummy (does nothing) More...
 
def deactivate (self)
 dummy (does nothing) More...
 
def idleOffline (self)
 dummy (waits for state change) More...
 
def idleStandby (self)
 dummy (waits for state change) More...
 
def idleOnline (self)
 dummy (waits for state change) More...
 
def errorOffline (self)
 action in response to an error while offline Sets the state to OFFLINE More...
 
def errorStandby (self)
 action in response to an error while in standby Sets the state to OFFLINE More...
 
def errorOnline (self)
 action in response to an error while online Sets the state to OFFLINE More...
 
def errorWorking (self)
 action in response to an error while executing a command Sets the state to OFFLINE More...
 
def __init__ (self, _svcName)
 
def name (self)
 
def config (self, _node)
 
def cfg (self, _node)
 
def var (self, _node)
 
def abort (self)
 dummy (does nothing) More...
 
def stop (self)
 dummy (does nothing) More...
 
def init (self)
 dummy (does nothing) More...
 
def deinit (self)
 dummy (does nothing) More...
 
def activate (self)
 dummy (does nothing) More...
 
def deactivate (self)
 dummy (does nothing) More...
 
def idleOffline (self)
 dummy (waits for state change) More...
 
def idleStandby (self)
 dummy (waits for state change) More...
 
def idleOnline (self)
 dummy (waits for state change) More...
 
def errorOffline (self)
 action in response to an error while offline Sets the state to OFFLINE More...
 
def errorStandby (self)
 action in response to an error while in standby Sets the state to OFFLINE More...
 
def errorOnline (self)
 action in response to an error while online Sets the state to OFFLINE More...
 
def errorWorking (self)
 action in response to an error while executing a command Sets the state to OFFLINE More...
 

Static Public Member Functions

def adaptiveThreshold (image, variationLimit, windowSize)
 
def getRadius (binaryImage, kernelSize=3)
 
def adaptiveThreshold (image, variationLimit, windowSize)
 
def getRadius (binaryImage, kernelSize=3)
 

Public Attributes

 referenceCircle
 
 cfgNode
 
 varNode
 
 cmdNode
 
 onlineWait
 
 trackInterval
 
 pupilSeparation
 
 minShiftXY
 
 maxShiftXY
 
 shiftLimitXY
 
 minShiftZ
 
 maxShiftZ
 
 variationLimit
 
 windowSize
 
 corrPtsPerPix
 
 corrMaskType
 
 autostart
 
 tracking
 
 zTracking
 
 numImages
 
 medianSize
 
 autofocusOffset
 
 autofocusNumber
 
 limit
 
 gain
 
 bufferSize
 
 bufferIndex
 
 motorXY
 
 motorZ
 
 camera
 
 cameraBinning
 
 metaPupilMask
 
 referenceCenter
 
 referenceRadius
 
 hws
 
 running
 
 thresholdImage
 
 currentImageOverlay
 
 referenceImage
 
 circleBuffer
 
 shiftBuffer
 
 currentImage
 
- Public Attributes inherited from BasdaService.WorkerSkeleton
 worker
 
- Public Attributes inherited from BasdaService.Worker
 name
 
 worker
 

Private Attributes

 _referenceImage
 

Detailed Description

CcdTrackServiceWorkerImpl

Worker to monitor and correct CCD translations due to flexure.

Constructor & Destructor Documentation

◆ __init__() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.__init__ (   self,
  _svcName 
)

◆ __init__() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.__init__ (   self,
  _svcName 
)

Member Function Documentation

◆ abort() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.abort (   self)

◆ abort() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.abort (   self)

◆ adaptiveThreshold() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.adaptiveThreshold (   image,
  variationLimit,
  windowSize 
)
static
Finds the optimal binary threshold value and radius of the smallest enclosing circle.

Applies increasing threshold values staring at the median value and finds the
radius of the smallest enclosing circle. Uses a trailing window of specified size
to determine where the radius values start to "level off" (i.e. where the coefficent
of variance of the radius in the window is less than the specified value).

Parameters
----------
image : ndarray
    2D image on which to get the threshold
variationLimit: float
    The coefficient of variation for the radii in the window at which to accept the
    threshold value. For example,a value of 0.005 corresponds to the point where the
    standard deviation of the radii in the window is less than 0.5% of the mean.
windowSize: int
    The size of the trailing window. i.e. The number of past radii to consider when
    determining where the values "level off." Note that this number must be less than
    or equal to the thresholdStart value.

Returns
-------
center : tuple of float
    The center of the circle. The mean x and y coordinates in the window are returned.
radius : float
    The radius of the circle. The mean radius of the window is returned.
imageMask : ndarray
    2D mask array for the threshold value.

Raises
------
CcdTrackServiceException
    If a threshold value can not be found.

◆ adaptiveThreshold() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.adaptiveThreshold (   image,
  variationLimit,
  windowSize 
)
static
Finds the optimal binary threshold value and radius of the smallest enclosing circle.

Applies increasing threshold values staring at the median value and finds the
radius of the smallest enclosing circle. Uses a trailing window of specified size
to determine where the radius values start to "level off" (i.e. where the coefficent
of variance of the radius in the window is less than the specified value).

Parameters
----------
image : ndarray
    2D image on which to get the threshold
variationLimit: float
    The coefficient of variation for the radii in the window at which to accept the
    threshold value. For example,a value of 0.005 corresponds to the point where the
    standard deviation of the radii in the window is less than 0.5% of the mean.
windowSize: int
    The size of the trailing window. i.e. The number of past radii to consider when
    determining where the values "level off." Note that this number must be less than
    or equal to the thresholdStart value.

Returns
-------
center : tuple of float
    The center of the circle. The mean x and y coordinates in the window are returned.
radius : float
    The radius of the circle. The mean radius of the window is returned.
imageMask : ndarray
    2D mask array for the threshold value.

Raises
------
CcdTrackServiceException
    If a threshold value can not be found.

◆ autofocus() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocus (   self)

◆ autofocus() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocus (   self)

◆ autofocusLineFit() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusLineFit (   self)
Refocuses CCD by adjusting Z-axis until minimum radius is found

◆ autofocusLineFit() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusLineFit (   self)
Refocuses CCD by adjusting Z-axis until minimum radius is found

◆ autofocusNumber() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusNumber (   self)

◆ autofocusNumber() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusNumber (   self)

◆ autofocusNumber() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusNumber (   self,
  val 
)

◆ autofocusNumber() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusNumber (   self,
  val 
)

◆ autofocusOffset() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusOffset (   self)

◆ autofocusOffset() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusOffset (   self)

◆ autofocusOffset() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusOffset (   self,
  val 
)

◆ autofocusOffset() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusOffset (   self,
  val 
)

◆ autofocusPMin() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusPMin (   self)
Refocuses CCD by adjusting Z-axis until minimum radius is found

◆ autofocusPMin() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusPMin (   self)
Refocuses CCD by adjusting Z-axis until minimum radius is found

◆ autostart() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autostart (   self)

◆ autostart() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autostart (   self)

◆ autostart() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autostart (   self,
  val 
)

◆ autostart() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autostart (   self,
  val 
)

◆ bin1Mask() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.bin1Mask (   self)

◆ bin1Mask() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.bin1Mask (   self)

◆ bin2Mask() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.bin2Mask (   self)

◆ bin2Mask() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.bin2Mask (   self)

◆ bin4Mask() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.bin4Mask (   self)

◆ bin4Mask() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.bin4Mask (   self)

◆ centerCCD() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.centerCCD (   self,
  x,
  y 
)
Center the CCD to the coordinates provided

◆ centerCCD() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.centerCCD (   self,
  x,
  y 
)
Center the CCD to the coordinates provided

◆ coAddQuadrants() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.coAddQuadrants (   self,
  image,
  ccdBinning 
)
Split image into quadrants and add them together. Also, considers the case where
the metapupils are not separated by half the image width/height.

Parameters
----------
image : ndarray
   2D image. Note that the width and height should be multiples of 2.
ccdBinning : int
   The binning for the current program of the CCD.

Returns
-------
corrImg : ndarray
   2D image of the sum of the quadrants.

◆ coAddQuadrants() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.coAddQuadrants (   self,
  image,
  ccdBinning 
)
Split image into quadrants and add them together. Also, considers the case where
the metapupils are not separated by half the image width/height.

Parameters
----------
image : ndarray
   2D image. Note that the width and height should be multiples of 2.
ccdBinning : int
   The binning for the current program of the CCD.

Returns
-------
corrImg : ndarray
   2D image of the sum of the quadrants.

◆ currentImage() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.currentImage (   self)

◆ currentImage() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.currentImage (   self)

◆ currentImage() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.currentImage (   self,
  img 
)

◆ currentImage() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.currentImage (   self,
  img 
)

◆ currentImageOverlay() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.currentImageOverlay (   self)

◆ currentImageOverlay() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.currentImageOverlay (   self)

◆ currentImageOverlay() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.currentImageOverlay (   self,
  spdList 
)

◆ currentImageOverlay() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.currentImageOverlay (   self,
  spdList 
)

◆ gain() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.gain (   self)

◆ gain() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.gain (   self)

◆ gain() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.gain (   self,
  val 
)

◆ gain() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.gain (   self,
  val 
)

◆ getContourCircle() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.getContourCircle (   self,
  numMeasurements = 1 
)
Gets an image from the camera, applies mask if set, sums quadrants of image, and fits a circle to the
contours of the image. If specified, will take multiple measurements and return the median (for outlier
rejection).

Parameters
----------
numMeasurements : int, optional
    The number of measurements to take. The median of these will be returned.

Returns
-------
center : tuple of float
    The coordinates of the center of the circle.
radius : float
    The radius of the circle.
image : ndarray
    2D array of the quadrant-summed image.

Raises
------
VinoCameraCtrlIsIdle
    If the camera service is not running.
CcdTrackServiceException
    If a circle cannot be fit to the image.

◆ getContourCircle() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.getContourCircle (   self,
  numMeasurements = 1 
)
Gets an image from the camera, applies mask if set, sums quadrants of image, and fits a circle to the
contours of the image. If specified, will take multiple measurements and return the median (for outlier
rejection).

Parameters
----------
numMeasurements : int, optional
    The number of measurements to take. The median of these will be returned.

Returns
-------
center : tuple of float
    The coordinates of the center of the circle.
radius : float
    The radius of the circle.
image : ndarray
    2D array of the quadrant-summed image.

Raises
------
VinoCameraCtrlIsIdle
    If the camera service is not running.
CcdTrackServiceException
    If a circle cannot be fit to the image.

◆ getCrossCorrelation() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.getCrossCorrelation (   self,
  newImage 
)
Get X, Y translation in pixels between referenceImage and newImage. Uses cross-correlation and
least-squares interpolation to find sub-pixel translation between the reference image and a new image.

       Parameters
       ----------
       newImage : ndarray
   2D image to calculate xy-translation for.

       Returns
       -------
       xShift : float
   Translation in x direction in pixels.
       yShift : float
   Translation in y direction in pixels.

◆ getCrossCorrelation() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.getCrossCorrelation (   self,
  newImage 
)
Get X, Y translation in pixels between referenceImage and newImage. Uses cross-correlation and
least-squares interpolation to find sub-pixel translation between the reference image and a new image.

       Parameters
       ----------
       newImage : ndarray
   2D image to calculate xy-translation for.

       Returns
       -------
       xShift : float
   Translation in x direction in pixels.
       yShift : float
   Translation in y direction in pixels.

◆ getMetaPupilMask() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.getMetaPupilMask (   self)
Get the metapupil mask for the current ccd binning from the location specified in the config file.

Returns
-------
mask : ndarray or None
    2D mask array of the metapupils for the current binning. Returns None if binning mode not recognized
    or cannot find mask file.

◆ getMetaPupilMask() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.getMetaPupilMask (   self)
Get the metapupil mask for the current ccd binning from the location specified in the config file.

Returns
-------
mask : ndarray or None
    2D mask array of the metapupils for the current binning. Returns None if binning mode not recognized
    or cannot find mask file.

◆ getRadius() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.getRadius (   binaryImage,
  kernelSize = 3 
)
static
Finds the contours of a binary image and returns the center and radius of a the smallest enclosing circle. If
a kernelSize is specified than attempts to 'open' then 'close' the contour. See link below for more details.
https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_morphological_ops/py_morphological_ops.html

Parameters
----------
binaryImage: ndarray
    2D mask array (containing data with boolean type)
kernelSize : int, optional
    If specified, uses a kernel of this size to 'open' then 'close' the image. This may help to reduce noise
    and ensure better contour fitting.

Returns
-------
center : tuple of float
    Center of the enclosing circle in (x, y) coordinates
radius : float
    Radius of the enclosing circle.
imageMask : ndarray
    2D mask array used to find the enclosing circle

Raises
------
CcdTrackServiceException
    If no contours are found

◆ getRadius() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.getRadius (   binaryImage,
  kernelSize = 3 
)
static
Finds the contours of a binary image and returns the center and radius of a the smallest enclosing circle. If
a kernelSize is specified than attempts to 'open' then 'close' the contour. See link below for more details.
https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_morphological_ops/py_morphological_ops.html

Parameters
----------
binaryImage: ndarray
    2D mask array (containing data with boolean type)
kernelSize : int, optional
    If specified, uses a kernel of this size to 'open' then 'close' the image. This may help to reduce noise
    and ensure better contour fitting.

Returns
-------
center : tuple of float
    Center of the enclosing circle in (x, y) coordinates
radius : float
    Radius of the enclosing circle.
imageMask : ndarray
    2D mask array used to find the enclosing circle

Raises
------
CcdTrackServiceException
    If no contours are found

◆ getShift() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.getShift (   self)
Take an image and measure x, y, z shifts against the reference image. Measures the x and y shift using
cross-correlation and the z shift by comparing a circle fit to the contours of the metapupil. Uses a ring
buffer (size specified in config) to smooth measurements and avoid instability due to spurious measurements.

Returns
-------
shift : ndarray
    The x, y, z shifts as measured.

Raises
------
VinoCameraCtrlIsIdle
    If the camera service is not running.
CcdTrackServiceException
    If an error occurs while measuring the shifts.

See Also
--------
getContourCircle : contour circle fitting for measuring z shift.
getCrossCorrelation : cross-correlation for measuring x and y shifts.

◆ getShift() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.getShift (   self)
Take an image and measure x, y, z shifts against the reference image. Measures the x and y shift using
cross-correlation and the z shift by comparing a circle fit to the contours of the metapupil. Uses a ring
buffer (size specified in config) to smooth measurements and avoid instability due to spurious measurements.

Returns
-------
shift : ndarray
    The x, y, z shifts as measured.

Raises
------
VinoCameraCtrlIsIdle
    If the camera service is not running.
CcdTrackServiceException
    If an error occurs while measuring the shifts.

See Also
--------
getContourCircle : contour circle fitting for measuring z shift.
getCrossCorrelation : cross-correlation for measuring x and y shifts.

◆ getThresholdMask() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.getThresholdMask (   self,
  image,
  snr 
)
Return an image mask which only passes values above the specified signal-to-noise ratio.

Parameters
----------
image : ndarray
    2D array of the pupil image
snr : float
    The signal-to-noise ratio to threshold the image with.

Returns
-------
mask : ndarray
    2D mask array which a threshold set to the specified SNR.

◆ getThresholdMask() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.getThresholdMask (   self,
  image,
  snr 
)
Return an image mask which only passes values above the specified signal-to-noise ratio.

Parameters
----------
image : ndarray
    2D array of the pupil image
snr : float
    The signal-to-noise ratio to threshold the image with.

Returns
-------
mask : ndarray
    2D mask array which a threshold set to the specified SNR.

◆ idleOffline() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.idleOffline (   self)

◆ idleOffline() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.idleOffline (   self)

◆ idleOnline() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.idleOnline (   self)

◆ idleOnline() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.idleOnline (   self)

◆ init() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.init (   self)
Connect to the camera and motor services specified in the config file.

◆ init() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.init (   self)
Connect to the camera and motor services specified in the config file.

◆ limit() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.limit (   self)

◆ limit() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.limit (   self)

◆ limit() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.limit (   self,
  val 
)

◆ limit() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.limit (   self,
  val 
)

◆ medianSize() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.medianSize (   self)

◆ medianSize() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.medianSize (   self)

◆ medianSize() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.medianSize (   self,
  val 
)

◆ medianSize() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.medianSize (   self,
  val 
)

◆ moveToAltitude() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.moveToAltitude (   self,
  position 
)
Moves the CCD by the relative distance between ground conjugation and altitude conjugation.

◆ moveToAltitude() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.moveToAltitude (   self,
  position 
)
Moves the CCD by the relative distance between ground conjugation and altitude conjugation.

◆ moveXYMotor() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.moveXYMotor (   self,
  x,
  y,
  logMovement = False 
)
Moves the CCD in the x-axis and y-axis by the amount specified. Will adjust for CCD binning.

Parameterspixels
----------
x : float
    The amount in pixels to move the motor by.
y : float
    The amount in pixels to move the motor by.

◆ moveXYMotor() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.moveXYMotor (   self,
  x,
  y,
  logMovement = False 
)
Moves the CCD in the x-axis and y-axis by the amount specified. Will adjust for CCD binning.

Parameterspixels
----------
x : float
    The amount in pixels to move the motor by.
y : float
    The amount in pixels to move the motor by.

◆ moveZMotor() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.moveZMotor (   self,
  z 
)
Moves the CCD in the z-axis by the amount specified.

Parameters
----------
z : float
    The amount in pixels to move the motor by.

◆ moveZMotor() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.moveZMotor (   self,
  z 
)
Moves the CCD in the z-axis by the amount specified.

Parameters
----------
z : float
    The amount in pixels to move the motor by.

◆ numImages() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.numImages (   self)

◆ numImages() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.numImages (   self)

◆ numImages() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.numImages (   self,
  val 
)

◆ numImages() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.numImages (   self,
  val 
)

◆ numIterations() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.numIterations (   self)

◆ numIterations() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.numIterations (   self)

◆ referenceImage() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.referenceImage (   self)

◆ referenceImage() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.referenceImage (   self)

◆ referenceImage() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.referenceImage (   self,
  img 
)

◆ referenceImage() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.referenceImage (   self,
  img 
)

◆ resetBuffers() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.resetBuffers (   self)

◆ resetBuffers() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.resetBuffers (   self)

◆ setReference() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.setReference (   self)

◆ setReference() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.setReference (   self)

◆ snr() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.snr (   self)

◆ snr() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.snr (   self)

◆ snr() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.snr (   self,
  val 
)

◆ snr() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.snr (   self,
  val 
)

◆ start() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.start (   self)

◆ start() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.start (   self)

◆ stop() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.stop (   self)

◆ stop() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.stop (   self)

◆ thresholdImage() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.thresholdImage (   self)

◆ thresholdImage() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.thresholdImage (   self)

◆ thresholdImage() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.thresholdImage (   self,
  img 
)

◆ thresholdImage() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.thresholdImage (   self,
  img 
)

◆ tracking() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.tracking (   self)

◆ tracking() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.tracking (   self)

◆ tracking() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.tracking (   self,
  val 
)

◆ tracking() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.tracking (   self,
  val 
)

◆ trackShift() [1/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.trackShift (   self,
  shift 
)
Tracks x, y, z shifts and move motors if shifts within limits (as set in config file) are detected. If any
elements of shift are above maxShift then stops tracking (as a safeguard against runaway corrections). The
following logic applies: Z-shift ? move Z-motor : (XY-Shift ? XY-move motor : pause before next loop)

Parameters
----------
shift : ndarray
    The x, y, z shifts (in pixels) to track.

◆ trackShift() [2/2]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.trackShift (   self,
  shift 
)
Tracks x, y, z shifts and move motors if shifts within limits (as set in config file) are detected. If any
elements of shift are above maxShift then stops tracking (as a safeguard against runaway corrections). The
following logic applies: Z-shift ? move Z-motor : (XY-Shift ? XY-move motor : pause before next loop)

Parameters
----------
shift : ndarray
    The x, y, z shifts (in pixels) to track.

◆ zTracking() [1/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.zTracking (   self)

◆ zTracking() [2/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.zTracking (   self)

◆ zTracking() [3/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.zTracking (   self,
  val 
)

◆ zTracking() [4/4]

def Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.zTracking (   self,
  val 
)

Member Data Documentation

◆ _referenceImage

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl._referenceImage
private

◆ autofocusNumber

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusNumber

◆ autofocusOffset

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autofocusOffset

◆ autostart

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.autostart

◆ bufferIndex

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.bufferIndex

◆ bufferSize

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.bufferSize

◆ camera

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.camera

◆ cameraBinning

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.cameraBinning

◆ cfgNode

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.cfgNode

◆ circleBuffer

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.circleBuffer

◆ cmdNode

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.cmdNode

◆ corrMaskType

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.corrMaskType

◆ corrPtsPerPix

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.corrPtsPerPix

◆ currentImage

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.currentImage

◆ currentImageOverlay

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.currentImageOverlay

◆ gain

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.gain

◆ hws

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.hws

◆ limit

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.limit

◆ maxShiftXY

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.maxShiftXY

◆ maxShiftZ

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.maxShiftZ

◆ medianSize

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.medianSize

◆ metaPupilMask

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.metaPupilMask

◆ minShiftXY

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.minShiftXY

◆ minShiftZ

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.minShiftZ

◆ motorXY

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.motorXY

◆ motorZ

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.motorZ

◆ numImages

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.numImages

◆ onlineWait

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.onlineWait

◆ pupilSeparation

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.pupilSeparation

◆ referenceCenter

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.referenceCenter

◆ referenceCircle

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.referenceCircle

◆ referenceImage

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.referenceImage

◆ referenceRadius

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.referenceRadius

◆ running

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.running

◆ shiftBuffer

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.shiftBuffer

◆ shiftLimitXY

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.shiftLimitXY

◆ thresholdImage

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.thresholdImage

◆ tracking

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.tracking

◆ trackInterval

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.trackInterval

◆ variationLimit

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.variationLimit

◆ varNode

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.varNode

◆ windowSize

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.windowSize

◆ zTracking

Laos.Aoc.CcdTrackServiceWorkerImpl.CcdTrackServiceWorkerImpl.zTracking

The documentation for this class was generated from the following file: