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 Details

  • Constructor Details

    • AbstractScanPointGenerator

      protected AbstractScanPointGenerator(T model)
    • AbstractScanPointGenerator

      protected AbstractScanPointGenerator()
  • Method Details

    • setModel

      @Deprecated(since="GDA 9.16") public void setModel(T model) throws GeneratorException
      Deprecated.
      To allow Models to be validated prior to the iterator ever being called (to allow ModelValidationException to be checked, Generators are now created once with their model. IPointGeneratorService.createGenerator(model) should be used instead.
      Specified by:
      setModel in interface IModelProvider<T extends AbstractPointsModel>
      Parameters:
      model -
      Throws:
      GeneratorException
    • getPointGenerator

      public PPointGenerator getPointGenerator()
    • createPythonPointGenerator

      protected abstract PPointGenerator createPythonPointGenerator()
    • validateModel

      protected void validateModel()
      Specified by:
      validateModel in class AbstractGenerator<T extends AbstractPointsModel>
    • size

      public int size()
      Description copied from interface: IPointGenerator
      The size of the points iterator. This call will be as fast as possible but can be as slow as iterating all points.
      Specified by:
      size in interface IPointGenerator<T extends AbstractPointsModel>
      Returns:
    • getShape

      public int[] getShape()
      Description copied from interface: IPointGenerator
      The shape of the points iterator.
      Specified by:
      getShape in interface IPointGenerator<T extends AbstractPointsModel>
      Returns:
    • getRank

      public int getRank()
      Description copied from interface: IPointGenerator
      The rank of the points iterator.
      Specified by:
      getRank in interface IPointGenerator<T extends AbstractPointsModel>
      Returns:
    • iterator

      public Iterator<IPosition> iterator()
      Description copied from interface: IPointGenerator
      Iterator over the points, fast because does not evaluate all points straight away, does it on the fly.
      Specified by:
      iterator in interface IPointGenerator<T extends AbstractPointsModel>
      Specified by:
      iterator in interface Iterable<T extends AbstractPointsModel>
      Returns:
    • getNames

      public List<String> getNames()
      Description copied from interface: IPointGenerator
      Returns the names of the scalars in the positions generated by this point generator.
      Specified by:
      getNames in interface IPointGenerator<T extends AbstractPointsModel>
      Returns:
      the names of the scalars
    • getDimensionNames

      public List<List<String>> getDimensionNames()
      Specified by:
      getDimensionNames in interface IPointGenerator<T extends AbstractPointsModel>
    • toDict

      public org.python.core.PyDictionary toDict()
      Specified by:
      toDict in interface PySerializable
    • finalBounds

      public final IPosition finalBounds()
    • initialBounds

      public final IPosition 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 it
      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
    • 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 it
      regions - 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 unexpectedly
      axes - 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