Package gda.data.scan.datawriter
Class NexusDataWriterConfiguration
java.lang.Object
gda.factory.FindableBase
gda.data.scan.datawriter.NexusDataWriterConfiguration
- All Implemented Interfaces:
Findable
An instance of this class holds some configuration about how to write nexus files for all scans
on this beamline, e.g. metadata scannables to be added to each scan, the location map to use, etc.
The preferred approach is to define this as a bean in Spring. If the deprecated static methods
are used in NexusDataWriter, an instance of this class is implicitly created via the ServiceHolder.
WARN: Invoking the static NDW methods with Spring is not compatible with defining a bean for this type in Spring
-
Constructor Summary
ConstructorsConstructorDescriptionDo not call this constructor directly except in test code. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMetadataScannable(String scannableName) voidaddNexusTemplate(String name, NexusTemplate nt) voidclear()Clears the contents of this configuration.static NexusDataWriterConfigurationReturns the location map, a map from scannable name to aScannableWriterthat writes the scannable with that name.Returns the metadata to be added to the nexus files.Returns the names of the configured metadata scannables.getMetadataScannablesForDetector(String detectorName) getMetadataScannablesForScannable(String scannableName) Returns the map of scannables per detectors, i.e.Returns the nexus template files that will applied to the nexus file as written.booleanremoveMetadataScannable(String scannableName) voidremoveNexusTemplate(String name) voidsetLocationMap(Map<String, ScannableWriter> locationMap) voidsetMetadata(Map<String, String> metadata) Allow arbitrary metadata to be added to nexus data files.voidsetMetadataScannables(Set<String> metadataScannables) voidsetMetadataScannablesForDetector(String detectorName, Set<String> metadataScananbles) voidsetMetadataScannablesPerDetectorMap(Map<String, Collection<String>> metadataScannablesPerDetector) voidsetNexusTemplateFiles(List<String> nexusTemplateFiles) voidsetNexusTemplates(Map<String, NexusTemplate> nexusTemplates) voidDeprecated, for removal: This API element is subject to removal in a future version.this method should be deleted once NDW static methods are removedMethods inherited from class gda.factory.FindableBase
equals, getName, hashCode, setName
-
Constructor Details
-
NexusDataWriterConfiguration
public NexusDataWriterConfiguration()Do not call this constructor directly except in test code. It should be declared in spring and accessed viagetInstance(). For use in test code only!
-
-
Method Details
-
getInstance
-
unregisterFromOsgi
Deprecated, for removal: This API element is subject to removal in a future version.this method should be deleted once NDW static methods are removedIf this was successfully registered with OSGi then unregister. -
getMetadataScannables
Returns the names of the configured metadata scannables. These will be added to the nexus file for all scans on this beamline.- Returns:
- metadata scannables
-
setMetadataScannables
-
addMetadataScannable
-
removeMetadataScannable
-
getLocationMap
Returns the location map, a map from scannable name to aScannableWriterthat writes the scannable with that name. The scannable writer also contains theScannableWriter.getPrerequisiteScannableNames().- Returns:
- the location map
-
setLocationMap
-
getMetadataScannablesPerDetectorMap
Returns the map of scannables per detectors, i.e. these are scannables that are written as metadata scannables to the nexus file for scans that include the detector.- Returns:
- scannables per detector map
-
setMetadataScannablesPerDetectorMap
public void setMetadataScannablesPerDetectorMap(Map<String, Collection<String>> metadataScannablesPerDetector) -
setMetadataScannablesForDetector
-
getMetadataScannablesForDetector
-
getMetadataScannablesForScannable
-
getNexusTemplateFiles
Returns the nexus template files that will applied to the nexus file as written.- Returns:
- nexus template files
-
setNexusTemplateFiles
-
getMetadata
Returns the metadata to be added to the nexus files.- Returns:
- nexus file
-
setMetadata
Allow arbitrary metadata to be added to nexus data files.To add an entry (eg sample_background) to each file as a note in the "sample" group, set the entries as {'sample_background': 'sample:NXsample/sample_background'}
- Parameters:
metadata- should be a map of metadata names to nexus paths (relative to the top level /entry1/ node.
-
clear
public void clear()Clears the contents of this configuration. -
getNexusTemplates
-
addNexusTemplate
-
setNexusTemplates
-
removeNexusTemplate
-