Package gda.device.detector
Class EdeDetectorBase
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.detector.DetectorBase
gda.device.detector.EdeDetectorBase
- All Implemented Interfaces:
Detector,EdeDetector,NexusDetector,Device,Scannable,Configurable,Findable,gda.observable.IObservable,Serializable
- Direct Known Subclasses:
EdeDummyDetector,EdeFrelon,XhDetector
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EdeDetectorprotected EdeScanParametersprotected DetectorDataprotected booleanFields 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 TypeMethodDescriptionvoidCalled for every Scannable at the start of a group of nested scans (or a single scan if that is the case)voidDefault implementation for classes that do not have to do any specific configuration.
Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.protected abstract voidorg.eclipse.january.dataset.DoubleDatasetabstract DetectorStatusfetch detector status from hardware.doubleintReturns the function used to convert channel number to energy.double[]Integer[]Return array of 'dead pixel' locations.intintabstract intdetector's maximum pixel size in energy direction.intabstract intgetNumberScansInFrame(double frameTime, double scanTime, int numberOfFrames) calculate the number of scans (TFG2 term) or accumulations in a single frame based on detector clock rate.abstract StringInteger[]intgetRoiFor(int elementIndex) Roi[]getRois()Returns the regions in use, as defined by calls to setRois or setNumberRoisintReturns the current collecting state of the device.abstract intabstract booleanintbooleanbooleanbooleanvoidprepareDetectorwithScanParameters(EdeScanParameters newParameters) readFrames(int startFrame, int finalFrame) returns a list ofNexusTreeProvider, one for each frame in the specified range.readout()Reads the first frame only.abstract int[]readoutFrames(int startFrame, int finalFrame) implements the read out of frames from the actual detector used.voidsetAccumulationReadoutTime(double timeSec) Set the accumulation readout timevoidsetCheckForExcludedStrips(boolean checkForExcludedStrips) If set to true, detector data will have counts for 'excluded' pixels set to zero.voidsetCompressionLevel(int compressionLevel) Compression level to use for datasets in the Nexus file : 0 -> no compression 1 -> LZW compressionvoidsetDetectorData(DetectorData detectorData) voidsetDetectorSetupType(DetectorSetupType detectorSetupType) voidsetDropFirstFrame(boolean dropFirstFrame) voidsetEnergyCalibration(CalibrationDetails energyCalibration) Set the energy calibration.voidsetEnergyCalibrationSet(boolean energyCalibrationSet) voidsetExcludedPixels(Integer[] excludedPixels) Set array of dead pixel locationsvoidsetLowerChannel(int lowerChannel) voidsetMaxNumFramesToRead(int maxNumberOfFramesToRead) voidsetNumberRois(int numberOfRois) Set evenly sized regions of interest, ignoring channels outside of the lower and upper channel limits.abstract voidsetOrbitWaitMethod(String methodString) voidIgnoring the lower and upper channel properties, explicitly set the regions in use.abstract voidsetSynchroniseBeamOrbitDelay(int synchroniseBeamOrbitDelay) abstract voidsetSynchroniseToBeamOrbit(boolean synchroniseToBeamOrbit) voidsetUpperChannel(int upperChannel) protected int[][]unpackRawDataToFrames(int[] scalerData, int numFrames) voidMethods 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, atScanEnd, atScanLineEnd, atScanLineStart, externalToInternal, getExtraNames, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, rawGetPosition, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, throwExceptionIfInvalidTarget, toString, validateScannable, valueUnavailableString, waitWhileBusy, waitWhileBusyMethods inherited from class gda.device.DeviceBase
addIObserver, close, deleteIObserver, deleteIObservers, getAttribute, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setAttribute, setConfigureAtStartup, setName, 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
collectData, createsOwnFiles, 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.device.detector.EdeDetector
configureDetectorForROI, configureDetectorForTimingGroup, fetchDetectorSettings, getLastImageAvailable, getNumberOfSpectra, getNumberScansInFrame, getTemperatures, setNumberScansInFrameMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObserversMethods inherited from interface gda.device.Scannable
asynchronousMoveTo, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, isBusy, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, toFormattedString
-
Field Details
-
detectorData
-
currentScanParameter
-
currentDetector
-
dropFirstFrame
protected boolean dropFirstFrame
-
-
Constructor Details
-
EdeDetectorBase
protected EdeDetectorBase()
-
-
Method Details
-
configure
Description copied from class:ConfigurableBaseDefault implementation for classes that do not have to do any specific configuration.
Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classConfigurableBase- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
atScanStart
Description copied from class:ScannableBaseCalled 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:
atScanStartin interfaceScannable- Overrides:
atScanStartin classScannableBase- Throws:
DeviceException- See Also:
-
prepareDetectorwithScanParameters
public void prepareDetectorwithScanParameters(EdeScanParameters newParameters) throws DeviceException - Specified by:
prepareDetectorwithScanParametersin interfaceEdeDetector- Throws:
DeviceException
-
configureDetectorForCollection
- Throws:
DeviceException
-
getMaxPixel
public abstract int getMaxPixel()detector's maximum pixel size in energy direction.- Specified by:
getMaxPixelin interfaceEdeDetector- Returns:
- maximum pixels of camera in energy direction
-
getNumberScansInFrame
public abstract int getNumberScansInFrame(double frameTime, double scanTime, int numberOfFrames) throws DeviceException calculate the number of scans (TFG2 term) or accumulations in a single frame based on detector clock rate.- Specified by:
getNumberScansInFramein interfaceEdeDetector- Parameters:
frameTime-scanTime-numberOfFrames-- Returns:
- number of accumulations.
- Throws:
DeviceException
-
fetchStatus
fetch detector status from hardware.- Specified by:
fetchStatusin interfaceEdeDetector- Returns:
DetectorStatus- Throws:
DeviceException
-
getDetectorData
- Specified by:
getDetectorDatain interfaceEdeDetector
-
getPixels
- Specified by:
getPixelsin interfaceEdeDetector
-
getEnergyForChannels
public double[] getEnergyForChannels()- Specified by:
getEnergyForChannelsin interfaceEdeDetector
-
writeLiveDataFile
- Specified by:
writeLiveDataFilein interfaceEdeDetector- Throws:
DeviceException
-
createDatasetForPixel
public org.eclipse.january.dataset.DoubleDataset createDatasetForPixel()- Specified by:
createDatasetForPixelin interfaceEdeDetector
-
getStatus
Description copied from interface:DetectorReturns the current collecting state of the device.- Specified by:
getStatusin interfaceDetector- Returns:
- BUSY if the detector has not finished the requested operation(s), IDLE if in an completely idle state and STANDBY if temporarily suspended.
- Throws:
DeviceException
-
readout
Reads the first frame only.- Specified by:
readoutin interfaceDetector- Specified by:
readoutin interfaceNexusDetector- Returns:
- the data collected
- Throws:
DeviceException
-
readFrames
returns a list ofNexusTreeProvider, one for each frame in the specified range.- Specified by:
readFramesin interfaceEdeDetector- Parameters:
startFrame-finalFrame-- Returns:
- list of
NexusTreeProvider - Throws:
DeviceException
-
readoutFrames
implements the read out of frames from the actual detector used.- Specified by:
readoutFramesin interfaceEdeDetector- Parameters:
startFrame-finalFrame-- Returns:
- an 1D integer array containing all frames concatenated from start frame to the final frame inclusively.
- Throws:
DeviceException
-
unpackRawDataToFrames
protected int[][] unpackRawDataToFrames(int[] scalerData, int numFrames) -
setDetectorData
-
isDropFirstFrame
public boolean isDropFirstFrame()- Specified by:
isDropFirstFramein interfaceEdeDetector
-
setDropFirstFrame
public void setDropFirstFrame(boolean dropFirstFrame) -
getEnergyCalibration
Description copied from interface:EdeDetectorReturns the function used to convert channel number to energy. If not calibrated it should return a simple y = x function.- Specified by:
getEnergyCalibrationin interfaceEdeDetector- Returns:
- PolynomialFunction
-
setEnergyCalibration
Description copied from interface:EdeDetectorSet the energy calibration. The detector object should persist this between GDA server restarts.- Specified by:
setEnergyCalibrationin interfaceEdeDetector- Parameters:
energyCalibration-
-
isEnergyCalibrationSet
public boolean isEnergyCalibrationSet()- Specified by:
isEnergyCalibrationSetin interfaceEdeDetector
-
setEnergyCalibrationSet
public void setEnergyCalibrationSet(boolean energyCalibrationSet) -
getRois
Description copied from interface:EdeDetectorReturns the regions in use, as defined by calls to setRois or setNumberRois- Specified by:
getRoisin interfaceEdeDetector- Returns:
- the array of regions
-
setRois
Description copied from interface:EdeDetectorIgnoring the lower and upper channel properties, explicitly set the regions in use.- Specified by:
setRoisin interfaceEdeDetector- Parameters:
rois-
-
getNumberOfRois
public int getNumberOfRois()- Specified by:
getNumberOfRoisin interfaceEdeDetector
-
setNumberRois
public void setNumberRois(int numberOfRois) Description copied from interface:EdeDetectorSet evenly sized regions of interest, ignoring channels outside of the lower and upper channel limits.- Specified by:
setNumberRoisin interfaceEdeDetector- Parameters:
numberOfRois-
-
getLowerChannel
public int getLowerChannel()- Specified by:
getLowerChannelin interfaceEdeDetector
-
setLowerChannel
public void setLowerChannel(int lowerChannel) - Specified by:
setLowerChannelin interfaceEdeDetector
-
getUpperChannel
public int getUpperChannel()- Specified by:
getUpperChannelin interfaceEdeDetector
-
setUpperChannel
public void setUpperChannel(int upperChannel) - Specified by:
setUpperChannelin interfaceEdeDetector
-
getExcludedPixels
Return array of 'dead pixel' locations.- Specified by:
getExcludedPixelsin interfaceEdeDetector
-
setExcludedPixels
Set array of dead pixel locations- Specified by:
setExcludedPixelsin interfaceEdeDetector- Parameters:
excludedPixels-
-
getRoiFor
public int getRoiFor(int elementIndex) - Specified by:
getRoiForin interfaceEdeDetector
-
setSynchroniseToBeamOrbit
public abstract void setSynchroniseToBeamOrbit(boolean synchroniseToBeamOrbit) - Specified by:
setSynchroniseToBeamOrbitin interfaceEdeDetector
-
getSynchroniseToBeamOrbit
public abstract boolean getSynchroniseToBeamOrbit()- Specified by:
getSynchroniseToBeamOrbitin interfaceEdeDetector
-
setSynchroniseBeamOrbitDelay
public abstract void setSynchroniseBeamOrbitDelay(int synchroniseBeamOrbitDelay) throws DeviceException - Specified by:
setSynchroniseBeamOrbitDelayin interfaceEdeDetector- Throws:
DeviceException
-
getSynchroniseBeamOrbitDelay
public abstract int getSynchroniseBeamOrbitDelay()- Specified by:
getSynchroniseBeamOrbitDelayin interfaceEdeDetector
-
setOrbitWaitMethod
- Specified by:
setOrbitWaitMethodin interfaceEdeDetector
-
getOrbitWaitMethod
- Specified by:
getOrbitWaitMethodin interfaceEdeDetector
-
setDetectorSetupType
- Specified by:
setDetectorSetupTypein interfaceEdeDetector
-
getDetectorSetupType
- Specified by:
getDetectorSetupTypein interfaceEdeDetector
-
isCheckForExcludedStrips
public boolean isCheckForExcludedStrips()- Returns:
- true if excluded pixels are set to zero in the detector data.
-
setCheckForExcludedStrips
public void setCheckForExcludedStrips(boolean checkForExcludedStrips) If set to true, detector data will have counts for 'excluded' pixels set to zero. Excluded pixels are those defined bysetExcludedPixels(Integer[])or outside of lower and upper channels.Note that pixels outside of ROI range are only excluded if
currentScanParameter.getIncludeCountsOutsideROIs() also returns true.- Parameters:
checkForExcludedStrips-
-
setAccumulationReadoutTime
public void setAccumulationReadoutTime(double timeSec) Description copied from interface:EdeDetectorSet the accumulation readout time- Specified by:
setAccumulationReadoutTimein interfaceEdeDetector
-
getAccumulationReadoutTime
public double getAccumulationReadoutTime()- Specified by:
getAccumulationReadoutTimein interfaceEdeDetector- Returns:
- Accumulation readout time (in seconds)
-
getMaxNumFramesToRead
public int getMaxNumFramesToRead()- Specified by:
getMaxNumFramesToReadin interfaceEdeDetector
-
setMaxNumFramesToRead
public void setMaxNumFramesToRead(int maxNumberOfFramesToRead) -
getCompressionLevel
public int getCompressionLevel() -
setCompressionLevel
public void setCompressionLevel(int compressionLevel) Compression level to use for datasets in the Nexus file :- 0 -> no compression
- 1 -> LZW compression
- Parameters:
compressionLevel-
-