Class FrameCollectingScannable
- All Implemented Interfaces:
Configurable,INexusDevice<NXdetector>,IActivatable,IBoundable<Object>,ILevel,INameable,IScanAttributeContainer,IScannable<Object>,ITimeoutable,ITolerable<Object>,IPositionListenable
- Direct Known Subclasses:
CalibrationFrameCollector
AcquireRequest (i.e. capture a single frame), then restore the beamline to its previous configuration.The snapshot is then linked to from the overall NeXus file under /entry/instrument/ as an NXdetector. The detector parameters for the frame collection are specified via a
FrameRequestDocument which must be set in advance.-
Field Summary
Fields inherited from class org.eclipse.scanning.api.AbstractScannable
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Call to terminate a movement before it is complete, for example when ScannablePositioner#abort is called due to an exception with another IScannable's movementvoidPerform operations that must be done after Spring initialisation i.e.voidconfigureAndCollect(ScanModel scanModel) This is invoked shortly before the main scan is configuredprotected StringgetMalcolmDetectorName(IRunnableDevice<? extends IDetectorModel> detector) Returns the object provider required for writing correct NeXus files.The position is the value which should be: 1.booleanIndicates whether this object should be configured at startup.booleanChecks to see if the object is already configured.voidRe-initialisation of values and states.voidsetBeamlineConfiguration(Map<String, Object> beamlineConfiguration) A map describing the beamline configuration required for the frame collection.voidsetFrameRequestDocument(FrameRequestDocument frameRequestDocument) This must be set prior before the frame is collected.voidsetMalcolmDetectorNames(Map<String, String> malcolmDetectorNames) voidsetNexusFieldName(String nexusFieldName) Name by which the frame data is linked in the main Nexus filesetPosition(Object value, IPosition position) Moves to the position required, blocking until it is complete.voidsetUseDetectorTable(boolean useDetectorTable) Methods inherited from class org.eclipse.scanning.api.AbstractScannable
addPositionListener, getDeviceInformation, getLevel, getMaximum, getMinimum, getModel, getScanAttribute, getScanAttributeNames, getTolerance, isActivated, register, removePositionListener, setActivated, setLevel, setMaximum, setMinimum, setModel, setPublisher, setScanAttribute, setToleranceMethods inherited from class org.eclipse.scanning.api.AbstractNameableTimeoutable
equals, getTimeout, hashCode, setTimeout, toStringMethods inherited from class org.eclipse.scanning.api.AbstractNameable
getName, setNameMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.scanning.api.IBoundable
getPermittedValuesMethods inherited from interface org.eclipse.dawnsci.nexus.INexusDevice
getCustomNexusModification, getName, getNexusProviders, registerMethods inherited from interface org.eclipse.scanning.api.scan.event.IPositionListenable
getPositioner, setPositionerMethods inherited from interface org.eclipse.scanning.api.IScannable
getUnit, setPositionMethods inherited from interface org.eclipse.scanning.api.ITimeoutable
getTimeout, setTimeout
-
Constructor Details
-
FrameCollectingScannable
public FrameCollectingScannable()
-
-
Method Details
-
configureAndCollect
This is invoked shortly before the main scan is configured- Throws:
ScanningException
-
setFrameRequestDocument
This must be set prior before the frame is collected. If this is to be a Malcolm scan, malcolmDetectorName must also be set (the name of the real detector wrapped in the Malcolm scan). -
getNexusProvider
Description copied from interface:INexusDeviceReturns the object provider required for writing correct NeXus files.In this method you should prepare the
LazyDatasets the device will fill during the scan. You can also write out static device metadata, which will not change during the scan.Use the methods on
NexusNodeFactoryto create a NeXus object which matches the device e.g. aNXdetector.final NXdetector detector = NexusNodeFactory.createNXdetector();On the detector object you can create
In this method you can also write static metadata such as the detector exposure e.g.LazyDatasets and keep references which you can later use during the scan to write data. e.g.imageData = detector.initializeLazyDataset(NXdetector.NX_DATA, info.getRank() + 2, Double.class);You should also set chunking on theLazyDatasets you create e.g.imageData.setChunking(info.createChunk(detectorXSize, detectorYSize));.detector.setField("exposure_time", model.getExposure());. Or static datasets such as the image axis datadetector.setDataset("image_x_axis", DatasetFactory.createLinearSpace(DoubleDataset.class, minX, maxX, xPoints));For fields that are defined in the NXDL base class definition for the returned nexus object, a setXXX or setXXXScalar method may be used as appropriate, e.g.detector.setLocalName(DatasetFactory.createFromObject("my detector"));ordetector.setLocalNameScalar("my detector");If this device is a 'metadata scannable', then the device should write its data at this point directly into the returned nexus object. This can be done with the
NXobject.setField(String, Object)method, or thesetXXXScalarmethods for fields defined in the appropriate NXDL base class definition.The default implementation of this method throws
UnsupportedOperationException. One of either this method orINexusDevice.getNexusProviders(NexusScanInfo)must be overridden to create and return the nexus object(s) for thisINexusDevice.- Specified by:
getNexusProviderin interfaceINexusDevice<NXdetector>- Parameters:
info- information about the scan which can be useful when creating datasets e.g.info.getRank()- Returns:
- The
NXobjectcreated using thenodeFactoryto represent this device - Throws:
NexusException- if the nexus object could not be created for any reason
-
setBeamlineConfiguration
A map describing the beamline configuration required for the frame collection. The previous configuration will be restored after the frame is collected. May be empty if no particular configuration is required (but notnull). -
setNexusFieldName
Name by which the frame data is linked in the main Nexus file -
getMalcolmDetectorName
-
setMalcolmDetectorNames
-
setUseDetectorTable
public void setUseDetectorTable(boolean useDetectorTable) -
configure
Description copied from interface:ConfigurablePerform operations that must be done after Spring initialisation i.e. anything that goes beyond setting member variables.- Specified by:
configurein interfaceConfigurable- 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- Throws:
FactoryException
-
isConfigured
public boolean isConfigured()Description copied from interface:ConfigurableChecks to see if the object is already configured.- Specified by:
isConfiguredin interfaceConfigurable- Returns:
- return
trueif configuredfalseotherwise
-
isConfigureAtStartup
public boolean isConfigureAtStartup()Description copied from interface:ConfigurableIndicates whether this object should be configured at startup.Moved from ConditionallyConfigurable which has been deleted
- Specified by:
isConfigureAtStartupin interfaceConfigurable
-
getPosition
Description copied from interface:IBoundableThe position is the value which should be: 1. Greater than or equal to the lower 2. Less than or equal to the upper. 3. One of the permitted values, if they are not null.- Specified by:
getPositionin interfaceIBoundable<Object>- Returns:
- Throws:
ScanningException- if the position cannot be read for any reason
-
setPosition
Description copied from interface:IScannableMoves to the position required, blocking until it is complete. Similar to moveTo(...) in GDA8- Specified by:
setPositionin interfaceIScannable<Object>- Parameters:
value- that this scalar should take.position- if within in a scan or null if not within a scan.- Returns:
- the new position attained by the device, if known. (Saves additional call to getPosition()) If not know the demand value is returned. NOTE if null is returned the system will call getPosition() again.
- Throws:
ScanningException
-
abort
Description copied from interface:IScannableCall to terminate a movement before it is complete, for example when ScannablePositioner#abort is called due to an exception with another IScannable's movement- Specified by:
abortin interfaceIScannable<Object>- Throws:
ScanningExceptionInterruptedException
-