Class Xmap
- All Implemented Interfaces:
Detector,Device,Scannable,XmapDetector,Configurable,Findable,gda.observable.IObservable,gda.observable.IObserver,Serializable,DetectorWithConfigurationFile
- Direct Known Subclasses:
XmapwithSlaveMode
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected XmapControllerdoubleThese are the fit parameters used in dead time correction.protected booleanprotected Timerprotected VortexParametersFields 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 TypeMethodDescriptionvoidHook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred.voidCalled for every Scannable at the end of a group of nested scans (or a single scan if that is the case).voidCalled 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.protected voidReturns the region of interest names based on the first elements ROI names.protected voidWorks for different regions in each element.booleanReturns a value which indicates whether the detector creates its own files.doubleReturns the time for which the detector is set to acquire datagetAttribute(String attributeName) Get the value of the specified attributeRetuns the label or 'ROI N' if the user did not specify an roi for the channel.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.double[]getDeadTimeCorrectedROICounts(int roiIndex) double[]protected doublegetK(int element) Reads the fast filter rate for the element and calculates the K scaling factor used in the dead time correction.getName()Get the name of the deviceintReturns 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 setdoubleReturns the current rate at which data is read in the Epics interfacedoubleReturns the elapsed real time after a read status operationdouble[]getROICounts(int roiIndex) Returns a count for each mca for a given roi number For instance if roi=0 the first roi.double[]This method cannot currently deal with elements which are disabled.intReturns the status of the detectordoubleReturns the current set rate at which status is read in the Epics interfacegetTfg()booleanvoidCall this method to ask the detector to load the current template XML file.readout()Returns the latest data collected.doubleReads out a sum of all regions and dead time corrects as it goes.Double[]voidRe-initialisation of values and states.voidsetAcquisitionTime(double time) Tells the detector for how many seconds to acquire datavoidsetCollectionTime(double collectionTime) Sets the collection time, in seconds, to be used during the next call of collectData.voidsetConfigFileName(String configFileName) voidsetController(XmapController controller) voidsetEventProcessingTimes(List<Double> eventProcessingTimes) voidSet the name of the devicevoidsetNthROI(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 MCAvoidsetNumberOfMca(int numberOfMca) voidsetNumberOfROIs(int numberOfROIs) voidsetParameters(VortexParameters parameters) voidsetParameters(VortexParameters parameters, boolean push) voidsetReadRate(double readRate) Sets the rate at which data is read in the Epics interfacevoidsetReadRate(String value) sets a new read update rate for DlsMcsSIS3820.voidsetROI(double[][] rois, int mcaIndex) voidsetROIs(double[][] rois) Sets the ROIs of all the MCA.voidsetSaveRawSpectrum(boolean saveawSpectrum) voidsetStatusRate(double statusRate) Sets the rate at which status is read in the Epics interfacevoidsetStatusRate(String value) sets a new status update ratevoidvoidsetXmapControllerName(String xmapControllerName) voidstart()Start data acquisition in all MCA'svoidstop()Stop the current move/operation.voidvoidMethods 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__, 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, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setAttribute, setConfigureAtStartup, setProtectionLevelMethods inherited from class gda.factory.ConfigurableBase
isConfigured, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigureAtStartup, isConfiguredMethods inherited from interface gda.device.Detector
endCollection, getFileStructure, prepareForCollection, waitWhileBusyMethods inherited from interface gda.device.Device
close, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObserversMethods inherited from interface gda.device.Scannable
asynchronousMoveTo, 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
-
Field Details
-
elapsedRealTimeValue
public double elapsedRealTimeValue -
controller
-
vortexParameters
-
tfg
-
saveRawSpectrum
protected boolean saveRawSpectrum -
eventProcessingTimes
These are the fit parameters used in dead time correction. -
channelLabels
-
-
Constructor Details
-
Xmap
public Xmap()
-
-
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
-
reconfigure
Description copied from interface:ConfigurableRe-initialisation of values and states.Moved from Reconfigurable which has been deleted
- Specified by:
reconfigurein interfaceConfigurable- Overrides:
reconfigurein classConfigurableBase- Throws:
FactoryException
-
loadConfigurationFromFile
Call this method to ask the detector to load the current template XML file. If the detector was configured without a configFileName set, then nothing will happen.- Throws:
Exception
-
setParameters
- Throws:
Exception
-
setParameters
- Throws:
Exception
-
configureChannelLabels
Returns the region of interest names based on the first elements ROI names.- Parameters:
vp-
-
configureRegionsOfInterest
Works for different regions in each element.- Parameters:
vp-- Throws:
Exception
-
getChannelLabels
Retuns the label or 'ROI N' if the user did not specify an roi for the channel.- Specified by:
getChannelLabelsin interfaceXmapDetector- Returns:
- the labels for the channels defined by the user.
-
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
-
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
-
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:
-
atScanEnd
Description copied from class:ScannableBaseCalled for every Scannable at the end of a group of nested scans (or a single scan if that is the case).Note that this is only called if the Scan finishes normally, or has been requested to finish early. This will not be called if the scan finishes due to an exception of any kind. See
Scannable.atCommandFailure()Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atScanEndin interfaceScannable- Overrides:
atScanEndin classScannableBase- Throws:
DeviceException- See Also:
-
atCommandFailure
Description copied from class:ScannableBaseHook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred. However not called when the command is aborted using an InterruptionException. If a Scan is aborted then onlyScannable.stop()will be called by the Scan or pos command.Useful for telling Scannables which hold state during a scan for example, to reset themselves. Used for example by CoordinatedMotionScannables. This hook should be used not in the same way as the stop hook. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
- Specified by:
atCommandFailurein interfaceScannable- Overrides:
atCommandFailurein classScannableBase- Throws:
DeviceException- See Also:
-
getTfg
- Returns:
- Returns the tfg.
-
setTfg
- Parameters:
tfg- The tfg to set.
-
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- Returns:
- the data collected
- 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
-
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
-
getName
Description copied from class:DeviceBaseGet the name of the device- Specified by:
getNamein interfaceFindable- Overrides:
getNamein classDeviceBase- Returns:
- Returns the name.
-
setName
Description copied from class:DeviceBaseSet the name of the device- Specified by:
setNamein interfaceFindable- Overrides:
setNamein classDeviceBase- Parameters:
name- The name to set.
-
getNumberOfMca
public int getNumberOfMca()Description copied from interface:XmapDetectorReturns the number of MCAs currently connected to the XMap detector- Specified by:
getNumberOfMcain interfaceXmapDetector- Returns:
- number of MCA
-
setNumberOfMca
public void setNumberOfMca(int numberOfMca) - Parameters:
numberOfMca-
-
clear
Description copied from interface:XmapDetectorClear all MCA's- Specified by:
clearin interfaceXmapDetector- Throws:
DeviceException
-
clearAndStart
Description copied from interface:XmapDetectorClears all MCAs and starts data collection- Specified by:
clearAndStartin interfaceXmapDetector- 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
-
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
-
getData
Description copied from interface:XmapDetectorReturns the data array of the specified MCA- Specified by:
getDatain interfaceXmapDetector- Parameters:
mcaNumber-- Returns:
- data array
- 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
-
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
-
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
-
getRealTime
Description copied from interface:XmapDetectorReturns the elapsed real time after a read status operation- Specified by:
getRealTimein interfaceXmapDetector- Returns:
- real time
- 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
-
getXmapControllerName
- Returns:
- xmap controller name
-
setXmapControllerName
- Parameters:
xmapControllerName-
-
getController
- Returns:
- Returns the controller.
-
setController
- Parameters:
controller- The controller to set.
-
setAcquisitionTime
Description copied from interface:XmapDetectorTells the detector for how many seconds to acquire data- Specified by:
setAcquisitionTimein interfaceXmapDetector- Parameters:
time-- Throws:
DeviceException
-
setCollectionTime
public void setCollectionTime(double collectionTime) 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
-
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
-
setStatusRate
sets a new status update rate- Parameters:
value-- Throws:
DeviceException
-
setReadRate
sets a new read update rate for DlsMcsSIS3820.- Parameters:
value-- 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
-
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
-
start
Description copied from interface:XmapDetectorStart data acquisition in all MCA's- Specified by:
startin interfaceXmapDetector- 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:
-
getNumberOfROIs
public int getNumberOfROIs()Description copied from interface:XmapDetectorReturns the total number of ROIs currently set- Specified by:
getNumberOfROIsin interfaceXmapDetector- Returns:
- Returns the numberOfROIs.
-
setNumberOfROIs
public void setNumberOfROIs(int numberOfROIs) - Parameters:
numberOfROIs- The numberOfROIs to set.
-
getROIsSum
This method cannot currently deal with elements which are disabled.- Specified by:
getROIsSumin interfaceXmapDetector- Returns:
- ROI sum array
- Throws:
DeviceException
-
getROICounts
Returns a count for each mca for a given roi number For instance if roi=0 the first roi. If a given element is disabled the counts for it will be set to zero. Therefore when setting up ROIs this method should not be used. It is just for the data collection. The VortexParameters UI will plot all MCA counts.- Specified by:
getROICountsin interfaceXmapDetector- Parameters:
roiIndex-- Returns:
- double array of roi count for all mca
- 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
-
setROI
- Parameters:
rois-mcaIndex-- 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
-
update
- Specified by:
updatein interfacegda.observable.IObserver
-
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:
-
getConfigFileName
- Specified by:
getConfigFileNamein interfaceDetectorWithConfigurationFile- Returns:
- the configFileName
-
setConfigFileName
- Specified by:
setConfigFileNamein interfaceDetectorWithConfigurationFile- Parameters:
configFileName- the configFileName to set
-
readoutScalerData
Reads out a sum of all regions and dead time corrects as it goes.- Specified by:
readoutScalerDatain interfaceXmapDetector- Returns:
- The FF data
- Throws:
DeviceException
-
readoutScalers
- Throws:
DeviceException
-
getK
Reads the fast filter rate for the element and calculates the K scaling factor used in the dead time correction.- Parameters:
element-- Returns:
- K
- Throws:
DeviceException
-
getEventProcessingTimes
- Returns:
- Returns the eventProcessingTimes.
-
setEventProcessingTimes
- Parameters:
eventProcessingTimes- The eventProcessingTimes to set.
-
getDeadTimeCorrectedROICounts
- Parameters:
roiIndex-- Returns:
- deadtime corrected ROICounts
- Throws:
DeviceException
-
getAttribute
Description copied from interface:DeviceGet the value of the specified attribute- Specified by:
getAttributein interfaceDevice- Overrides:
getAttributein classDeviceBase- Parameters:
attributeName- is the name of the attribute- Returns:
- the value of the attribute as an Object type
- Throws:
DeviceException- if an attribute cannot be retrieved
-
getDeadtimeCorrectionFactors
- Throws:
DeviceException
-
isSaveRawSpectrum
public boolean isSaveRawSpectrum() -
setSaveRawSpectrum
public void setSaveRawSpectrum(boolean saveawSpectrum) -
waitWhileControllerBusy
- Throws:
DeviceExceptionInterruptedException
-
getCountRates
- Throws:
DeviceException
-