Package gda.scan
Interface IScanDataPoint
- All Known Implementing Classes:
ScanDataPoint
public interface IScanDataPoint
Interface for ScanDataPoint - the data for a single point in a scan.
These are created by Scan objects and distributed via the Command Server (Jython Server) to Data Writers and the UI.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataFromDetector(Detector detector) Deprecated, for removal: This API element is subject to removal in a future version.voidaddDetector(Detector det) Add a detector to the list of detectors this object holds data from.voidaddDetectorData(Object data, String[] format) Add a piece of data to this object.voidaddPositionFromScannable(Scannable scannable) Deprecated, for removal: This API element is subject to removal in a future version.useaddScannablePosition(Object, String[])insteadvoidaddScannable(Scannable scannable) Add a scannable to the list of scannables this object holds data on.voidaddScannablePosition(Object data, String[] format) Add a position to the array of positions.voidaddScannablesAndDetectors(List<Scannable> allScannables, List<Detector> allDetectors) Deprecated, for removal: This API element is subject to removal in a future version.this method is not used.voidaddScannableWithPosition(Scannable scannable, Object position, String[] format) Adds a Scannable with its current data(/position/value) and the format that the data should be presented in.Double[]Returns the values held by this ScanDataPoint of Scannables, Monitors and Detectors.intgetDetector(String name) Searches the detectors for one of a given name.Return the vector of detector data which this object is a carrier of.Double[]Just returns array of detector data.String[][]returns a list of expanded detector header string for each data point.Return the list of names of detectors which this object holds data from.The list of detectors this object refers to.booleanReturns a string whose elements are separated by a mixture of tabs and spaces so that the columns are aligned with the output frominvalid reference
#toString()getHeaderString(ScanDataPointFormatter dataPointFormatter) getNames()intintDouble[]Just returns array of positions.String[]int[]intgetScannable(String name) Searches the scannables for one of a given name.String[][]String[]booleanisDetector(String name) Searches the detectors for one of a given name.booleanisScannable(String name) Searches the scannables for one of a given name.voidsetCommand(String command) voidsetCurrentFilename(String currentFilename) voidsetCurrentPointNumber(int currentPointNumber) voidsetDetectorData(List<Object> detectorData) voidsetDetectorFormats(String[][] detectorFormats) voidsetDetectorHeader(String[] detectorHeader) voidsetHasChild(boolean hasChild) voidsetInstrument(String instrument) voidsetNumberOfChildScans(int numberOfChildScans) voidsetNumberOfPoints(int numberOfPoints) voidsetScanDimensions(int[] scanDimensions) voidsetScanIdentifier(int scanIdentifier) voidsetScannableFormats(String[][] scannableFormats) voidsetScannableHeader(String[] scannableHeader) voidsetScannablePositions(List<Object> scannablePositions) voidsetScanObjects(List<IScanObject> scanObjects) voidsetScanPlotSettings(ScanPlotSettings scanPlotSettings) voidsetStepIds(List<IScanStepId> stepIds) voidsetUniqueName(String uniqueName) Returns a string of the information held by this object delimited by the static variable.Returns a string whose elements are separated by a mixture of tabs and spaces so that the columns are aligned with the output from getHeaderString().toFormattedString(ScanDataPointFormatter dataPointFormatter)
-
Method Details
-
addScannablesAndDetectors
@Deprecated(since="9.33", forRemoval=true) void addScannablesAndDetectors(List<Scannable> allScannables, List<Detector> allDetectors) throws DeviceException Deprecated, for removal: This API element is subject to removal in a future version.this method is not used. It callsScannable.getPosition()on the scannables andDetector.readout()on the detectors, which arguably is not the job of a scan data point. Instead calladdScannable(Scannable)addScannablePosition(Object, String[]),addDetector(Detector)andaddDetectorData(Object, String[])(other methods are available.An alternative for populating this object. Can be used instead of repeated calls to addScannable,addScannablePosition,addDetector,addDetectorData.Note this makes calls to getPosition() in the scannables and readout() in the detectors.
- Parameters:
allScannables-allDetectors-- Throws:
DeviceException
-
addPositionFromScannable
@Deprecated(since="9.33", forRemoval=true) void addPositionFromScannable(Scannable scannable) throws DeviceException Deprecated, for removal: This API element is subject to removal in a future version.useaddScannablePosition(Object, String[])insteadGets a Scannables position and adds it to the data point. Does not add the Scannable itself.- Parameters:
scannable-- Throws:
DeviceException
-
addDataFromDetector
@Deprecated(since="9.33", forRemoval=true) void addDataFromDetector(Detector detector) throws DeviceException Deprecated, for removal: This API element is subject to removal in a future version.useaddDetectorData(Object, String[])insteadReads data from a detector and adds it to the point. Does not add the detector itself.- Parameters:
detector-- Throws:
DeviceException
-
addScannableWithPosition
Adds a Scannable with its current data(/position/value) and the format that the data should be presented in.- Parameters:
scannable-position-format-
-
addDetectorData
Add a piece of data to this object. Calls to this method must be made in the same order as calls to addDetector to associate the data with the detector.- Parameters:
data-
-
addScannablePosition
Add a position to the array of positions. Calls to this method must be made in the same order as calls to addScannable to associate the array of numbers with the scannable.It is recommended to call setScannables instead.
- Parameters:
data-
-
addDetector
Add a detector to the list of detectors this object holds data from. This stores the name in the detectorHeader array and detectorNames array. If it's a countertimer then it is stored in the boolean array. The contents of the detectorHeader and detectorNames arrays will be different if the detector is a countertimer.Note this does not readout the detector! Data must be added by using the addData method.
- Parameters:
det-
-
addScannable
Add a scannable to the list of scannables this object holds data on.Note that this does not read the current position of the scannable.
- Parameters:
scannable-
-
getCommand
String getCommand()- Returns:
- the scan command entered to run the scan creating these ScanDataPoints
-
getCurrentFilename
String getCurrentFilename()- Returns:
- the name of the data file being written
-
getCurrentPointNumber
int getCurrentPointNumber()- Returns:
- the current point number in the scan
-
getDetectorData
Return the vector of detector data which this object is a carrier of.- Returns:
- detector data
-
getAllValuesAsDoubles
Returns the values held by this ScanDataPoint of Scannables, Monitors and Detectors.- Returns:
- an array of Double of length getMonitorHeader().size() + getPositionHeader().size() + getDetectorHeader().size() if the conversion of a field to Double is not possible then the element of the array will be null
- Throws:
IllegalArgumentException- if the fields convert to too few valuesIndexOutOfBoundsException- if the fields convert to too many values
-
getDetectorDataAsDoubles
Double[] getDetectorDataAsDoubles()Just returns array of detector data.- Returns:
- all detector data.
-
getDetectorHeader
returns a list of expanded detector header string for each data point.- Returns:
- a list of expanded detector header string for each data point.
-
getDetectorNames
Return the list of names of detectors which this object holds data from.- Returns:
- list of detector names
-
getDetectors
The list of detectors this object refers to.- Returns:
- list of detectors this object refers to.
-
getHasChild
boolean getHasChild()- Returns:
trueif the current scan has a nested child scan,falseotherwise
-
getHeaderString
String getHeaderString()Returns a string whose elements are separated by a mixture of tabs and spaces so that the columns are aligned with the output frominvalid reference
#toString()- Returns:
- header string, which could be used in an ascii print out of all the scan points from the same scan
-
getHeaderString
- Parameters:
dataPointFormatter-- Returns:
- String - the header String formatted used the given Formatter object
-
getDelimitedHeaderString
String getDelimitedHeaderString()- Returns:
- the header with each element separated by a tab
-
getInstrument
String getInstrument()- Returns:
- the beamline/instrument running the scan
-
getNames
- Returns:
- list of scannable names
-
getNumberOfChildScans
int getNumberOfChildScans()- Returns:
- number of nested inner (child) scans
-
getNumberOfPoints
int getNumberOfPoints()- Returns:
- number of points in this scan
-
getPositionHeader
- Returns:
- the part of the header from the Scannables (not Detectors) as a list of strings
-
getPositions
- Returns:
- the part of the data from the Scannables (not Detectors) as a list of objects
-
getScanIdentifier
int getScanIdentifier()- Returns:
- unique ID of the scan
-
getScannableNames
- Returns:
- list of the names of the Scannables in the scan
-
getPositionsAsDoubles
Double[] getPositionsAsDoubles()Just returns array of positions. Strings will be an empty element.- Returns:
- all scannable positions.
-
getPositionsAsFormattedStrings
String[] getPositionsAsFormattedStrings()- Returns:
- all Scannable positions as strings using the given format
-
getScannables
-
getScanPlotSettings
ScanPlotSettings getScanPlotSettings() -
setScanPlotSettings
-
getScanDimensions
int[] getScanDimensions()- Returns:
- the dimensions of the nest of scans
-
setScanDimensions
void setScanDimensions(int[] scanDimensions) -
toFormattedString
String toFormattedString()Returns a string whose elements are separated by a mixture of tabs and spaces so that the columns are aligned with the output from getHeaderString().To be used to create an ascii version of the data held by this object for printing to terminals or to ascii files.
-
toFormattedString
-
toDelimitedString
String toDelimitedString()Returns a string of the information held by this object delimited by the static variable.- Returns:
- this point as a delimited string
-
getStepIds
List<IScanStepId> getStepIds() -
setStepIds
-
getUniqueName
String getUniqueName()- Returns:
- the unique identifier for the scan.
-
setUniqueName
-
setCommand
-
setCurrentFilename
-
setCurrentPointNumber
void setCurrentPointNumber(int currentPointNumber) -
setHasChild
void setHasChild(boolean hasChild) -
setInstrument
-
setNumberOfChildScans
void setNumberOfChildScans(int numberOfChildScans) -
setNumberOfPoints
void setNumberOfPoints(int numberOfPoints) -
setScanIdentifier
void setScanIdentifier(int scanIdentifier) -
getScannableFormats
String[][] getScannableFormats() -
setScannableFormats
-
setDetectorHeader
-
getScannableHeader
String[] getScannableHeader() -
setScannableHeader
-
getScannablePositions
-
setScannablePositions
-
setDetectorData
-
getScanObjects
List<IScanObject> getScanObjects() -
setScanObjects
-
getDetectorFormats
String[][] getDetectorFormats() -
setDetectorFormats
-
getScannable
Searches the scannables for one of a given name. Used to avoid searches being in many places.- Parameters:
name-- Returns:
- the scannable with the given name in this point if it exists, otherwise
null
-
isScannable
Searches the scannables for one of a given name. Works for scannables where name is declared and the actual scannable is not sent over.- Parameters:
name-- Returns:
trueif this point contains a scannable with this name,falseotherwise
-
getDetector
Searches the detectors for one of a given name. Used to avoid searches being in many places.- Parameters:
name-- Returns:
- the detector with the given name in this point if it exists, otherwise
null
-
isDetector
Searches the detectors for one of a given name. Works for detectors where name is declared and the actual detector is not sent over.- Parameters:
name-- Returns:
trueif this point contains a detector with the given name,falseotherwise
-
getScanInformation
ScanInformation getScanInformation()
-
addDetectorData(Object, String[])instead