Package org.eclipse.scanning.points
Class AbstractScanPointGenerator<T extends AbstractPointsModel>
java.lang.Object
org.eclipse.scanning.api.points.AbstractGenerator<T>
org.eclipse.scanning.points.AbstractScanPointGenerator<T>
- All Implemented Interfaces:
Iterable<IPosition>,IModelProvider<T>,IPointGenerator<T>,PySerializable
- Direct Known Subclasses:
AbstractLineGenerator,AbstractMultiGenerator,AxialArrayGenerator,AxialCollatedStepGenerator,NoModelGenerator,TwoAxisGridPointsGenerator,TwoAxisGridPointsRandomOffsetGenerator,TwoAxisLissajousGenerator,TwoAxisPointSingleGenerator,TwoAxisPtychographyGenerator
public abstract class AbstractScanPointGenerator<T extends AbstractPointsModel>
extends AbstractGenerator<T>
implements PySerializable
Generator for models that use SPG python module. Python CompoundGenerators are wrapped in PPointGenerators.
Provide InitialBounds and FinalBounds for the use of ConsecutiveMultiModel, as both can only operate on
SPG generators.
-
Field Summary
FieldsFields inherited from class org.eclipse.scanning.api.points.AbstractGenerator
model -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract PPointGeneratorcreateSpgCompoundGenerator(PPointGenerator[] generators, List<IROI> regions, List<String> axes, org.python.core.PyObject[] mutators, double duration, boolean continuous) protected PPointGeneratorcreateWrappingCompoundGenerator(PPointGenerator generators, boolean continuous) A simplified call to create a CompoundGenerator without regions, mutators and with default values of duration and delayfinal IPositiongetNames()Returns the names of the scalars in the positions generated by this point generator.intgetRank()The rank of the points iterator.int[]getShape()The shape of the points iterator.final IPositioniterator()Iterator over the points, fast because does not evaluate all points straight away, does it on the fly.voidDeprecated.intsize()The size of the points iterator.org.python.core.PyDictionarytoDict()protected voidMethods inherited from class org.eclipse.scanning.api.points.AbstractGenerator
createPoints, equals, getModel, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.scanning.api.IModelProvider
updateModelMethods inherited from interface org.eclipse.scanning.api.points.IPointGenerator
getFirstPointMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
pointGenerator
-
-
Constructor Details
-
AbstractScanPointGenerator
-
AbstractScanPointGenerator
protected AbstractScanPointGenerator()
-
-
Method Details
-
setModel
Deprecated.To allow Models to be validated prior to the iterator ever being called (to allowModelValidationExceptionto be checked, Generators are now created once with their model. IPointGeneratorService.createGenerator(model) should be used instead.- Specified by:
setModelin interfaceIModelProvider<T extends AbstractPointsModel>- Parameters:
model-- Throws:
GeneratorException
-
getPointGenerator
-
createPythonPointGenerator
-
validateModel
protected void validateModel()- Specified by:
validateModelin classAbstractGenerator<T extends AbstractPointsModel>
-
size
public int size()Description copied from interface:IPointGeneratorThe size of the points iterator. This call will be as fast as possible but can be as slow as iterating all points.- Specified by:
sizein interfaceIPointGenerator<T extends AbstractPointsModel>- Returns:
-
getShape
public int[] getShape()Description copied from interface:IPointGeneratorThe shape of the points iterator.- Specified by:
getShapein interfaceIPointGenerator<T extends AbstractPointsModel>- Returns:
-
getRank
public int getRank()Description copied from interface:IPointGeneratorThe rank of the points iterator.- Specified by:
getRankin interfaceIPointGenerator<T extends AbstractPointsModel>- Returns:
-
iterator
Description copied from interface:IPointGeneratorIterator over the points, fast because does not evaluate all points straight away, does it on the fly.- Specified by:
iteratorin interfaceIPointGenerator<T extends AbstractPointsModel>- Specified by:
iteratorin interfaceIterable<T extends AbstractPointsModel>- Returns:
-
getNames
Description copied from interface:IPointGeneratorReturns the names of the scalars in the positions generated by this point generator.- Specified by:
getNamesin interfaceIPointGenerator<T extends AbstractPointsModel>- Returns:
- the names of the scalars
-
getDimensionNames
- Specified by:
getDimensionNamesin interfaceIPointGenerator<T extends AbstractPointsModel>
-
toDict
public org.python.core.PyDictionary toDict()- Specified by:
toDictin interfacePySerializable
-
finalBounds
-
initialBounds
-
createWrappingCompoundGenerator
protected PPointGenerator createWrappingCompoundGenerator(PPointGenerator generators, boolean continuous) A simplified call to create a CompoundGenerator without regions, mutators and with default values of duration and delay- Parameters:
generators- an array of at least 1 PPointGenerator, each being repeated for every point in the generator before itcontinuous- whether the innermost scan should be continuous if possible- non-Malcolm ('software') scans cannot be continuous. A Continuous scan passes through Bounds rather than Points- bounds are half a step either side of each point in the direction of scanning.- Returns:
- a PPointGenerator representing a [Jython] CompoundGenerator made of the above
-
createSpgCompoundGenerator
public PPointGenerator createSpgCompoundGenerator(PPointGenerator[] generators, List<IROI> regions, List<String> axes, org.python.core.PyObject[] mutators, double duration, boolean continuous) - Parameters:
generators- an array of at least 1 PPointGenerator, each being repeated for every point in the generator before itregions- a list of IROI regions of interest, any point produced that would be inside at least 1 IROI is included, otherwise they are removed. This occurs *before* Mutators are applied and therefore points in boundary regions may behave unexpectedlyaxes- list of axes names that IROIs should operate in: should always be either 0 or 2 long.mutators- an array of PyObject Mutators to apply to all points generated by the PPointGenerator this produces.duration- the length of time (in seconds) that each point in the scan should last for. -1 is variable and the default.continuous- whether the innermost scan should be continuous if possible- non-Malcolm ('software') scans cannot be continuous. A Continuous scan passes through Bounds rather than Points- bounds are half a step either side of each point in the direction of scanning.- Returns:
- a PPointGenerator representing a [Jython] CompoundGenerator made of the above
-