Package org.eclipse.scanning.api.points
Class StaticPosition
java.lang.Object
org.eclipse.scanning.api.points.AbstractPosition
org.eclipse.scanning.api.points.StaticPosition
- All Implemented Interfaces:
Serializable,IPosition
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:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a composite position with the values of this position and the values of the passed in position.The value of a named position.This method makes dimensionNames if they are null.intgetIndex(int dimension) Get the data index of this point for a given scan dimension.intGet the index of the data for instance in a scan of temperature from 290 to 300 step 1, the indices will be 0-10.getNames()The names of all the scalars set for this position.intMost scans have rank 1 event though they move more motors line a line scan or a spiral scan.intsize()The number of named scalars in this positionMethods inherited from class org.eclipse.scanning.api.points.AbstractPosition
equals, equals, getDimensionNames, getExposureTime, getStepIndex, hashCode, setDimensionNames, setExposureTime, setStepIndex, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.scanning.api.points.IPosition
getDouble, getIndices, getValue, getValues
-
Constructor Details
-
StaticPosition
public StaticPosition() -
StaticPosition
public StaticPosition(int index)
-
-
Method Details
-
size
public int size()Description copied from interface:IPositionThe number of named scalars in this position- Returns:
- number of scalars
-
getNames
Description copied from interface:IPositionThe names of all the scalars set for this position. For instance 'x' and 'y' for a map or 'Temperature' Note to implementers: should never returnnull- Returns:
- name of scalars
-
get
Description copied from interface:IPositionThe value of a named position. For instanceget("X")to return the value of the X IScannable double.- Parameters:
name-- Returns:
- value for the given axis name
-
getIndex
Description copied from interface:IPositionGet 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
Description copied from class:AbstractPositionThis 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:
getDimensionNamesin interfaceIPosition- Overrides:
getDimensionNamesin classAbstractPosition- 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:IPositionMost 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:
getScanRankin interfaceIPosition- Overrides:
getScanRankin classAbstractPosition- Returns:
- scan rank
-
getIndex
public int getIndex(int dimension) Description copied from interface:IPositionGet the data index of this point for a given scan dimension. For instance- Specified by:
getIndexin interfaceIPosition- Overrides:
getIndexin classAbstractPosition- Parameters:
dimension-- Returns:
- data index for the given dimension index
-
compound
Description copied from interface:IPositionCreates 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:
compoundin interfaceIPosition- Overrides:
compoundin classAbstractPosition- Parameters:
parent-- Returns:
- the compounded position
-