Lissajous Generator¶
-
class
scanpointgenerator.
LissajousGenerator
(names, units, box, num_lobes, num_points=None)[source]¶ Generate the points of a Lissajous curve
Parameters: - names (list(str) – The scannable names e.g. [“x”, “y”]
- units (str) – The scannable units e.g. “mm”
- box (dict) – Dictionary of centre, width and height representing box to fill with points
- num_lobes (int) – Number of x-direction lobes for curve; will have num_lobes+1 y-direction lobes
- num_points (int) – The number of points to fill the Lissajous curve. Default is 250 * num_lobes
-
classmethod
from_dict
(d)[source]¶ Create a LissajousGenerator instance from a serialised dictionary
Parameters: d (dict) – Dictionary of attributes Returns: New LissajousGenerator instance Return type: LissajousGenerator
Examples¶
This example defines motors “x” and “y” with engineering units “mm” which will be scanned over a 3x4 lobe Lissajous curve with filling a 1x1mm rectangle.
from scanpointgenerator import LissajousGenerator, plot_generator
box = dict(centre=[0.0, 0.0], width=1.0, height=1.0)
gen = LissajousGenerator(['x', 'y'], "mm", box=box, num_lobes=3, num_points=50)
plot_generator(gen)
The number of points has been lowered from the default to make the plot more visible. The following plot is for 10x11 lobes with the default number of points.
from scanpointgenerator import LissajousGenerator, plot_generator
box = dict(centre=[0.0, 0.0], width=1.0, height=1.0)
gen = LissajousGenerator(['x', 'y'], "mm", box=box, num_lobes=20)
plot_generator(gen, show_indexes=False)