Package gda.device.detector.analyser
Class EpicsMCA
- All Implemented Interfaces:
Analyser,Detector,IEpicsMCA,Device,Scannable,InitializationListener,Configurable,Findable,gda.observable.IObservable,Serializable
Class to communicate with an epics MCA record. The MCA record controls and acquires data from a multichannel analyser
(MCA).
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields 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 TypeMethodDescriptionvoidaddRegionOfInterest(int regionIndex, double regionLow, double regionHigh, int regionBackground, double regionPreset, String regionName) Method to add a new region of interest to the analyservoidclear()Method to erase the analyzer data, sets all channels to zerovoidClears the mca, but does not return until the clear has been done.voidTells 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.booleanReturns a value which indicates whether the detector creates its own files.voiddeleteRegionOfInterest(int regionIndex) Method to remove a region of interest from the analyservoidActivates the MCA using the Erase invalid input: '&' Start button.getAttribute(String attributeName) Get the value of the specified attributeReturns calibration parameters for the analyser.getData()Method to get data from the analyserdoubleGets the Dwell Time (DWEL).Method to get the elapsed parameters for the analyser Not sure if it is specific to MCAGets the MCA record name.longMethod to read the number of channels for the analyserintMethod to read the number of regions for the analyserMethod to read the preset parameters for the analyserMethod to get regions of interest for the analyserdouble[][]Method to return net and total counts of each region of interest in the analyserlongMethod to return the current sequence number of the analyser.intReturns the current collecting state of the device.voidCalled when all critical channels are connected.readout()Returns the latest data collected.voidsetCalibration(Object calibrate) Sets the calibration parameters for the analyser.voidsetCalibrationName(String calibrationName) voidWrites data to the AnalyservoidsetDeviceName(String deviceName) voidsetDwellTime(double time) Sets the dwell time (DWEL)voidsetEpicsMcaRecordName(String epicsMcaRecordName) Sets the MCA record name.voidsetMcaRecordName(String name) Sets the MCA Record's Name.voidsetNumberOfChannels(long channels) Set number of ChannelsvoidsetNumberOfRegions(int numberOfRegions) Set number of regionsvoidsetPresets(Object data) Sets the preset parameters for the AnalyservoidSets the PV name used by this object.voidsetRegionsOfInterest(Object highLow) Sets the regions of interest for the AnalyservoidsetSequence(long sequence) Sets sequence for the AnalyservoidMethod to turn on acquisition of the analyservoidMethod to turn off acquisition of the analyserMethods inherited from class gda.device.detector.DetectorBase
asynchronousMoveTo, checkPositionValid, endCollection, getCollectionTime, getDataDimensions, 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, atScanStart, 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, 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, getCollectionTime, getDataDimensions, getFileStructure, prepareForCollection, setCollectionTime, 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, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, isBusy, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, toFormattedString
-
Field Details
-
channelToEnergyPrefix
- See Also:
-
numberOfChannelsAttr
- See Also:
-
energyToChannelPrefix
- See Also:
-
-
Constructor Details
-
EpicsMCA
public EpicsMCA()Constructor. -
EpicsMCA
Constructor taking a PV name- Parameters:
name- String, the PV name
-
-
Method Details
-
setPvName
Sets the PV name used by this object.- Parameters:
pvName- the PV name
-
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
-
addRegionOfInterest
public void addRegionOfInterest(int regionIndex, double regionLow, double regionHigh, int regionBackground, double regionPreset, String regionName) throws DeviceException Description copied from interface:AnalyserMethod to add a new region of interest to the analyser- Specified by:
addRegionOfInterestin interfaceAnalyser- Parameters:
regionIndex- the region numberregionLow- the start value of regionregionHigh- the end value of regionregionBackground- the region backgroundregionPreset- the region presetregionName- the region name- Throws:
DeviceException
-
clear
Description copied from interface:AnalyserMethod to erase the analyzer data, sets all channels to zero- Specified by:
clearin interfaceAnalyser- Throws:
DeviceException
-
clearWaitForCompletion
Clears the mca, but does not return until the clear has been done.- Specified by:
clearWaitForCompletionin interfaceIEpicsMCA- Throws:
DeviceException
-
deleteRegionOfInterest
Description copied from interface:AnalyserMethod to remove a region of interest from the analyser- Specified by:
deleteRegionOfInterestin interfaceAnalyser- Parameters:
regionIndex- the region number- Throws:
DeviceException
-
getCalibrationParameters
Description copied from interface:AnalyserReturns calibration parameters for the analyser. Return calibration offset, calibration slope, calibration quadratic , two theta angle of the detector.- Specified by:
getCalibrationParametersin interfaceAnalyser- Returns:
- calibration parameters
- Throws:
DeviceException
-
getData
Description copied from interface:AnalyserMethod to get data from the analyser- Specified by:
getDatain interfaceAnalyser- Returns:
- the analyser data
- Throws:
DeviceException
-
getElapsedParameters
Description copied from interface:AnalyserMethod to get the elapsed parameters for the analyser Not sure if it is specific to MCA- Specified by:
getElapsedParametersin interfaceAnalyser- Returns:
- the elapsed paramters
- Throws:
DeviceException
-
getDwellTime
Gets the Dwell Time (DWEL).- Specified by:
getDwellTimein interfaceIEpicsMCA- Returns:
- Dwell Time
- Throws:
DeviceException
-
getNumberOfRegions
Description copied from interface:AnalyserMethod to read the number of regions for the analyser- Specified by:
getNumberOfRegionsin interfaceAnalyser- Returns:
- the number of regions
- Throws:
DeviceException
-
getPresets
Description copied from interface:AnalyserMethod to read the preset parameters for the analyser- Specified by:
getPresetsin interfaceAnalyser- Returns:
- the preset parameters
- Throws:
DeviceException
-
getRegionsOfInterest
Description copied from interface:AnalyserMethod to get regions of interest for the analyser- Specified by:
getRegionsOfInterestin interfaceAnalyser- Returns:
- the regions of interest
- Throws:
DeviceException
-
getRegionsOfInterestCount
Description copied from interface:AnalyserMethod to return net and total counts of each region of interest in the analyser- Specified by:
getRegionsOfInterestCountin interfaceAnalyser- Returns:
- two dimensional array of net and total counts
- Throws:
DeviceException
-
getSequence
Description copied from interface:AnalyserMethod to return the current sequence number of the analyser. Might be specific to MCAs- Specified by:
getSequencein interfaceAnalyser- Returns:
- the current sequence number
- Throws:
DeviceException
-
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
-
setCalibration
Description copied from interface:AnalyserSets the calibration parameters for the analyser.- Specified by:
setCalibrationin interfaceAnalyser- Parameters:
calibrate- the calibration parameters to set- Throws:
DeviceException
-
setData
Description copied from interface:AnalyserWrites data to the Analyser- Specified by:
setDatain interfaceAnalyser- Parameters:
data- the data to write back to the analyser- Throws:
DeviceException
-
setDwellTime
Sets the dwell time (DWEL)- Specified by:
setDwellTimein interfaceIEpicsMCA- Parameters:
time-- Throws:
DeviceException
-
setNumberOfRegions
Description copied from interface:AnalyserSet number of regions- Specified by:
setNumberOfRegionsin interfaceAnalyser- Parameters:
numberOfRegions- the number of regions to set- Throws:
DeviceException
-
setPresets
Description copied from interface:AnalyserSets the preset parameters for the Analyser- Specified by:
setPresetsin interfaceAnalyser- Parameters:
data- the preset parameters- Throws:
DeviceException
-
setRegionsOfInterest
Sets the regions of interest for the Analyser- Specified by:
setRegionsOfInterestin interfaceAnalyser- Parameters:
highLow- the upper and lower bounds of the region- Throws:
DeviceException- See Also:
-
setSequence
Description copied from interface:AnalyserSets sequence for the Analyser- Specified by:
setSequencein interfaceAnalyser- Parameters:
sequence- the sequence- Throws:
DeviceException
-
eraseStartAcquisition
Activates the MCA using the Erase invalid input: '&' Start button.- Specified by:
eraseStartAcquisitionin interfaceIEpicsMCA- Throws:
DeviceException
-
startAcquisition
Description copied from interface:AnalyserMethod to turn on acquisition of the analyser- Specified by:
startAcquisitionin interfaceAnalyser- Throws:
DeviceException
-
stopAcquisition
Description copied from interface:AnalyserMethod to turn off acquisition of the analyser- Specified by:
stopAcquisitionin interfaceAnalyser- Throws:
DeviceException
-
initializationCompleted
public void initializationCompleted()Description copied from interface:InitializationListenerCalled when all critical channels are connected.- Specified by:
initializationCompletedin interfaceInitializationListener
-
setMcaRecordName
Sets the MCA Record's Name.- Parameters:
name-
-
getNumberOfChannels
Description copied from interface:AnalyserMethod to read the number of channels for the analyser- Specified by:
getNumberOfChannelsin interfaceAnalyser- Returns:
- the number of channels
- Throws:
DeviceException
-
setNumberOfChannels
Description copied from interface:AnalyserSet number of Channels- Specified by:
setNumberOfChannelsin interfaceAnalyser- Parameters:
channels- the number of channels to set- 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.- Specified by:
collectDatain interfaceDetector- Throws:
DeviceException
-
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
-
getEpicsMcaRecordName
Gets the MCA record name.- Returns:
- the Epics MCA record name.
-
setEpicsMcaRecordName
Sets the MCA record name.- Parameters:
epicsMcaRecordName-
-
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
-
getCalibrationName
- Returns:
- converter name
-
setCalibrationName
- Parameters:
calibrationName-
-
getDeviceName
- Returns:
- device name
-
setDeviceName
- Parameters:
deviceName-
-
getPvName
- Returns:
- PV Name
-
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
-