Package gda.data.scan.nexus.device
Class DummyNexusDetector
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.detector.DetectorBase
gda.device.detector.DummyDetector
gda.data.scan.nexus.device.DummyNexusDetector
- All Implemented Interfaces:
Detector,NexusDetector,Device,Scannable,Configurable,Findable,gda.observable.IObservable,Serializable
A simple implementation of
NexusDetector that produces an INexusTree with
three main (primary) datasets of different ranks:- data: a two-dimensional dataset (i.e. image);
- spectrum: a one-dimensional dataset;
- value_: a scalar dataset (i.e. single value). The underscore prevents a name clash with a dataset from a dummy monitor in some tests;
- external: a two-dimensional dataset written to an external file.
-
The class was developed in order to test writing the
INexusTreestructure produced by aNexusDetectorbyNexusScanDataWriterandNexusDataWriter.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final double[]static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final longstatic final doublestatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String[]static final Stringstatic final doublestatic final Stringstatic final int[]static final Stringstatic final intstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final StringFields inherited from class gda.device.detector.DummyDetector
randomFields 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 TypeMethodDescriptionprotected Objectreadout()Returns the latest data collected.static voidsaveNexusFile(TreeFile nexusTree) voidsetOutputDir(String outputDir) voidsetPrioritisedDataFieldName(String prioritisedDataFieldName) voidsetScanDimensions(int[] scanDimensions) Methods inherited from class gda.device.detector.DummyDetector
collectData, configure, createsOwnFiles, getDescription, getDetectorID, getDetectorType, getMaxDataValue, getStatus, reconfigure, setMaxDataValue, setRandomSeed, waitWhileBusyMethods 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, 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, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gda.factory.Configurable
configure, isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Detector
collectData, createsOwnFiles, endCollection, getCollectionTime, getDataDimensions, getDescription, getDetectorID, getDetectorType, getFileStructure, getStatus, prepareForCollection, setCollectionTime, waitWhileBusyMethods 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, atScanStart, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, isBusy, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, toFormattedString
-
Field Details
-
DETECTOR_NAME
- See Also:
-
EXTERNAL_NEXUS_FILE_NAME
- See Also:
-
FIELD_NAME_SPECTRUM
- See Also:
-
FIELD_NAME_VALUE
- See Also:
-
FIELD_NAME_EXTERNAL
- See Also:
-
SPECTRUM_SIZE
public static final int SPECTRUM_SIZE- See Also:
-
IMAGE_SIZE
public static final int[] IMAGE_SIZE -
NOTE_TEXT
- See Also:
-
DETECTOR_NUMBER
public static final long DETECTOR_NUMBER- See Also:
-
SERIAL_NUMBER
- See Also:
-
GAIN_SETTING
- See Also:
-
DIAMETER
public static final double DIAMETER- See Also:
-
DIAMETER_UNITS
- See Also:
-
STRING_ATTR_NAME
- See Also:
-
INT_ATTR_NAME
- See Also:
-
FLOAT_ATTR_NAME
- See Also:
-
ARRAY_ATTR_NAME
- See Also:
-
STRING_ATTR_VALUE
- See Also:
-
INT_ATTR_VALUE
public static final int INT_ATTR_VALUE- See Also:
-
FLOAT_ATTR_VALUE
public static final double FLOAT_ATTR_VALUE- See Also:
-
ARRAY_ATTR_VALUE
public static final double[] ARRAY_ATTR_VALUE -
COLLECTION_NAME
- See Also:
-
COLLECTION_FIELD_NAME
- See Also:
-
COLLECTION_ATTR_NAME
- See Also:
-
COLLECTION_FIELD_VALUE
- See Also:
-
COLLECTION_ATTR_VALUE
- See Also:
-
FIELD_NAMES_EXTRA_NAMES
-
FIELD_NAME_IMAGE_X
- See Also:
-
FIELD_NAME_IMAGE_Y
- See Also:
-
-
Constructor Details
-
DummyNexusDetector
public DummyNexusDetector()
-
-
Method Details
-
setScanDimensions
public void setScanDimensions(int[] scanDimensions) -
setOutputDir
-
setPrioritisedDataFieldName
-
getPrimaryFieldNames
-
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- Overrides:
readoutin classDummyDetector- Returns:
- the data collected
- Throws:
DeviceException
-
acquireData
- Overrides:
acquireDatain classDummyDetector
-
saveNexusFile
- Throws:
NexusException
-