Repeated Scan with Bidirectional Segments¶
A repeated scan that takes advantage of bidirectional segments for better scan efficiency is obtained using RepeatedPattern.
It can be used directly for a custom scan or access conveniently through RepeatedRasterScan or RepeatedRadialScan.
The sample below uses RepeatedRasterScan to illustrate a bidirectional repeated scan.
Import and instantiate
RepeatedRasterScanConfig.from vortex.scan import RepeatedRasterScanConfig, RepeatedRasterScan cfg = RepeatedRasterScanConfig()
Configure bidirectional segments.
cfg.bidirectional_segments = True
Each segment within a bidirectional scan normally has a fixed direction. If
repeat_periodis odd, one segment may alternate directions.Configure repetition options using the fields inherited from
RepeatedPattern.repeat_countdetermines the number of repeats for each segment whereasrepeat_perioddetermines the number of segments between repeats.cfg.repeat_count = 2 cfg.repeat_period = 4
This configuration will repeat every segment twice (
repeat_count) in groups of four (repeat_period). Each group of four will complete its repetitions before the next group of four starts.Initialize the
RepeatedRasterScanas usual.scan = RepeatedRasterScan() scan.initialize(cfg)