Class NexusXmap

All Implemented Interfaces:
Detector, NexusDetector, Device, Scannable, XmapDetector, Configurable, Findable, gda.observable.IObservable, gda.observable.IObserver, Serializable, DetectorWithConfigurationFile
Direct Known Subclasses:
CallableXmap

public class NexusXmap extends XmapwithSlaveMode implements NexusDetector
Version of Xmap which returns its data in a format which works with the NexusFileWriter better than raw data
See Also:
  • Constructor Details

    • NexusXmap

      public NexusXmap()
  • Method Details

    • readout

      public NexusTreeProvider readout() throws DeviceException
      Description copied from interface: Detector
      Returns the latest data collected. The size of the Object returned must be consistent with the values returned by getDataDimensions and getExtraNames.

      If LocalProperties.GDA_SCAN_CONCURRENTSCAN_READOUT_CONCURRENTLY is true then motors may be moved while the detector readouts. The value returned must not be effected by any concurrent motor or shutter movements. See Detector.waitWhileBusy() and ConcurrentScan. Readout must block until the detector is ready to respond quickly to Detector.collectData() again.

      Specified by:
      readout in interface Detector
      Specified by:
      readout in interface NexusDetector
      Overrides:
      readout in class Xmap
      Returns:
      the data collected
      Throws:
      DeviceException
    • getPosition

      public Object getPosition() throws DeviceException
      Description copied from class: DetectorBase
      Returns the current position of the Scannable. Called by ConcurentScan at the end of the point. Reads an internal (hardware) position from rawGetPosition, converts this to an external (user) position and returns it. Also, if createsOwnFiles attempts to register the file with all FileRegistrars (primarily for data archiving). Note that this method will be called if the detector is triggered from a 'pos' command but not if the detector is triggered by the scan command (which ignores the detector's scannable interface).
      Specified by:
      getPosition in interface Scannable
      Overrides:
      getPosition in class DetectorBase
      Returns:
      Current position with an element for each input and extra field. null if their are no fields.
      Throws:
      DeviceException
      See Also:
    • loadConfigurationFromFile

      public void loadConfigurationFromFile() throws Exception
      Description copied from class: Xmap
      Call this method to ask the detector to load the current template XML file. If the detector was configured without a configFileName set, then nothing will happen.
      Overrides:
      loadConfigurationFromFile in class Xmap
      Throws:
      Exception
    • getExtraNames

      public String[] getExtraNames()
      Description copied from interface: Scannable
      Additional names for extra values that returned by getPosition().
      Specified by:
      getExtraNames in interface Scannable
      Overrides:
      getExtraNames in class ScannableBase
      Returns:
      array of names of the extra elements if the array returned by getPosition is larger than the array required by moveTo
    • getOutputFormat

      public String[] getOutputFormat()
      Description copied from interface: Scannable
      Returns an array of strings which are the format strings to use when pretty printing parts of the output
      Specified by:
      getOutputFormat in interface Scannable
      Overrides:
      getOutputFormat in class ScannableBase
      Returns:
      string array
    • getDataDimensions

      public int[] getDataDimensions() throws DeviceException
      Description copied from class: DetectorBase
      Default which should be overridden by subclasses.
      Specified by:
      getDataDimensions in interface Detector
      Overrides:
      getDataDimensions in class Xmap
      Returns:
      the dimensions of the data object returned by the Detector.readout() method
      Throws:
      DeviceException
      See Also:
    • setSumAllElementData

      public void setSumAllElementData(boolean sumAllElementData)
    • isSumAllElementData

      public boolean isSumAllElementData()
    • isCaclulateUnifiedRois

      public boolean isCaclulateUnifiedRois()
    • setCalculateUnifiedRois

      public void setCalculateUnifiedRois(boolean calculateUnifiedRois)
    • isAlwaysRecordRawMCAs

      public boolean isAlwaysRecordRawMCAs()
    • setAlwaysRecordRawMCAs

      public void setAlwaysRecordRawMCAs(boolean alwaysRecordRawMCAs)
    • getNumberOfIncludedDetectors

      public int getNumberOfIncludedDetectors()
    • getVortexParameters

      public VortexParameters getVortexParameters()
    • getSleepTimeBeforeReadoutMs

      public int getSleepTimeBeforeReadoutMs()
    • setSleepTimeBeforeReadoutMs

      public void setSleepTimeBeforeReadoutMs(int sleepTimeBeforeReadoutMs)
      Set time to wait after detector has finished collecting before reading out the data
      Parameters:
      sleepTimeBeforeReadoutMs -
    • atScanStart

      public void atScanStart() throws DeviceException
      Description copied from class: ScannableBase
      Called for every Scannable at the start of a group of nested scans (or a single scan if that is the case) Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
      Specified by:
      atScanStart in interface Scannable
      Overrides:
      atScanStart in class Xmap
      Throws:
      DeviceException
      See Also:
    • setupForHardwareTriggeredCollection

      public void setupForHardwareTriggeredCollection(int numPixelsPerRun) throws DeviceException
      Setup for 'Hardware triggered' mode : detector stays armed continuously and each frame is captured in response to TTL trigger (e.g. from TFG). NumPixelsPer run is the number of frames to collect.
      Parameters:
      numPixelsPerRun -
      Throws:
      DeviceException
    • setupForSoftwareTriggeredCollection

      public void setupForSoftwareTriggeredCollection() throws DeviceException
      Setup for software triggered mode : detector captures single frame at a time, each frame manually started from Epics.
      Throws:
      DeviceException
    • collectData

      public void collectData() throws DeviceException
      Description copied from interface: Detector
      Tells the detector to begin to collect a set of data, then returns immediately. Should cause the hardware to start collecting immediately: if there is any delay then detectors used in the same scan would collect over different times when beam conditions may differ.
      Specified by:
      collectData in interface Detector
      Overrides:
      collectData in class XmapwithSlaveMode
      Throws:
      DeviceException
    • atCommandFailure

      public void atCommandFailure() throws DeviceException
      Description copied from class: ScannableBase
      Hook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred. However not called when the command is aborted using an InterruptionException. If a Scan is aborted then only Scannable.stop() will be called by the Scan or pos command.

      Useful for telling Scannables which hold state during a scan for example, to reset themselves. Used for example by CoordinatedMotionScannables. This hook should be used not in the same way as the stop hook. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.

      Specified by:
      atCommandFailure in interface Scannable
      Overrides:
      atCommandFailure in class Xmap
      Throws:
      DeviceException
      See Also:
    • isHardwareTriggeredMode

      public boolean isHardwareTriggeredMode()
    • setHardwareTriggeredMode

      public void setHardwareTriggeredMode(boolean hardwareTriggeredMode)
    • getCollectionMode

      public EDXDController.COLLECTION_MODES getCollectionMode()
    • setCollectionMode

      public void setCollectionMode(EDXDController.COLLECTION_MODES collectionMode)