volumes - 1D zones#

Here we implement 3D zones, namely Box

from atomsmltr.environment.zones import Box

pos_box = Box(
    xmin=-10,
    xmax=10,
    ymin=0,
    ymax=5,
    zmin=-8,
    zmax=100,
    target="position",
    action="tag",
    tag="position box",
)
class atomsmltr.environment.zones.volumes.Box(xmin: float, xmax: float, ymin: float, ymax: float, zmin: float, zmax: float, target: str = 'position', action: str = 'stop', tag: str = None, in_tag: str = None, out_tag: str = None)[source]#

Bases: Zone

A 3D box with cartesian coordinates

Parameters:
  • xmin (float) – minimum value for x

  • xmax (float) – maximum value for x

  • ymin (float) – minimum value for y

  • ymax (float) – maximum value for y

  • zmin (float) – minimum value for z

  • zmax (float) – maximum value for z

  • target (str, optional) – the target for the zone, can be “position” or “speed”, by default “position”

  • action (str, optional) – the action associated to the zone. Currently only “stop” is implemented, by default “stop”

  • tag (str, optional) – the zone tag

  • in_tag (str, optional) – tag for an object inside the zone, by default None

  • out_tag (str, optional) – tag for an object inside the zone, by default None

Example

from atomsmltr.environment.zones import Box

pos_box = Box(
    xmin=-10,
    xmax=10,
    ymin=0,
    ymax=5,
    zmin=-8,
    zmax=100,
    target="position",
    action="tag",
    tag="position box",
)
gen_infostring_obj()[source]#

Generates an info string object

property type#

a description of the object type

Type:

str

property xmax#

the maximum value for x

Type:

float

property xmin#

the minimum value for x

Type:

float

property ymax#

the maximum value for y

Type:

float

property ymin#

the minimum value for y

Type:

float

property zmax#

the maximum value for z

Type:

float

property zmin#

the minimum value for z

Type:

float

class atomsmltr.environment.zones.volumes.Cylinder(origin: ndarray = (0, 0, 0), direction: ndarray = (1, 0, 0), radius: float = 1.0, target='position', action='stop', tag=None, in_tag: str = None, out_tag: str = None)[source]#

Bases: Zone

A cylinder zone

Parameters:
  • origin (array, shape (3), optional) – the ‘center’ of the cylinder, i.e. a point on its axis, by default (0, 0, 0)

  • direction (array, shape (3), optional) – a vector along the axis of the cylinder, by default (1, 0, 0)

  • radius (float, optional) – the cylinder radius, in m or m/s, by default 1.0

  • target (str, optional) – the target for the zone, can be “position” or “speed”, by default “position”

  • action (str, optional) – the action associated to the zone. Currently only “stop” is implemented, by default “stop”

  • tag (str, optional) – the zone tag

  • in_tag (str, optional) – tag for an object inside the zone, by default None

  • out_tag (str, optional) – tag for an object inside the zone, by default None

property direction: ndarray#

cylinder axis direction

Type:

array, shape (3)

gen_infostring_obj()[source]#

Generates an info string object

property origin: ndarray#

cylinder ‘center’

Type:

array, shape (3)

property power: float#

cylinder radius (m) or (m/s)

Type:

float

property type#

a description of the object type

Type:

str