Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.1 KB

compoundgenerator.rst

File metadata and controls

42 lines (28 loc) · 1.1 KB

Compound Generator

.. module:: scanpointgenerator

.. autoclass:: CompoundGenerator
    :members:


Raster Scan Example

This scan will create an outer "y" line scan with 4 points, then nest an "x" line scan inside it with 5 points.

.. plot::
    :include-source:

    from scanpointgenerator import LineGenerator, CompoundGenerator, plot_generator

    xs = LineGenerator("x", "mm", 0.0, 0.5, 5, alternate_direction=False)
    ys = LineGenerator("y", "mm", 0.0, 0.5, 4)
    gen = CompoundGenerator([ys, xs], [], [])
    plot_generator(gen)


Snake Scan Example

This scan will create an outer "y" line scan with 4 points, then nest an "x" line scan inside it with 5 points. On every second row, the "x" line scan will be run in reverse to give a snake scan.

.. plot::
    :include-source:

    from scanpointgenerator import LineGenerator, CompoundGenerator, plot_generator

    xs = LineGenerator("x", "mm", 0.0, 0.5, 5, alternate_direction=True)
    ys = LineGenerator("y", "mm", 0.0, 0.5, 4)
    gen = CompoundGenerator([ys, xs], [], [])
    plot_generator(gen)