Package gda.device.detector
Class EdeDummyDetector
- All Implemented Interfaces:
Detector,EdeDetector,NexusDetector,Device,Scannable,Configurable,Findable,gda.observable.IObservable,Serializable
This is a dummy implementation of an EdeDetector, similar to the Dummy values useful for debugging based on number of frames and MCA channels, generated by Values from a dataset loaded from a file using Values from a dataset specified by
This detector can be used in a
XhDetector detector running with dummy da server.
The readoutFrames(int, int) method of this detector returns either
createDummyData(int, int)
loadDetectorDataFromNexusFile(java.lang.String)
setDetectorData(org.eclipse.january.dataset.Dataset) TimeResolvedExperiment to replace real data with dummy values by using
EdeExperiment.setDetectorForScanPart(gda.scan.ede.position.EdePositionType, gda.scan.ede.EdeScanType, EdeDetector)- See Also:
-
Field Summary
Fields inherited from class gda.device.detector.EdeDetectorBase
currentDetector, currentScanParameter, dropFirstFrameFields inherited from class gda.device.detector.DetectorBase
collectionTimeFields inherited from class gda.device.scannable.ScannableBase
__doc__, DEFAULT_INPUT_NAME, DEFAULT_OUTPUT_FORMAT, extraNames, inputNames, level, outputFormatFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTYFields inherited from interface gda.device.detector.EdeDetector
CALIBRATION_PROP_KEY, EXCLUDED_PIXELS_PROP_NAME, INITIAL_NO_OF_ROIS, ROIS_PROP_NAMEFields inherited from interface gda.device.Scannable
ATTR_NEXUS_CATEGORY, ATTR_NX_CLASS, DEFAULT_INPUT_NAME, VALUE_UNAVAILABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReset name back to original 'dummy detector' name.voidSet detector name to match that of real detector.voidTells the detector to begin to collect a set of data, then returns immediately.protected voidvoidconfigureDetectorForROI(int verticalBinning, int ccdLineBegin) voidbooleanReturns a value which indicates whether the detector creates its own files.voidto pull detector setting from detector server to synchronise theDetectorDataobjectfetch detector status from hardware.intintdetector's maximum pixel size in energy direction.intintintgetNumberScansInFrame(double frameTime, double scanTime, int numberOfFrames) calculate the number of scans (TFG2 term) or accumulations in a single frame based on detector clock rate.intbooleanbooleanvoidloadDetectorDataFromNexusFile(String nexusFile) Set dummy detector data by loading a Dataset from a Nexus filevoidloadDetectorDataFromNexusFile(String nexusFile, String pathToDataSet) voidloadDetectorDataFromNexusFile(String nexusFile, String pathToDataSet, int rowToUse) Read one or multiple rows (frames) of data from specified dataset in Nexus file and use it to set the dummy detector dataint[]readoutFrames(int startFrame, int finalFrame) Readout frames of detector data, filling in the values fromdetectorData(if present) or usingcreateDummyData(int, int).voidsetAverageRows(boolean averageRows) voidsetDetectorData(org.eclipse.january.dataset.Dataset data) Set dummy detector data directly from DatasetvoidsetDummyDetectorName(String dummyDetectorName) voidsetMainDetectorName(String mainDetectorName) voidsetMaxPixel(int maxPixel) voidSet detector name : first call to this sets 'dummy detector' name.voidsetNumberScansInFrame(int numScansInFrame) voidsetOrbitWaitMethod(String methodString) voidsetSynchroniseBeamOrbitDelay(int synchroniseBeamOrbitDelay) voidsetSynchroniseToBeamOrbit(boolean synchroniseToBeamOrbit) voidstop()Stop the current move/operation.Methods inherited from class gda.device.detector.EdeDetectorBase
configure, createDatasetForPixel, getAccumulationReadoutTime, getCompressionLevel, getDetectorData, getDetectorSetupType, getEnergyCalibration, getEnergyForChannels, getExcludedPixels, getLowerChannel, getMaxNumFramesToRead, getNumberOfRois, getPixels, getRoiFor, getRois, getStatus, getUpperChannel, isCheckForExcludedStrips, isDropFirstFrame, isEnergyCalibrationSet, prepareDetectorwithScanParameters, readFrames, readout, setAccumulationReadoutTime, setCheckForExcludedStrips, setCompressionLevel, setDetectorData, setDetectorSetupType, setDropFirstFrame, setEnergyCalibration, setEnergyCalibrationSet, setExcludedPixels, setLowerChannel, setMaxNumFramesToRead, setNumberRois, setRois, setUpperChannel, unpackRawDataToFrames, writeLiveDataFileMethods inherited from class gda.device.detector.DetectorBase
asynchronousMoveTo, checkPositionValid, endCollection, getCollectionTime, getDataDimensions, getDescription, getDetectorID, getDetectorType, getPosition, isBusy, prepareForCollection, setCollectionTime, toFormattedStringMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanLineEnd, atScanLineStart, externalToInternal, getExtraNames, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, rawGetPosition, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, throwExceptionIfInvalidTarget, toString, validateScannable, valueUnavailableString, waitWhileBusy, waitWhileBusyMethods inherited from class gda.device.DeviceBase
addIObserver, close, deleteIObserver, deleteIObservers, getAttribute, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setAttribute, setConfigureAtStartup, setProtectionLevelMethods inherited from class gda.factory.ConfigurableBase
isConfigured, reconfigure, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Detector
endCollection, getCollectionTime, getDataDimensions, getDescription, getDetectorID, getDetectorType, getFileStructure, prepareForCollection, setCollectionTime, waitWhileBusyMethods inherited from interface gda.device.Device
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObserversMethods inherited from interface gda.device.Scannable
asynchronousMoveTo, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanLineEnd, atScanLineStart, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, isBusy, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, toFormattedString
-
Constructor Details
-
EdeDummyDetector
public EdeDummyDetector()
-
-
Method Details
-
setName
Set detector name : first call to this sets 'dummy detector' name. SeeatScanStart(),atScanEnd().- Specified by:
setNamein interfaceFindable- Overrides:
setNamein classDeviceBase- Parameters:
name- The name to set.
-
atScanStart
public void atScanStart()Set detector name to match that of real detector. This is done so data produced by 'dummy detector' is added to same Nexus group as data from 'real' detector.- Specified by:
atScanStartin interfaceScannable- Overrides:
atScanStartin classEdeDetectorBase- See Also:
-
atScanEnd
public void atScanEnd()Reset name back to original 'dummy detector' name.- Specified by:
atScanEndin interfaceScannable- Overrides:
atScanEndin classScannableBase- See Also:
-
stop
public void stop()Description copied from class:ScannableBaseStop the current move/operation. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
stopin interfaceScannable- Overrides:
stopin classScannableBase- See Also:
-
getDummyDetectorName
-
setDummyDetectorName
-
getMainDetectorName
-
setMainDetectorName
-
setMaxPixel
public void setMaxPixel(int maxPixel) -
getMaxPixel
public int getMaxPixel()Description copied from class:EdeDetectorBasedetector's maximum pixel size in energy direction.- Specified by:
getMaxPixelin interfaceEdeDetector- Specified by:
getMaxPixelin classEdeDetectorBase- Returns:
- maximum pixels of camera in energy direction
-
setDetectorData
public void setDetectorData(org.eclipse.january.dataset.Dataset data) Set dummy detector data directly from Dataset- Parameters:
data-
-
loadDetectorDataFromNexusFile
Set dummy detector data by loading a Dataset from a Nexus file- Parameters:
nexusFile-
-
loadDetectorDataFromNexusFile
-
loadDetectorDataFromNexusFile
Read one or multiple rows (frames) of data from specified dataset in Nexus file and use it to set the dummy detector data- Parameters:
nexusFile- Full path to Nexus filepathToDataSet- Path to Nexus datasetrowToUse- >=0 to select single row, -1 to use all
-
readoutFrames
Readout frames of detector data, filling in the values fromdetectorData(if present) or usingcreateDummyData(int, int).If detectorData has fewer columns than required number of channels, zeros will be used to pad columns.
If number of frames required > number of rows, row values will be cycled repeatedly as necessary.
- Specified by:
readoutFramesin interfaceEdeDetector- Specified by:
readoutFramesin classEdeDetectorBase- Parameters:
startFrame-finalFrame-- Returns:
- an 1D integer array containing all frames concatenated from start frame to the final frame inclusively.
- Throws:
DeviceException
-
getNumberScansInFrame
public int getNumberScansInFrame(double frameTime, double scanTime, int numberOfFrames) throws DeviceException Description copied from class:EdeDetectorBasecalculate the number of scans (TFG2 term) or accumulations in a single frame based on detector clock rate.- Specified by:
getNumberScansInFramein interfaceEdeDetector- Specified by:
getNumberScansInFramein classEdeDetectorBase- Parameters:
frameTime-scanTime-numberOfFrames-- Returns:
- number of accumulations.
- Throws:
DeviceException
-
fetchStatus
Description copied from class:EdeDetectorBasefetch detector status from hardware.- Specified by:
fetchStatusin interfaceEdeDetector- Specified by:
fetchStatusin classEdeDetectorBase- Returns:
DetectorStatus- Throws:
DeviceException
-
getNumberOfSpectra
- Throws:
DeviceException
-
getTemperatures
- Throws:
DeviceException
-
fetchDetectorSettings
public void fetchDetectorSettings()Description copied from interface:EdeDetectorto pull detector setting from detector server to synchronise theDetectorDataobject -
getNumberScansInFrame
public int getNumberScansInFrame() -
setNumberScansInFrame
public void setNumberScansInFrame(int numScansInFrame) -
configureDetectorForTimingGroup
- Throws:
DeviceException
-
configureDetectorForROI
- Throws:
DeviceException
-
collectData
Description copied from interface:DetectorTells 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.- Throws:
DeviceException
-
createsOwnFiles
Description copied from interface:DetectorReturns a value which indicates whether the detector creates its own files. If it does (return true) the readout() method returns the name of the latest file created as a string. If it does not (return false) the readout() method will return the data directly.- Returns:
- true if readout() returns filenames
- Throws:
DeviceException
-
configureDetectorForCollection
- Specified by:
configureDetectorForCollectionin classEdeDetectorBase- Throws:
DeviceException
-
setSynchroniseToBeamOrbit
public void setSynchroniseToBeamOrbit(boolean synchroniseToBeamOrbit) - Specified by:
setSynchroniseToBeamOrbitin interfaceEdeDetector- Specified by:
setSynchroniseToBeamOrbitin classEdeDetectorBase
-
getSynchroniseToBeamOrbit
public boolean getSynchroniseToBeamOrbit()- Specified by:
getSynchroniseToBeamOrbitin interfaceEdeDetector- Specified by:
getSynchroniseToBeamOrbitin classEdeDetectorBase
-
setSynchroniseBeamOrbitDelay
- Specified by:
setSynchroniseBeamOrbitDelayin interfaceEdeDetector- Specified by:
setSynchroniseBeamOrbitDelayin classEdeDetectorBase- Throws:
DeviceException
-
getSynchroniseBeamOrbitDelay
public int getSynchroniseBeamOrbitDelay()- Specified by:
getSynchroniseBeamOrbitDelayin interfaceEdeDetector- Specified by:
getSynchroniseBeamOrbitDelayin classEdeDetectorBase
-
setOrbitWaitMethod
- Specified by:
setOrbitWaitMethodin interfaceEdeDetector- Specified by:
setOrbitWaitMethodin classEdeDetectorBase
-
getOrbitWaitMethod
- Specified by:
getOrbitWaitMethodin interfaceEdeDetector- Specified by:
getOrbitWaitMethodin classEdeDetectorBase
-
getLastImageAvailable
- Returns:
- Index of last image on the detector available for reading out using. (i.e. -1 = no image is ready, 0 = 1 image is ready)
- Throws:
DeviceException
-
isAverageRows
public boolean isAverageRows() -
setAverageRows
public void setAverageRows(boolean averageRows)
-