Created initial general documentation

This commit is contained in:
Joel Collins 2018-11-16 15:46:19 +00:00
parent dd7a3ff2e5
commit ea10cf1ce9
16 changed files with 607 additions and 73 deletions

View file

@ -1,4 +1,8 @@
# -*- coding: utf-8 -*-
"""
Defines a microscope object, binding a camera and stage with basic functionality.
"""
import numpy as np
from openflexure_stage import OpenFlexureStage
@ -6,12 +10,20 @@ from .camera.pi import StreamingCamera
class Microscope(object):
"""
A basic microscope object.
The camera and stage should already be initialised, and passed as arguments.
Args:
camera (:py:class:`openflexure_microscope.camera.pi.StreamingCamera`): camera object
microscope (:py:class:`openflexure_stage.stage.OpenFlexureStage`): stage object
"""
def __init__(self, camera: StreamingCamera, stage: OpenFlexureStage):
"""Create the microscope object. The camera and stage should already be initialised."""
print("Assigning camera")
self.camera = camera
self.camera = camera #: :py:class:`openflexure_microscope.camera.pi.StreamingCamera`: Picamera object
print("Assigning stage")
self.stage = stage
self.stage = stage #: :py:class:`openflexure_stage.stage.OpenFlexureStage`: OpenFlexure stage object
self.stage.backlash = np.zeros(3, dtype=np.int)
def __enter__(self):
@ -30,6 +42,11 @@ class Microscope(object):
# Create unified state
@property
def state(self):
"""Dictionary of the basic microscope state.
Return:
dict: Dictionary containing position data, and :py:attr:`openflexure_microscope.camera.base.BaseCamera.state`
"""
state = {}
# Add stage position