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 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 calls Scannable.getPosition() on the scannables and Detector.readout() on the detectors, which arguably is not the job of a scan data point. Instead call addScannable(Scannable) addScannablePosition(Object, String[]), addDetector(Detector) and addDetectorData(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.
      Gets 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.
      Reads data from a detector and adds it to the point. Does not add the detector itself.
      Parameters:
      detector -
      Throws:
      DeviceException
    • addScannableWithPosition

      void addScannableWithPosition(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.
      Parameters:
      scannable -
      position -
      format -
    • addDetectorData

      void addDetectorData(Object data, String[] format)
      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

      void addScannablePosition(Object data, String[] format)
      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

      void addDetector(Detector det)
      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

      void addScannable(Scannable scannable)
      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

      List<Object> getDetectorData()
      Return the vector of detector data which this object is a carrier of.
      Returns:
      detector data
    • getAllValuesAsDoubles

      Double[] getAllValuesAsDoubles() throws IllegalArgumentException, IndexOutOfBoundsException
      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 values
      IndexOutOfBoundsException - if the fields convert to too many values
    • getDetectorDataAsDoubles

      Double[] getDetectorDataAsDoubles()
      Just returns array of detector data.
      Returns:
      all detector data.
    • getDetectorHeader

      List<String> 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

      List<String> getDetectorNames()
      Return the list of names of detectors which this object holds data from.
      Returns:
      list of detector names
    • getDetectors

      List<Detector> getDetectors()
      The list of detectors this object refers to.
      Returns:
      list of detectors this object refers to.
    • getHasChild

      boolean getHasChild()
      Returns:
      true if the current scan has a nested child scan, false otherwise
    • 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 from
      invalid reference
      #toString()
      Returns:
      header string, which could be used in an ascii print out of all the scan points from the same scan
    • getHeaderString

      String getHeaderString(ScanDataPointFormatter dataPointFormatter)
      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

      List<String> 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

      List<String> getPositionHeader()
      Returns:
      the part of the header from the Scannables (not Detectors) as a list of strings
    • getPositions

      List<Object> 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

      List<String> 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

      List<Scannable> getScannables()
    • getScanPlotSettings

      ScanPlotSettings getScanPlotSettings()
    • setScanPlotSettings

      void setScanPlotSettings(ScanPlotSettings scanPlotSettings)
    • 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

      String toFormattedString(ScanDataPointFormatter dataPointFormatter)
    • 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

      void setStepIds(List<IScanStepId> stepIds)
    • getUniqueName

      String getUniqueName()
      Returns:
      the unique identifier for the scan.
    • setUniqueName

      void setUniqueName(String uniqueName)
    • setCommand

      void setCommand(String command)
    • setCurrentFilename

      void setCurrentFilename(String currentFilename)
    • setCurrentPointNumber

      void setCurrentPointNumber(int currentPointNumber)
    • setHasChild

      void setHasChild(boolean hasChild)
    • setInstrument

      void setInstrument(String instrument)
    • setNumberOfChildScans

      void setNumberOfChildScans(int numberOfChildScans)
    • setNumberOfPoints

      void setNumberOfPoints(int numberOfPoints)
    • setScanIdentifier

      void setScanIdentifier(int scanIdentifier)
    • getScannableFormats

      String[][] getScannableFormats()
    • setScannableFormats

      void setScannableFormats(String[][] scannableFormats)
    • setDetectorHeader

      void setDetectorHeader(String[] detectorHeader)
    • getScannableHeader

      String[] getScannableHeader()
    • setScannableHeader

      void setScannableHeader(String[] scannableHeader)
    • getScannablePositions

      List<Object> getScannablePositions()
    • setScannablePositions

      void setScannablePositions(List<Object> scannablePositions)
    • setDetectorData

      void setDetectorData(List<Object> detectorData)
    • getScanObjects

      List<IScanObject> getScanObjects()
    • setScanObjects

      void setScanObjects(List<IScanObject> scanObjects)
    • getDetectorFormats

      String[][] getDetectorFormats()
    • setDetectorFormats

      void setDetectorFormats(String[][] detectorFormats)
    • getScannable

      Scannable getScannable(String name)
      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

      boolean isScannable(String name)
      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:
      true if this point contains a scannable with this name, false otherwise
    • getDetector

      Detector getDetector(String name)
      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

      boolean isDetector(String name)
      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:
      true if this point contains a detector with the given name, false otherwise
    • getScanInformation

      ScanInformation getScanInformation()