Spiral Generator

class scanpointgenerator.SpiralGenerator(names, units, centre, radius, scale=1.0, alternate_direction=False)[source]

Generate the points of an Archimedean spiral

Parameters:
  • names (list(str) – The scannable names e.g. [“x”, “y”]
  • units (str) – The scannable units e.g. “mm”
  • centre (list) – List of two coordinates of centre point of spiral
  • radius (float) – Radius of spiral
  • scale (float) – Rate at which spiral expands; higher scale gives fewer points for same radius
  • alternate_direction (bool) – Specifier to reverse direction if generator is nested
to_dict()[source]

Convert object attributes into a dictionary

classmethod from_dict(d)[source]

Create a SpiralGenerator instance from a serialised dictionary

Parameters:d (dict) – Dictionary of attributes
Returns:New SpiralGenerator instance
Return type:SpiralGenerator

Examples

This example defines motors “x” and “y” with engineering units “mm” which will be scanned in a spiral filling a circle of radius 5mm.

from scanpointgenerator import SpiralGenerator, plot_generator

gen = SpiralGenerator(["x", "y"], "mm", [0.0, 0.0], 5.0)
plot_generator(gen)

(Source code)

In this example the spiral is scaled to be more sparse.

from scanpointgenerator import SpiralGenerator, plot_generator

gen = SpiralGenerator(["x", "y"], "mm", [0.0, 0.0], 5.0, scale=2.0)
plot_generator(gen)

(Source code)