Skip to content

[BUG] PYME acquisitions lacking a z-controller try to access it nevertheless #714

@csoeller

Description

@csoeller

Describe the bug
I regularly run PYMEAcquire in simple configs that lack a z-controller. This inludes certain scopes but also when running init file that only registers the camera, e.g. for camera calibration etc.

During acquisitions there are attempts to write stack metadata which fail as a z-control is not available.

To Reproduce
Steps to reproduce the behavior:

  1. Run PYMEAcquire with simple init file that lacks z-controller (e.g. no piezo)
  2. Start acquisition.
  3. Non-fatal but nevertheless potentially confusing error is produced.
  4. Error shown below:
(10.16080325929549, 'spoolController.StartSpooling', {'maxFrames': 500, 'stack': False}, 1609032592.9298954, 1.7976931348623157e+308), spoolController.StartSpooling
DEBUG:PYME.Acquire.SpoolController:Looking for C:\Users\cs463\PYMEData\cs463\2020_12_15\15_12_series_P.h5 on local machine

ERROR:PYME.Acquire.stackSettings:Error writing stack metadata
Traceback (most recent call last):
  File "c:\python-support\pyme-py3\PYME\Acquire\stackSettings.py", line 161, in ProvideStackMetadata
    mdh.setEntry('StackSettings.StartPos', self.GetStartPos())
  File "c:\python-support\pyme-py3\PYME\Acquire\stackSettings.py", line 93, in GetStartPos
    return self._CurPos() - (self.GetStepSize()*(self.GetSeqLength() - 1)*self.GetDirection()/2)
  File "c:\python-support\pyme-py3\PYME\Acquire\stackSettings.py", line 132, in _CurPos
    return self.scope.GetPos()[self.GetScanChannel()]
KeyError: 'z'
DEBUG:PYME.Acquire.Spooler:Disconnecting from frame source

Expected behavior
Gracefully bypass stack settings when no z-control available.

Platform (please complete the following information - or copy-paste from error dialog if shown):

  • OS: [e.g. Win10] all platforms
  • Python version: 2.7, 3.7
  • numpy version: various
  • wxpython version [if a UI bug]: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions