prysm.segmented

Tools for working with segmented systems.

class prysm.segmented.Hex(q, r, s)

Bases: tuple

count()

Return number of occurrences of value.

index()

Return first index of value.

Raises ValueError if the value is not present.

q

Alias for field number 0

r

Alias for field number 1

s

Alias for field number 2

prysm.segmented.add_hex(h1, h2)

Add two hex coordinates together.

prysm.segmented.sub_hex(h1, h2)

Subtract two hex coordinates.

prysm.segmented.mul_hex(h1, h2)

Multiply two hex coordinates.

prysm.segmented.hex_dir(i)

Hex direction associated with a given integer, wrapped at 6.

prysm.segmented.hex_neighbor(h, direction)

Neighboring hex in a given direction.

prysm.segmented.hex_to_xy(h, radius, rot=90)

Convert hexagon coordinate to (x,y), if all hexagons have a given radius and rotation.

prysm.segmented.scale_hex(h, k)

Scale a hex coordinate by some constant factor.

prysm.segmented.hex_ring(radius)

Compute all hex coordinates in a given ring.

class prysm.segmented.CompositeHexagonalAperture(x, y, rings, segment_diameter, segment_separation, segment_angle=90, exclude=())

Bases: object

An aperture composed of several hexagonal segments.