Package gda.scan

Class TimeScan

All Implemented Interfaces:
NestableScan, Scan, ScanChild, Serializable

public class TimeScan extends ScanBase
Performs a TimeScan experiments. In this scan, no beamline settings are changed - data is collected from a detector for periods of CollectTime, with periods of PauseTime in between up to a total time of TotalTime.

Time units are seconds.

See Also:
  • Field Details

    • relativeTime

      public volatile DummyScannable relativeTime
      for observers to identify the relative time of the last data point from the start of the scan. This is a DummyScannable object so that data handlers will work properly.
  • Constructor Details

    • TimeScan

      public TimeScan(Object ct, int numberOfPoints, double pause, double collect)
      Create a TimeScan object to scan the detector specified
      Parameters:
      ct - the detector (counterTimer) to scan
      numberOfPoints - the number of data points to collect
      pause - the time between successive points of data collection
      collect - the time of data collection
    • TimeScan

      public TimeScan(List<Detector> ct, int numberOfPoints, double pause, double collect)
      Create a TimeScan object to scan the detector specified
      Parameters:
      ct - the detector (counterTimer) to scan
      numberOfPoints - the number of data points to collect
      pause - the time between successive points of data collection
      collect - the time of data collection
    • TimeScan

      public TimeScan(List<Detector> ct, int numberOfPoints, double pause, double collect, DataWriter dw)
      Create a TimeScan object to scan the detector specified
      Parameters:
      ct - the detector (counterTimer) to scan
      numberOfPoints - the number of data points to collect
      pause - the time between successive points of data collection
      collect - the time of data collection
      dw -
    • TimeScan

      public TimeScan(int numberOfPoints, double pause, double collect)
      Create a TimeScan object to scan all active detectors
      Parameters:
      numberOfPoints - the number of data points to collect
      pause - the time between successive points of data collection
      collect - the time of data collection
    • TimeScan

      public TimeScan(int numberOfPoints, double pause, double collect, DataWriter datahandler)
      Parameters:
      numberOfPoints -
      pause -
      collect -
      datahandler -
  • Method Details

    • doCollection

      public void doCollection() throws Exception
      Collect the data
      Specified by:
      doCollection in interface Scan
      Specified by:
      doCollection in class ScanBase
      Throws:
      Exception
      See Also:
    • waitUntil

      protected void waitUntil(long targetTime) throws InterruptedException
      Given a Java time in miliseconds, waits until that point and then returns. If that time has passed, then returns immediately;
      Parameters:
      targetTime - time in seconds
      Throws:
      InterruptedException
    • runScan

      public static void runScan(DetectorBase detector, int numberOfPoints, double pauseTime, double collectTime) throws InterruptedException, Exception
      Creates and runs a scan
      Parameters:
      detector - the device for data collection
      numberOfPoints - the number of data points to collect
      pauseTime - the time between successive points of data collection
      collectTime - the time of data collection
      Throws:
      InterruptedException
      Exception
    • runScan

      public static void runScan(int numberOfPoints, double pauseTime, double collectTime) throws InterruptedException, Exception
      Creates and runs a scan
      Parameters:
      numberOfPoints - the number of data points to collect
      pauseTime - the time between successive points of data collection
      collectTime - the time of data collection
      Throws:
      InterruptedException
      Exception