Package gda.device.detector.analyser
Class EpicsMCASimple
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.detector.DetectorBase
gda.device.detector.analyser.AnalyserBase
gda.device.detector.analyser.EpicsMCASimple
- All Implemented Interfaces:
Analyser,Detector,IEpicsMCA,IEpicsMCASimple,Device,Scannable,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). It connects to the Epics channels via an EpicsDevice whose name is set by the method setEpicsDeviceName.
Observers are notified of change of status - either MCAStatus.READY or MCAStatus.BUSY getStatus - returns either
Detector.IDLE or Detector.BUSY eraseStartAcquisition - starts acquisition
- 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 TypeMethodDescriptionvoidmethod used for testing onlyvoid_setRegionsOfInterestCount(int index, Double val) method used for testing onlyvoid_setRegionsOfInterestNetCount(int index, Double val) method used for testing onlyvoidaddRegionOfInterest(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 analyservoiddispose()Closes currently unused epics channels.voidActivates the MCA using the Erase invalid input: '&' Start button.getAttribute(String attributeName) Get the value of the specified attributeReturns calibration parameters for the analyser.intgetChannelForEnergy(double energy) getData()Method to get data from the analyserint[]Default which should be overridden by subclasses.doubleGets the Dwell Time (DWEL).Method to get the elapsed parameters for the analyser Not sure if it is specific to MCAdoublegetEnergyForChannel(int channel) intgetMcaPV()getNthRegionOfInterest(int regionIndex) Get specified region of interestlongMethod to read the number of channels for the analyserintMethod to read the number of regions for the analyserintMethod 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 analyserdoublegetRoiCount(int index) Counts for the specified channeldoublegetRoiNetCount(int index) Net counts for the specified ROIlongMethod to return the current sequence number of the analyser.intReturns the current collecting state of the device.booleanbooleanreadout()Returns the latest data collected.voidsetCalibration(EpicsMCACalibration calibrate) sets calibration fields for MCAvoidsetCalibration(Object calibrate) Sets the calibration parameters for the analyser.voidsetCalibrationName(String calibrationName) voidWrites data to the AnalyservoidsetDwellTime(double time) Sets the dwell time (DWEL)voidsetEpicsDevice(FindableEpicsDevice epicsDevice) voidsetEpicsDeviceName(String deviceName) voidSet PV for the MCAvoidsetNumberOfChannels(long channels) Set number of ChannelsvoidsetNumberOfRegions(int numberOfRegions) Set number of regionsvoidsetPresets(Object data) Sets the preset parameters for the AnalyservoidsetReadingDoneIfNotAquiring(boolean readingDoneIfNotAquiring) voidsetReadNetCounts(boolean readNetCounts) voidsetRegionsOfInterest(EpicsMCARegionOfInterest[] epicsMcaRois) Set the regions of interest for the MCAvoidsetRegionsOfInterest(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 analyservoidReturns when operation carried out by moveTo has completedMethods inherited from class gda.device.detector.DetectorBase
asynchronousMoveTo, checkPositionValid, endCollection, getCollectionTime, 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, 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, getFileStructure, prepareForCollection, setCollectionTimeMethods 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
-
Constructor Details
-
EpicsMCASimple
public EpicsMCASimple()
-
-
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
-
getEpicsDevice
-
setEpicsDevice
-
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
-
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:
-
dispose
Closes currently unused epics channels. Only run this if you suspect you need to as the next attempt to read a value will re-create the channel.- 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
-
getNumberOfValsPerRegionOfInterest
public int getNumberOfValsPerRegionOfInterest() -
getIndexForRawROI
public int getIndexForRawROI() -
isReadNetCounts
public boolean isReadNetCounts() -
setReadNetCounts
public void setReadNetCounts(boolean readNetCounts) -
getRoiCount
Description copied from interface:IEpicsMCASimpleCounts for the specified channel- Specified by:
getRoiCountin interfaceIEpicsMCASimple- Parameters:
index- Index of the channel- Returns:
- counts for this channel
- Throws:
DeviceException
-
getRoiNetCount
Description copied from interface:IEpicsMCASimpleNet counts for the specified ROI- Specified by:
getRoiNetCountin interfaceIEpicsMCASimple- Parameters:
index- Index of the ROI required- Returns:
- Counts for this ROI
- 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:IEpicsMCASimplesets calibration fields for MCA- Specified by:
setCalibrationin interfaceIEpicsMCASimple- Parameters:
calibrate- The calibration fields- 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
Description copied from interface:IEpicsMCASimpleSet the regions of interest for the MCA- Specified by:
setRegionsOfInterestin interfaceIEpicsMCASimple- Parameters:
epicsMcaRois- The ROIs to set- 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
-
_fireReadingDone
public void _fireReadingDone()method used for testing only -
_setRegionsOfInterestCount
method used for testing only- Throws:
DeviceException
-
_setRegionsOfInterestNetCount
method used for testing only- Throws:
DeviceException
-
getNthRegionOfInterest
Description copied from interface:IEpicsMCASimpleGet specified region of interest- Specified by:
getNthRegionOfInterestin interfaceIEpicsMCASimple- Parameters:
regionIndex- Index of the ROI required- Returns:
- a representation of the ROI
- Throws:
DeviceException
-
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
-
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
-
getEnergyForChannel
- Throws:
DeviceException
-
getChannelForEnergy
- Throws:
DeviceException
-
getCalibrationName
- Returns:
- converter name
-
setCalibrationName
- Parameters:
calibrationName-
-
getEpicsDeviceName
- Returns:
- String
-
setEpicsDeviceName
- Parameters:
deviceName-
-
getMcaPV
- Returns:
- String
-
setMcaPV
Description copied from interface:IEpicsMCASimpleSet PV for the MCA- Specified by:
setMcaPVin interfaceIEpicsMCASimple- Parameters:
mcaPV-
-
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
-
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
-
isReadingDoneIfNotAquiring
public boolean isReadingDoneIfNotAquiring() -
setReadingDoneIfNotAquiring
public void setReadingDoneIfNotAquiring(boolean readingDoneIfNotAquiring)
-