pylabrobot.resources.PlateCarrier.centers#

PlateCarrier.centers(xn: int = 1, yn: int = 1, zn: int = 1) List[Coordinate]#

Get equally spaced points in the x, y, and z directions.

Parameters:
  • xn (int) – the number of points in the x direction.

  • yn (int) – the number of points in the y direction.

  • zn (int) – the number of points in the z direction.

Returns:

A grid of points in the x, y, and z directions.

Return type:

List[Coordinate]

Examples

Get the center of a resource:

>>> r = Resource("resource", size_x=12, size_y=12, size_z=12)
>>> r.centers()

Coordinate(x=6.0, y=6.0, z=6.0)

Get the center of a resource with 2 points in the x direction:

>>> r = Resource("resource", size_x=12, size_y=12, size_z=12)
>>> r.centers(xn=2)

[Coordinate(x=4.0, y=6.0, z=6.0), Coordinate(x=9.0, y=6.0, z=6.0)]

Get the center of a resource with 2 points in the x and y directions:

>>> r = Resource("resource", size_x=12, size_y=12, size_z=12)
>>> r.centers(xn=2, yn=2)
[Coordinate(x=4.0, y=4.0, z=6.0), Coordinate(x=8.0, y=4.0, z=6.0),
 Coordinate(x=4.0, y=8.0, z=6.0), Coordinate(x=8.0, y=8.0, z=6.0)]