Package gda.scan

Class DetectorFunctions

java.lang.Object
gda.scan.DetectorFunctions

public class DetectorFunctions extends Object
Detector related functions refactored from TurboXasScan. Contains methods to :
  • Get the highest available frame across all detectors (getNumAvailableFrames()).
  • Prepare detectors for collection at the start of a scan (prepareDetectors(ContinuousParameters, int, int, int)).
  • Wait for Xspress3 detector to finish writing it's Hdf file (waitForXspress3(double)).
  • Get the total number of pulses captured by the zebra(s) (getNumCapturedZebraPulses()); The detectors being used for the scan should first be set with setDetectors(BufferedDetector[]) before using the above functions.
    • Constructor Details

      • DetectorFunctions

        public DetectorFunctions()
    • Method Details

      • getNumAvailableFrames

        public int getNumAvailableFrames() throws Exception
        Returns:
        Maximum available frame that can be read from all detectors (BufferedScaler and Xspress3Detector)
        Throws:
        DeviceException
        ScanFileHolderException
        NexusException
        Exception
      • getNumCapturedZebraPulses

        public int getNumCapturedZebraPulses() throws DeviceException
        Returns:
        Total number of captured pulses by zebra(s) used from scan
        Throws:
        DeviceException
      • waitForCapturedZebraPulses

        public void waitForCapturedZebraPulses(int numSpectra, int numPointsPerSpectrum, int timeOutSeconds) throws TimeoutException, IOException, InterruptedException
        Wait for zebra(s) to capture number of points each corresponding to a number of spectra
        Parameters:
        numSpectra -
        numPointsPerSpectrum -
        timeOutSeconds -
        Throws:
        IllegalStateException
        TimeoutException
        IOException
        InterruptedException
      • waitForXspress3

        public double waitForXspress3(double maxWaitTimeSecs) throws InterruptedException, DeviceException
        Wait for Xspress detector to finish writing hdf file to disk.
        Parameters:
        maxWaitTimeSecs -
        Returns:
        Throws:
        InterruptedException
        DeviceException
      • prepareDetectors

        public void prepareDetectors(ContinuousParameters params, int numSpectra, int numCycles, int numReadoutsPerSpectra) throws Exception
        Prepare detectors for a turboXAS scan (i.e. clear the memory, set the number of frames to collect, and arm)
        Parameters:
        params -
        numSpectra -
        numCycles -
        numReadoutsPerSpectra -
        Throws:
        Exception
      • isTfgArmed

        public boolean isTfgArmed() throws DeviceException
        Throws:
        DeviceException
      • getXspress3Detector

        public Xspress3BufferedDetector getXspress3Detector()
      • setZebra1

        public void setZebra1(Zebra zebra1)
      • setZebra2

        public void setZebra2(Zebra zebra2)
      • isUseTwoZebras

        public boolean isUseTwoZebras()
      • setUseTwoZebras

        public void setUseTwoZebras(boolean useTwoZebras)
      • getXspress3FileReader

        public SwmrFileReader getXspress3FileReader()
      • setDetectors

        public void setDetectors(BufferedDetector[] detectors)
      • isUseXspress3SwmrReadout

        public boolean isUseXspress3SwmrReadout()
      • setUseXspress3SwmrReadout

        public void setUseXspress3SwmrReadout(boolean useXspress3SwmrReadout)