Package gda.device.detector.xmap
Class XmapDetectorFromEpicsMca
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.detector.DetectorBase
gda.device.detector.xmap.XmapDetectorFromEpicsMca
- All Implemented Interfaces:
Detector,NexusDetector,Device,Scannable,XmapDetector,Configurable,Findable,gda.observable.IObservable,Serializable
An
XmapDetector made from a number of Mca's (technically Analysers).- See Also:
-
Field Summary
Fields 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.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)voidclear()Clear all MCA'svoidClears all MCAs and starts data collectionvoidTells the detector to begin to collect a set of data, then returns immediately.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.voidconfigureHardware(VortexParameters vortexParameters) booleanReturns a value which indicates whether the detector creates its own files.doubleReturns the time for which the detector is set to acquire dataLightly to be only implemented on the server.doubleReturns the time, in seconds, the detector collects for during the next call to collectData()int[][]getData()Returns the data array of all the MCAsint[]getData(int mcaNumber) Returns the data array of the specified MCAint[]Default which should be overridden by subclasses.String[]Additional names for extra values that returned by getPosition().intReturns current number of Bins/channels for spectrum acquisition in each MCAintReturns the number of MCAs currently connected to the XMap detectorintReturns the total number of ROIs currently setString[]Returns an array of strings which are the format strings to use when pretty printing parts of the outputdoubleReturns the current rate at which data is read in the Epics interfacedoubleThis implementation simply returns the acquisition time.double[]getROICounts(int iRoi) Gets the count for each mca for a given ROI.double[]Returns the sum of the corresponding ROIs of all the MCA.intReturns the status of the detectordoubleReturns the current set rate at which status is read in the Epics interfacebooleanbooleanbooleanprotected booleanprotected booleanbooleanbooleanbooleanvoidreadConfigFile(String fileName) readout()Returns the latest data collected.doubleReads out the scaler data of the roi counts, corrects for deadtime and returns the sum.voidsetAcquisitionTime(double time) Tells the detector for how many seconds to acquire datavoidsetAnalysers(List<Analyser> analysers) voidsetCollectionTime(double collectionTime) Sets the collection time, in seconds, to be used during the next call of collectData.voidsetConfigFileName(String configFileName) voidsetNthROI(double[][] rois, int roiIndex) Sets a ROI for all of the MCAsvoidsetNumberOfBins(int numberOfBins) Sets maximum numbers of bins/channels to use for spectrum acquisition in each MCAvoidsetPrefixExtraNameWithDetElement(boolean prefixExtraNameWithDetElement) voidsetReadConfigFromDeviceAtScanStart(boolean readConfigFromDeviceAtScanStart) Readout requires vortexParameters to be defined.voidsetReadNetCounts(boolean readNetCounts) voidsetReadRate(double readRate) Sets the rate at which data is read in the Epics interfaceprotected voidsetReportInvalidROI(boolean reportInvalidROI) protected voidsetReturnFullSpectrum(boolean returnFullSpectrum) voidsetROIs(double[][] rois) Sets the ROIs of all the MCA.voidsetStatusRate(double statusRate) Sets the rate at which status is read in the Epics interfacevoidsetSumAllElementData(boolean sumAllElementData) voidsetUseConfigFileAtConfigure(boolean useConfigFileAtConfigure) voidsetUseLiveTime(boolean useLiveTime) voidstart()Start data acquisition in all MCA'svoidstop()Stop the current move/operation.static double[][]To aid debugging with mocks from javavoidReturns when operation carried out by moveTo has completedMethods inherited from class gda.device.detector.DetectorBase
asynchronousMoveTo, checkPositionValid, endCollection, getPosition, isBusy, prepareForCollection, 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, getInputNames, getLevel, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, rawGetPosition, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, throwExceptionIfInvalidTarget, toString, validateScannable, valueUnavailableString, 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
endCollection, getFileStructure, prepareForCollectionMethods 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, atScanEnd, atScanLineEnd, atScanLineStart, checkPositionValid, getInputNames, getLevel, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, isBusy, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, toFormattedString
-
Constructor Details
-
XmapDetectorFromEpicsMca
public XmapDetectorFromEpicsMca()
-
-
Method Details
-
isUseConfigFileAtConfigure
public boolean isUseConfigFileAtConfigure() -
setUseConfigFileAtConfigure
public void setUseConfigFileAtConfigure(boolean useConfigFileAtConfigure) -
isPrefixExtraNameWithDetElement
public boolean isPrefixExtraNameWithDetElement() -
setPrefixExtraNameWithDetElement
public void setPrefixExtraNameWithDetElement(boolean prefixExtraNameWithDetElement) - Parameters:
prefixExtraNameWithDetElement- If true the extraName for each roi is set to detector name + "_" + roiName. If false the extraName is simply the name of the roi. Default is true if true
-
isReadConfigFromDeviceAtScanStart
public boolean isReadConfigFromDeviceAtScanStart() -
setReadConfigFromDeviceAtScanStart
public void setReadConfigFromDeviceAtScanStart(boolean readConfigFromDeviceAtScanStart) Readout requires vortexParameters to be defined. If readConfigFromDeviceAtScanStart is true then this parameter is set aat atScanStart by reading from the device. This allows roi's to be defined ont he device itself rather than having to edit the configFile. Default value is false;- Parameters:
readConfigFromDeviceAtScanStart-
-
isReportInvalidROI
protected boolean isReportInvalidROI() -
setReportInvalidROI
protected void setReportInvalidROI(boolean reportInvalidROI) -
isReturnFullSpectrum
protected boolean isReturnFullSpectrum() -
setReturnFullSpectrum
protected void setReturnFullSpectrum(boolean returnFullSpectrum) -
toJavaNativeDoubleArray
To aid debugging with mocks from java -
setAnalysers
-
getAnalysers
-
getConfigFileName
-
setConfigFileName
-
setSumAllElementData
public void setSumAllElementData(boolean sumAllElementData) -
isSumAllElementData
public boolean isSumAllElementData() -
setReadNetCounts
public void setReadNetCounts(boolean readNetCounts) -
isReadNetCounts
public boolean isReadNetCounts() -
setUseLiveTime
public void setUseLiveTime(boolean useLiveTime) -
isUseLiveTime
public boolean isUseLiveTime() -
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
-
getNumberOfMca
Description copied from interface:XmapDetectorReturns the number of MCAs currently connected to the XMap detector- Specified by:
getNumberOfMcain interfaceXmapDetector- Returns:
- number of MCA
- Throws:
DeviceException
-
loadConfigurationFromFile
- Throws:
Exception
-
configureHardware
- Throws:
Exception
-
readConfigFile
- Throws:
Exception
-
getChannelLabels
Description copied from interface:XmapDetectorLightly to be only implemented on the server.- Specified by:
getChannelLabelsin interfaceXmapDetector- Returns:
- the labels for the channels defined by the user.
-
clear
Description copied from interface:XmapDetectorClear all MCA's- Specified by:
clearin interfaceXmapDetector- Throws:
DeviceException
-
start
Description copied from interface:XmapDetectorStart data acquisition in all MCA's- Specified by:
startin interfaceXmapDetector- Throws:
DeviceException
-
clearAndStart
Description copied from interface:XmapDetectorClears all MCAs and starts data collection- Specified by:
clearAndStartin interfaceXmapDetector- Throws:
DeviceException
-
setCollectionTime
Description copied from interface:DetectorSets the collection time, in seconds, to be used during the next call of collectData.- Specified by:
setCollectionTimein interfaceDetector- Overrides:
setCollectionTimein classDetectorBase- Parameters:
collectionTime- the collection time in seconds- Throws:
DeviceException
-
getCollectionTime
public double getCollectionTime()Description copied from interface:DetectorReturns the time, in seconds, the detector collects for during the next call to collectData()- Specified by:
getCollectionTimein interfaceDetector- Overrides:
getCollectionTimein classDetectorBase- Returns:
- double
-
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.- Specified by:
collectDatain interfaceDetector- Throws:
DeviceException
-
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- Specified by:
stopin interfaceXmapDetector- Overrides:
stopin classScannableBase- Throws:
DeviceException- See Also:
-
setNumberOfBins
Description copied from interface:XmapDetectorSets maximum numbers of bins/channels to use for spectrum acquisition in each MCA- Specified by:
setNumberOfBinsin interfaceXmapDetector- Parameters:
numberOfBins-- Throws:
DeviceException
-
getNumberOfBins
Description copied from interface:XmapDetectorReturns current number of Bins/channels for spectrum acquisition in each MCA- Specified by:
getNumberOfBinsin interfaceXmapDetector- Returns:
- numberOfBins
- Throws:
DeviceException
-
setAcquisitionTime
Description copied from interface:XmapDetectorTells the detector for how many seconds to acquire data- Specified by:
setAcquisitionTimein interfaceXmapDetector- Parameters:
time-- Throws:
DeviceException
-
getAcquisitionTime
Description copied from interface:XmapDetectorReturns the time for which the detector is set to acquire data- Specified by:
getAcquisitionTimein interfaceXmapDetector- Returns:
- time
- Throws:
DeviceException
-
getRealTime
This implementation simply returns the acquisition time. The analyser will determine which to use when its setCollectionTime method is called.- Specified by:
getRealTimein interfaceXmapDetector- Returns:
- real time
- 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.- Specified by:
createsOwnFilesin interfaceDetector- Returns:
- true if readout() returns filenames
- Throws:
DeviceException
-
getStatus
Description copied from interface:XmapDetectorReturns the status of the detector- Specified by:
getStatusin interfaceDetector- Specified by:
getStatusin interfaceXmapDetector- Returns:
- Detector.IDLE/BUSY
- Throws:
DeviceException
-
getData
Description copied from interface:XmapDetectorReturns the data array of all the MCAs- Specified by:
getDatain interfaceXmapDetector- Returns:
- array of data arrays
- Throws:
DeviceException
-
getData
Description copied from interface:XmapDetectorReturns the data array of the specified MCA- Specified by:
getDatain interfaceXmapDetector- Parameters:
mcaNumber-- Returns:
- data array
- Throws:
DeviceException
-
getDataDimensions
Description copied from class:DetectorBaseDefault which should be overridden by subclasses.- Specified by:
getDataDimensionsin interfaceDetector- Overrides:
getDataDimensionsin classDetectorBase- Returns:
- the dimensions of the data object returned by the
Detector.readout()method - Throws:
DeviceException- See Also:
-
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:
-
readout
Description copied from interface:DetectorReturns the latest data collected. The size of the Object returned must be consistent with the values returned by getDataDimensions and getExtraNames.If
LocalProperties.GDA_SCAN_CONCURRENTSCAN_READOUT_CONCURRENTLYis true then motors may be moved while the detector readouts. The value returned must not be effected by any concurrent motor or shutter movements. SeeDetector.waitWhileBusy()andConcurrentScan. Readout must block until the detector is ready to respond quickly toDetector.collectData()again.- Specified by:
readoutin interfaceDetector- Specified by:
readoutin interfaceNexusDetector- Returns:
- the data collected
- Throws:
DeviceException
-
readoutScalerData
Description copied from interface:XmapDetectorReads out the scaler data of the roi counts, corrects for deadtime and returns the sum.- Specified by:
readoutScalerDatain interfaceXmapDetector- Returns:
- The FF data
- Throws:
DeviceException
-
getROIsSum
Description copied from interface:XmapDetectorReturns the sum of the corresponding ROIs of all the MCA. For e.g if the MCAs have three ROIs each say R0, R1 and R2. This method sums up the R0 of all the MCA R1 of all the MCAs and so on- Specified by:
getROIsSumin interfaceXmapDetector- Returns:
- ROI sum array
- Throws:
DeviceException
-
setNthROI
Description copied from interface:XmapDetectorSets a ROI for all of the MCAs- Specified by:
setNthROIin interfaceXmapDetector- Parameters:
rois- This array length should be same as the number of MCAsroiIndex-- Throws:
DeviceException
-
setROIs
Description copied from interface:XmapDetectorSets the ROIs of all the MCA. Use this method only if you want to set all the MCA with the same ROIs.To set different ROI for each of the MCA use setNthROI method.- Specified by:
setROIsin interfaceXmapDetector- Parameters:
rois- array. Each roi should have a low and high value.- Throws:
DeviceException
-
getNumberOfROIs
Description copied from interface:XmapDetectorReturns the total number of ROIs currently set- Specified by:
getNumberOfROIsin interfaceXmapDetector- Returns:
- number of ROIs
- Throws:
DeviceException
-
getROICounts
Description copied from interface:XmapDetectorGets the count for each mca for a given ROI.- Specified by:
getROICountsin interfaceXmapDetector- Parameters:
iRoi-- Returns:
- double[] of counts per mca for this roi
- Throws:
DeviceException
-
getExtraNames
Description copied from interface:ScannableAdditional names for extra values that returned by getPosition().- Specified by:
getExtraNamesin interfaceScannable- Overrides:
getExtraNamesin classScannableBase- Returns:
- array of names of the extra elements if the array returned by getPosition is larger than the array required by moveTo
-
getOutputFormat
Description copied from interface:ScannableReturns an array of strings which are the format strings to use when pretty printing parts of the output- Specified by:
getOutputFormatin interfaceScannable- Overrides:
getOutputFormatin classScannableBase- Returns:
- string array
-
getDescription
- Specified by:
getDescriptionin interfaceDetector- Overrides:
getDescriptionin classDetectorBase- Returns:
- A description of the detector.
- Throws:
DeviceException
-
getDetectorID
- Specified by:
getDetectorIDin interfaceDetector- Overrides:
getDetectorIDin classDetectorBase- Returns:
- A identifier for this detector.
- Throws:
DeviceException
-
getDetectorType
- Specified by:
getDetectorTypein interfaceDetector- Overrides:
getDetectorTypein classDetectorBase- Returns:
- The type of detector.
- Throws:
DeviceException
-
setStatusRate
Description copied from interface:XmapDetectorSets the rate at which status is read in the Epics interface- Specified by:
setStatusRatein interfaceXmapDetector- Parameters:
statusRate-- Throws:
DeviceException
-
getStatusRate
Description copied from interface:XmapDetectorReturns the current set rate at which status is read in the Epics interface- Specified by:
getStatusRatein interfaceXmapDetector- Returns:
- status rate
- Throws:
DeviceException
-
setReadRate
Description copied from interface:XmapDetectorSets the rate at which data is read in the Epics interface- Specified by:
setReadRatein interfaceXmapDetector- Parameters:
readRate-- Throws:
DeviceException
-
getReadRate
Description copied from interface:XmapDetectorReturns the current rate at which data is read in the Epics interface- Specified by:
getReadRatein interfaceXmapDetector- Returns:
- readRate
- Throws:
DeviceException
-
createVortexParameters
- Throws:
Exception
-
waitWhileBusy
Description copied from class:ScannableBaseReturns when operation carried out by moveTo has completed If this is to be overriden, isBusy must also be valid. Although the pos and scan command currently use this method to determine if the Scannable is busy, this must not be relied upon.- Specified by:
waitWhileBusyin interfaceDetector- Specified by:
waitWhileBusyin interfaceScannable- Overrides:
waitWhileBusyin classScannableBase- Throws:
DeviceExceptionInterruptedException
-