Package org.eclipse.scanning.points
Class CompoundGenerator
java.lang.Object
org.eclipse.scanning.api.points.AbstractGenerator<CompoundModel>
org.eclipse.scanning.points.AbstractScanPointGenerator<CompoundModel>
org.eclipse.scanning.points.AbstractMultiGenerator<CompoundModel>
org.eclipse.scanning.points.CompoundGenerator
- All Implemented Interfaces:
Iterable<IPosition>,IModelProvider<CompoundModel>,IPointGenerator<CompoundModel>,PySerializable
CompoundGenerators (analogously to their Python equivalents) handle not only compounding scans within one another,
but additionally mutators, regions of interests, the duration of a point within a scan.
Compounding a scan means repeating every point of a scan for each point of another:
gen1.createPoints() = [("x": 1), ("x" :3), ("x": 5)]
-> a scan visiting points in a scannable axis "x", starting at 0, stopping at 5 and stepping 2.
gen2.createPoints() = [("y": 0.6), ("y": 0.9),("y": 1.2)}
-> and a scan visiting points in axis "y" from 0.6 to 1.2 in steps of 0.3
cgen = new CompoundGenerator(gen1, gen2)
cgen.createPoints() = [("x" : 1, "y": 0.6), ("x": 1, "y":0.9), ("x":1, "y":1.2), ("x":2, "y": 0.3), ...]
Compounding may either be performed on PPointGenerators or GDA ScanPathModels through constructing a CompoundModel
Compounding may be performed an arbitrary number of levels deep, although no two models or generators may share axes
-
Field Summary
Fields inherited from class org.eclipse.scanning.points.AbstractMultiGenerator
generators, serviceFields inherited from class org.eclipse.scanning.points.AbstractScanPointGenerator
pointGeneratorFields inherited from class org.eclipse.scanning.api.points.AbstractGenerator
model -
Constructor Summary
ConstructorsConstructorDescriptionCompoundGenerator(List<IPointGenerator<? extends IScanPointGeneratorModel>> generators, IPointGeneratorService pgs) CompoundGenerator(CompoundModel model, IPointGeneratorService pgs) -
Method Summary
Modifier and TypeMethodDescriptionprotected PPointGeneratorstatic org.python.core.PyObject[]getExcluders(Collection<ScanRegion> regions) Creates an array of python objects representing the excluders Each Excluder is made of all IROIs in shared axes with each otherprotected JythonObjectFactory<PPointGenerator> Methods inherited from class org.eclipse.scanning.points.AbstractMultiGenerator
createPointGenerators, getGenerators, initGeneratorsMethods inherited from class org.eclipse.scanning.points.AbstractScanPointGenerator
createSpgCompoundGenerator, createWrappingCompoundGenerator, finalBounds, getDimensionNames, getNames, getPointGenerator, getRank, getShape, initialBounds, iterator, setModel, size, toDict, validateModelMethods 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
-
Constructor Details
-
CompoundGenerator
public CompoundGenerator(List<IPointGenerator<? extends IScanPointGeneratorModel>> generators, IPointGeneratorService pgs) throws GeneratorException - Parameters:
generators- an array of IPointGenerator[s], which are compounded together to produce a new PPointGenerator represented by this generator's CompoundModel. The rightmost/last generator is the "fastest" to change, with every point that it produces being repeated for every point of its leftwards neighbour, itself repeated for every point of its neighbour until the outermost generator.- Throws:
GeneratorException- when validation throws a ModelValidationException for the CompoundModel constructed from the IPointGenerators- e.g. when generators contains nulls, when more than one generator acts on an axis, or when something causes the call to the Python CompoundGenerator to fail. If any of the generators passed to this constructor areNoModelGenerator, the CompoundModel will be an incomplete representation of the scan, and any GeneratorException thrown may have less complete information.
-
CompoundGenerator
-
-
Method Details
-
createPythonPointGenerator
- Overrides:
createPythonPointGeneratorin classAbstractMultiGenerator<CompoundModel>
-
getExcluders
Creates an array of python objects representing the excluders Each Excluder is made of all IROIs in shared axes with each other- Parameters:
regions-- Returns:
-
getFactory
- Specified by:
getFactoryin classAbstractMultiGenerator<CompoundModel>
-