Package gda.scan
Class EdeScan
java.lang.Object
gda.scan.ScanBase
gda.scan.ConcurrentScanChild
gda.scan.EdeScan
- All Implemented Interfaces:
EnergyDispersiveExafsScan,IConcurrentScanChild,NestableScan,Scan,ScanChild,Serializable
- Direct Known Subclasses:
EdeScanWithTFGTrigger
Runs a single set of timing groups for EDE through the XSTRIP DAServer interface.
So this: moves sample to correct position, waits for top-up to pass (if required), opens/closes shutter, runs the timing groups through the TFG unit and writes data to given Nexus file.
Also holds data in memory for quick retrieval for online data.
This starts immediately and does not take sample environment triggering
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class gda.scan.ConcurrentScanChild
ConcurrentScanChild.PointPositionInLineNested classes/interfaces inherited from class gda.scan.ScanBase
ScanBase.ParentScanComponentNested classes/interfaces inherited from interface gda.scan.Scan
Scan.ScanStatus -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EdeScanPositionprotected final List<ScanDataPoint> protected EdeScanParametersprotected EdeScanTypeprotected final EdeDetectorprotected final TopupCheckerFields inherited from class gda.scan.ConcurrentScanChild
allChildScans, allScanObjects, detectorReadoutTask, scannableLevelsFields inherited from class gda.scan.ScanBase
allDetectors, allScannables, callCollectDataOnDetectors, child, command, currentPointCount, GDA_SCANBASE_FIRST_SCAN_NUMBER_FOR_TEST, GDA_SCANBASE_PRINT_TIMESTAMP_TO_TERMINAL, instrument, isChild, name, numberOfChildScans, parent, parentComponent, permissionLevel, scanDataPointPipeline, stepId, totalNumberOfPoints -
Constructor Summary
ConstructorsConstructorDescriptionEdeScan(EdeScanParameters scanParameters, EdeScanPosition motorPositions, EdeScanType scanType, EdeDetector theDetector, Integer repetitionNumber, Scannable shutter, TopupChecker topupChecker) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddDetectorsToScanDataPoint(int lowFrame, Object[] detData, int thisFrame, ScanDataPoint thisPoint) voidaddScannableToMonitorDuringScan(Scannable scannableToMonitorDuringScan) protected voidvoidThe method in which the work of the scan is performed.org.eclipse.january.dataset.DoubleDatasetextractDetectorDataSet(int spectrumIndex) org.eclipse.january.dataset.DoubleDatasetorg.eclipse.january.dataset.DoubleDatasetvoidfastShutterMoveTo(String position) Move the fast shutter to specified position (e.g.getData()getDataPoints(int firstFrame, int lastFrame) intdefault implementation.intdoubleintThe total number of points in the multi-dimesional scan i.e.booleanbooleanprotected ScanObjectisScannableToBeMoved(Scannable scannable) Asks if the given scannable is part of the array of scannables which this scan is to operate in its moveToStarts and moveBySteps methods.booleanbooleanprotected voidprotected voidmoveShutter(String position) protected voidprotected NexusTreeProvider[]readDetectors(int lowFrame, int highFrame) voidsetFastShutter(Scannable fastShutter) voidsetIncludeCyclePlotLabel(boolean includeGroupNumberInSDPLabel) voidsetMotorPositions(EdeScanPosition motorPositions) voidsetNoOfSecPerSpectrumToPublish(double noOfSecPerSpectrumToPublish) voidsetProgressUpdater(gda.observable.IObserver progressUpdater) voidsetScannablesToMonitorDuringScan(Collection<Scannable> scannablesToMonitorDuringScan) voidsetScanParameters(EdeScanParameters scanParameters) voidsetScanType(EdeScanType scanType) voidsetSmartstop(boolean smartstop) voidsetStatus(Scan.ScanStatus status) To allow nests of scans to share a common status with each other.voidsetUseFastShutter(boolean useFastShutter) voidsetUseNexusTreeWriter(boolean useNexusTreeWriter) voidsetWaitTimeAfterCollection(double waitTimeAfterCollection) How long to wait for after collection has finishedprotected booleanLog and display a message about current cycle to be skipped if smart stop has been selected.toString()protected voidvalidate()protected voidSleep forwaitTimeAfterCollectionseconds - if smart stop is not set to true.protected voidFor 'light It' measurement wait for required time ifTimingGroup.getPreceedingTimeDelay()is > 0.Methods inherited from class gda.scan.ConcurrentScanChild
acquirePoint, cancelReadoutAndPublishCompletion, checkAllMovesComplete, generateDevicesToMoveByLevel, getAllChildScans, getAllDetectors, getAllScannables, getAllScanObjects, getChild, getPointPositionInLine, getScannableLevels, isMustBeFinal, isReadoutConcurrent, isScannableActuallyToBeMoved, readoutDetectorsAndPublish, reorderAllScanObjects, setAllChildScans, setAllDetectors, setAllScannables, setAllScanObjects, setChild, setCommand, setMustBeFinal, setPointPositionInLine, setScannableLevels, setTotalNumberOfPoints, setUp, waitForDetectorReadoutAndPublishCompletionMethods inherited from class gda.scan.ScanBase
callAtCommandFailureHooks, callDetectorsEndCollection, callScannablesAtScanEnd, callScannablesAtScanLineEnd, callScannablesAtScanLineStart, callScannablesAtScanStart, checkStartStopStep, checkThreadInterrupted, collectData, createScanDataPoint, createScanDataPointPipeline, createScanDataPointPipeline, endScan, generateRandomName, getDataWriter, getDetectors, getDimensions, getName, getNumberOfChildScans, getParent, getPositionCallableThreadPoolSize, getScanDataPointPipeline, getScanDataPointQueueLength, getScanInformation, getScannables, getScanNumber, getScanPlotSettings, getStatus, getStepId, getStepIds, isChild, isFinishEarlyRequested, isLineScanNeedsDoing, notifyServer, notifyServer, numberOfScannablesThatCanProvidePositionCallables, pause, prepareDevicesForCollection, prepareForCollection, prepareScanForCollection, prepareScanNumber, prepareStaticVariables, readDevicesAndPublishScanDataPoint, reorderScannables, representThrowable, requestFinishEarly, resume, run, runScan, scanRunning, sendScanEvent, setChild, setDataWriter, setDetectors, setIsChild, setLineScanNeedsDoing, setNumberOfChildScans, setParent, setPositionCallableThreadPoolSize, setScanDataPointPipeline, setScanDataPointQueueLength, setScanIdentifierInScanDataPoint, setScannables, setScanNumber, setScanPlotSettings, setStatus, setStepId, shutdownScandataPipeline, signalScanComplete, signalScanStarted, sortArguments, waitIfPaused, wasScanExplicitlyHalted, wrappedExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gda.scan.Scan
getDataWriter, getDetectors, getName, getScanDataPointPipeline, getScanInformation, getScannables, getScanNumber, getScanPlotSettings, getStatus, getStepId, isChild, isFinishEarlyRequested, pause, prepareForCollection, requestFinishEarly, resume, run, runScan, setChild, setDataWriter, setDetectors, setIsChild, setScanDataPointPipeline, setScannables, setScanPlotSettings, setStepId
-
Field Details
-
theDetector
-
rawData
-
scanParameters
-
motorPositions
-
scanType
-
topupChecker
-
-
Constructor Details
-
EdeScan
public EdeScan(EdeScanParameters scanParameters, EdeScanPosition motorPositions, EdeScanType scanType, EdeDetector theDetector, Integer repetitionNumber, Scannable shutter, TopupChecker topupChecker) - Parameters:
scanParameters- - timing parameters of the data collectionmotorPositions- -scanType-theDetector-repetitionNumber- - if this is a negative number then frame index columns will not be added to the output. Useful for single spectrum scans where such indexing is meaningless.shutter-
-
-
Method Details
-
toString
-
getHeaderDescription
- Specified by:
getHeaderDescriptionin interfaceEnergyDispersiveExafsScan
-
getDimension
public int getDimension()Description copied from class:ScanBasedefault implementation. Classes that derive from ScanBase which want to support the reporting of scan dimensions -@see getDimensions need to override this method- Specified by:
getDimensionin interfaceScan- Overrides:
getDimensionin classScanBase- Returns:
- the number of points of this scan object - the whole scan execution can be a hierarchy of parent scan objects and layers of child scan objects
- See Also:
-
getNumberOfAvailablePoints
public int getNumberOfAvailablePoints() -
setProgressUpdater
public void setProgressUpdater(gda.observable.IObserver progressUpdater) - Specified by:
setProgressUpdaterin interfaceEnergyDispersiveExafsScan
-
getDataPoints
-
isScannableToBeMoved
Description copied from class:ConcurrentScanChildAsks if the given scannable is part of the array of scannables which this scan is to operate in its moveToStarts and moveBySteps methods. If true returns the ScanObject else returns null.- Overrides:
isScannableToBeMovedin classConcurrentScanChild- Parameters:
scannable-- Returns:
- the ScanObject
-
fastShutterMoveTo
Move the fast shutter to specified position (e.g. "Open" , "Close" ) moveTo doesn't block so sleep until shutter has actually moved to the new position is also implemented here- Parameters:
position-- Throws:
DeviceExceptionInterruptedException- Since:
- 28/1/2016.
-
moveShutter
- Throws:
DeviceExceptionInterruptedException
-
doCollection
Description copied from interface:ScanThe method in which the work of the scan is performed. This method assumes that the data handler has already been created and the baton claimed.- Specified by:
doCollectionin interfaceScan- Specified by:
doCollectionin classScanBase- Throws:
Exception
-
smartStopDetected
protected boolean smartStopDetected()Log and display a message about current cycle to be skipped if smart stop has been selected.- Returns:
- true if smartStop is active.
-
waitAfterCollection
Sleep forwaitTimeAfterCollectionseconds - if smart stop is not set to true. (To be run after data collection to implement 'wait time between cycles').- Throws:
InterruptedException
-
waitBeforeCycle
For 'light It' measurement wait for required time ifTimingGroup.getPreceedingTimeDelay()is > 0.- Throws:
InterruptedException
-
collectDetectorData
- Throws:
Exception
-
pollDetectorAndFetchData
- Throws:
DeviceExceptionException
-
moveSampleIntoPosition
- Throws:
DeviceExceptionInterruptedException
-
getCommand
- Specified by:
getCommandin interfaceIConcurrentScanChild- Overrides:
getCommandin classConcurrentScanChild- Returns:
- Returns the command.
-
getTotalNumberOfPoints
public int getTotalNumberOfPoints()Description copied from interface:IConcurrentScanChildThe total number of points in the multi-dimesional scan i.e. the number of ScanDataPoints which would need displaying/recording- Specified by:
getTotalNumberOfPointsin interfaceIConcurrentScanChild- Specified by:
getTotalNumberOfPointsin interfaceScan- Overrides:
getTotalNumberOfPointsin classScanBase- Returns:
- the total number of nodes at which data will be collected in this scan. This includes all the dimensions in a multi-dimensional scan.
-
validate
- Throws:
IllegalArgumentException
-
getScannablesToMonitorDuringScan
-
setScannablesToMonitorDuringScan
-
addScannableToMonitorDuringScan
-
addDetectorsToScanDataPoint
protected void addDetectorsToScanDataPoint(int lowFrame, Object[] detData, int thisFrame, ScanDataPoint thisPoint) throws DeviceException - Throws:
DeviceException
-
readDetectors
protected NexusTreeProvider[] readDetectors(int lowFrame, int highFrame) throws Exception, DeviceException - Throws:
ExceptionDeviceException
-
isIncludeGroupNumberInSDPLabel
public boolean isIncludeGroupNumberInSDPLabel() -
setIncludeCyclePlotLabel
public void setIncludeCyclePlotLabel(boolean includeGroupNumberInSDPLabel) -
extractLastDetectorDataSet
public org.eclipse.january.dataset.DoubleDataset extractLastDetectorDataSet() -
extractEnergyDetectorDataSet
public org.eclipse.january.dataset.DoubleDataset extractEnergyDetectorDataSet()- Specified by:
extractEnergyDetectorDataSetin interfaceEnergyDispersiveExafsScan
-
extractDetectorDataSet
public org.eclipse.january.dataset.DoubleDataset extractDetectorDataSet(int spectrumIndex) - Specified by:
extractDetectorDataSetin interfaceEnergyDispersiveExafsScan
-
getData
- Specified by:
getDatain interfaceEnergyDispersiveExafsScan
-
getScanParameters
- Specified by:
getScanParametersin interfaceEnergyDispersiveExafsScan
-
setScanParameters
- Specified by:
setScanParametersin interfaceEnergyDispersiveExafsScan
-
getMotorPositions
-
setMotorPositions
-
getScanType
- Specified by:
getScanTypein interfaceEnergyDispersiveExafsScan
-
setScanType
- Specified by:
setScanTypein interfaceEnergyDispersiveExafsScan
-
getDetector
- Specified by:
getDetectorin interfaceEnergyDispersiveExafsScan
-
isSmartstop
public boolean isSmartstop() -
setSmartstop
public void setSmartstop(boolean smartstop) -
gsUseFastShutter
public boolean gsUseFastShutter() -
setUseFastShutter
public void setUseFastShutter(boolean useFastShutter) -
getFastShutter
-
setFastShutter
-
isUseNexusTreeWriter
public boolean isUseNexusTreeWriter() -
setUseNexusTreeWriter
public void setUseNexusTreeWriter(boolean useNexusTreeWriter) -
setNoOfSecPerSpectrumToPublish
public void setNoOfSecPerSpectrumToPublish(double noOfSecPerSpectrumToPublish) -
getSleepTimeAfterCollection
public double getSleepTimeAfterCollection() -
setWaitTimeAfterCollection
public void setWaitTimeAfterCollection(double waitTimeAfterCollection) How long to wait for after collection has finished- Parameters:
waitTimeAfterCollection- (time in seconds)
-
setStatus
To allow nests of scans to share a common status with each other.- Parameters:
status-
-