science_jubilee.tools.Camera#
Classes#
Functions#
|
Decorator to ensure that a tool cannot complete an action unless it is the |
Module Contents#
- class science_jubilee.tools.Camera.Well[source]#
A class representing a well of a labware.
Each Well is associated with a specific name, depth, total liquid volume, shape, diameter, x, y, and z dimension, y-dimension, as well as its coordinates and any applied offset
- Returns:
A
Wellobject with various information about the geometry of the well and its position in the labware- Return type:
- property x#
- Offsets the x-position of the each well with respect to the deck-slot coordinates
- Returns:
The x-coordinate of the well
- Return type:
- property y#
- Offsets the y-position of the each well with respect to the deck-slot coordinates
- Returns:
The y-coordinate of the well
- Return type:
- property z#
- Offsets the z-position of each well with respect to the deck-slot coordinates
- Returns:
The z-coordinate of the well
- Return type:
- apply_offset(offset: Tuple[float])[source]#
Allows the user to offset the coordinates of the well with respect to the deck-slot coordinates
- Parameters:
offset (Tuple[float]) – A tuple of floats with the new offset of the well
- property top_#
- Defines the top-most point of the well
- Returns:
The z-coordinate of the top of the well
- Return type:
- property bottom_#
- Defines the bottom-most point of the well
- Returns:
The z-coordinate of the bottom of the well
- Return type:
- bottom(z: float, check=False)[source]#
Allows the user to dinamically indicate a new Z location relative to the bottom of the well.
- Parameters:
z (float) – the distance in mm to offset the coordinates from the bottom of the well. Should be +
check (bool, optional) – the ‘z’ parameters can either be + or -. If negative, an assert error is raised to avoid collision with the labware. However, there might be instances of custom labware where the bottom of the well is purposely set as higher during the generation of its config .json file., defaults to False
- Returns:
A
Locationwhich contains information about the new coordinates generated and theWellobject- Return type:
Location
- top(z: float)[source]#
Allows the user to dinamically indicate a new Z location relative to the top of the well.
- __repr__()[source]#
Displayed representation of a
Wellobject indicating its name and its coordinates- Returns:
A string representation of the name and coordinates of a well
- Return type:
- science_jubilee.tools.Camera.requires_active_tool(func)[source]#
Decorator to ensure that a tool cannot complete an action unless it is the current active tool.
- class science_jubilee.tools.Camera.Camera(index, name)[source]#
Bases:
science_jubilee.tools.Tool.ToolA class representation of a Raspberry Pi camera.
- Parameters:
Tool (class:Tool) – The base tool class
- get_camera_indices()[source]#
Returns valid camera indices for use with OpenCV
- Returns:
A list of valid camera indices
- Return type:
- get_frame(resolution=[1200, 1200], uvc=False)[source]#
Take a picture and return the image. Compensates for lens distortion using camera calibration file.
- show_frame(frame, grid=False, save=False, save_path='fig.png')[source]#
Show a captured frame using matplotlib.
- video_stream(camera_index=0)[source]#
Start a video stream from the camera.
- Parameters:
camera_index (int, optional) – The camera index, defaults to 0
- image_wells(resolution=[1200, 1200], uvc=False, wells: science_jubilee.labware.Labware.Well = None)[source]#
Move to a number of wells to take and show images.
- get_well_image(resolution=[1200, 1200], uvc=False, well: science_jubilee.labware.Labware.Well = None)[source]#
Move to a single well to take a picture and return the frame.
- Parameters:
- Returns:
The captured frame
- Return type:
ndarray
- static _get_xyz(well: science_jubilee.labware.Labware.Well = None, location: Tuple[float] = None)[source]#
Get the (x,y,z) position of a well.
- Parameters:
- Raises:
ValueError – Must specify either a well or a location
- Returns:
The well location
- Return type: