pylabrobot.resources.Plate.center#

Plate.center(x: bool = True, y: bool = True, z: bool = False) Coordinate#

Get the center of this resource.

Parameters:
  • x (bool) – If True, the x-coordinate will be the center, otherwise it will be 0.

  • y (bool) – If True, the y-coordinate will be the center, otherwise it will be 0.

  • z (bool) – If True, the z-coordinate will be the center, otherwise it will be 0.

Return type:

Coordinate

Examples

Get the center of a resource in the xy plane:

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

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

Get the center of a resource with only the x-coordinate:

>>> r = Resource("resource", size_x=12, size_y=12, size_z=12)
>>> r.center(x=True, y=False, z=False)

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

Get the center of a resource in the x, y, and z directions:

>>> r = Resource("resource", size_x=12, size_y=12, size_z=12)
>>> r.center(x=True, y=True, z=True)

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