Class StaticPosition

java.lang.Object
org.eclipse.scanning.api.points.AbstractPosition
org.eclipse.scanning.api.points.StaticPosition
All Implemented Interfaces:
Serializable, IPosition

public class StaticPosition extends AbstractPosition
A position with no value. Can be used in a scan to expose detectors where we do not wish to move any scannables.
See Also:
  • Constructor Details

    • StaticPosition

      public StaticPosition()
    • StaticPosition

      public StaticPosition(int index)
  • Method Details

    • size

      public int size()
      Description copied from interface: IPosition
      The number of named scalars in this position
      Returns:
      number of scalars
    • getNames

      public List<String> getNames()
      Description copied from interface: IPosition
      The names of all the scalars set for this position. For instance 'x' and 'y' for a map or 'Temperature' Note to implementers: should never return null
      Returns:
      name of scalars
    • get

      public Object get(String name)
      Description copied from interface: IPosition
      The value of a named position. For instance get("X") to return the value of the X IScannable double.
      Parameters:
      name -
      Returns:
      value for the given axis name
    • getIndex

      public int getIndex(String name)
      Description copied from interface: IPosition
      Get the index of the data for instance in a scan of temperature from 290 to 300 step 1, the indices will be 0-10. If one dimension has more than one motor with it, for instance x and y in a line scan, both getIndex("x") and getIndex("y") return the same value.
      Returns:
      data index for given axis name
    • getDimensionNames

      public List<List<String>> getDimensionNames()
      Description copied from class: AbstractPosition
      This method makes dimensionNames if they are null. It must be synchronized because getDimensionNames() is called within the thread pool, for instance when neXus writing positions. Quite a lot of tests were intermittently failing the tests because of this issue. Be careful when creating member data in this class that things are thread safe.
      Specified by:
      getDimensionNames in interface IPosition
      Overrides:
      getDimensionNames in class AbstractPosition
      Returns:
      dimensionNames- a List with an entry for each dimension, where each entry is a Set of the axes in that dimension
    • getScanRank

      public int getScanRank()
      Description copied from interface: IPosition
      Most scans have rank 1 event though they move more motors line a line scan or a spiral scan. As scans are aggregated these scan dimensions sum together. Some scans start out as having two dimensions like a grid or raster scan.
      Specified by:
      getScanRank in interface IPosition
      Overrides:
      getScanRank in class AbstractPosition
      Returns:
      scan rank
    • getIndex

      public int getIndex(int dimension)
      Description copied from interface: IPosition
      Get the data index of this point for a given scan dimension. For instance
      Specified by:
      getIndex in interface IPosition
      Overrides:
      getIndex in class AbstractPosition
      Parameters:
      dimension -
      Returns:
      data index for the given dimension index
    • compound

      public IPosition compound(IPosition parent)
      Description copied from interface: IPosition
      Creates a composite position with the values of this position and the values of the passed in position. The passed in position is assumed to be the parent in the scan.

      NOTE The scan names are not calculated on the call to compound because maintaining the list of names in each dimension is inefficient to calculate for each point (they do not change). Instead the names are created once and set into the position using setDimensionNames(...) available on abstract position.

      Specified by:
      compound in interface IPosition
      Overrides:
      compound in class AbstractPosition
      Parameters:
      parent -
      Returns:
      the compounded position