Package gda.device.detector
Class NXDetectorData
java.lang.Object
gda.device.detector.NXDetectorData
- All Implemented Interfaces:
NexusTreeProvider,PlottableDetectorData,GDANexusDetectorData,Serializable
- Direct Known Subclasses:
NXDetectorDataWithFilepathForSrs
Basic class which wrappers up a lot of nexus calls so that detectors can integrate more easily
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBasic constructorNXDetectorData(INexusTree tree) Constructor, which is based on an initial NexusTreeNXDetectorData(Scannable detector) Passing in the detector helps setting up the plotable data array and does some useful checkingNXDetectorData(String[] extraNames, String[] outputFormat, String detectorName) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAxis(String detName, String name, NexusGroupData axis_sds, Integer axisValue, Integer primaryValue, String units, boolean isPointDependent) Adds the specified Axis to the named detector.static INexusTreeaddData(INexusTree parent, String dataName, NexusGroupData data, String units, Integer signalVal) static INexusTreeaddData(INexusTree parent, String dataName, NexusGroupData data, String units, Integer signalVal, String interpretation, boolean isPointDependent) addData(String parent, NexusGroupData data) addData(String parent, NexusGroupData data, String units) addData(String parent, NexusGroupData data, String units, Integer signalVal) addData(String detName, NexusGroupData data, String units, Integer signalVal, String interpretation) Adds the specified data to the named detectoraddData(String parent, String dataName, NexusGroupData data) addData(String parent, String dataName, NexusGroupData data, String units) addData(String parent, String dataName, NexusGroupData data, String units, boolean isDetectorEntryData) addData(String detName, String dataName, NexusGroupData data, String units, Integer signalVal, String interpretation) Adds the specified data to the named detectoraddData(String detName, String dataName, NexusGroupData data, String units, Integer signalVal, String interpretation, boolean isPointDependent) voidaddElement(String detName, String name, NexusGroupData axisSDS, String units, boolean isPointDependent) Adds the specified Axis to the named detectorvoidaddExternalFileLink(String detName, String linkTargetPath, int dataRank) Create exactly one file link under a node named "data".voidaddExternalFileLink(String detName, String linkNodeName, String linkTargetPath, boolean isPointDependent, boolean isDetectorEntryData) Deprecated.voidaddExternalFileLink(String detName, String linkNodeName, String linkTargetPath, boolean isPointDependent, boolean isDetectorEntryData, int dataRank) Deprecated.calladdExternalFileLink(String, String, String, int)instead, asisPointDependentis always ignored andNexusDataWriteralso ignoresisDetectorEntryData(NexusScanDataWriterdoes not).voidaddExternalFileLink(String detName, String linkNodeName, String linkTargetPath, int dataRank) Create a link node with the given name to the given external file path.voidaddFileName(String detName, String filename) Add the string as a NXNote - used when the detector writes data to a file itself to be agglomerated into the NExus file later.addFileNames(String detName, String nodeName, String[] filenames, boolean isPointDependent, boolean isDetectorEntryData) Adds a DATA_FILE_SDS_NAME SDS item for the collection of filenames as a child of the portion of the tree for a detector.voidaddNote(INexusTree detTree, String note) Adds a simple note to the detectorvoidAdds a simple note to the detectorvoidaddScanFileLink(String detName, String linkTargetPath) Deprecated.useaddExternalFileLink(String, String, int)instead asNexusScanDataWriterrequires the rank of the external data node in order to correctly tag theNXdatagroup according to the 2014 format.getDetTree(String detName) returns the names detectors treeDouble[]String[]String[]voidsetDoubleVals(Double[] vals) Deprecated.voidsetPlottableValue(String forExtraName, Double value) Sets the Double in the PlottableDataArray the is associated with the passed in extraName to the value handed in.voidsetPrioritisedData(String detName, String dataName, String className) toString()
-
Field Details
-
DATA_FILE_CLASS_NAME
- See Also:
-
FILE_NAME_NODE_NAME
- See Also:
-
extraNames
-
outputFormat
-
-
Constructor Details
-
NXDetectorData
-
NXDetectorData
Passing in the detector helps setting up the plotable data array and does some useful checking- Parameters:
detector-
-
NXDetectorData
public NXDetectorData()Basic constructor -
NXDetectorData
Constructor, which is based on an initial NexusTree- Parameters:
tree-
-
-
Method Details
-
getNexusTree
- Specified by:
getNexusTreein interfaceNexusTreeProvider- Returns:
- the nexustree
-
getDetTree
returns the names detectors tree- Specified by:
getDetTreein interfaceGDANexusDetectorData- Parameters:
detName- if null or empty it returns the first- Returns:
- the NexusTree associated with the named detector
-
addData
- Parameters:
parent-data-- Returns:
- The node added.
-
addData
- Parameters:
parent-data-units-- Returns:
- The node added.
-
addData
- Parameters:
parent-data-- Returns:
- The node added.
-
addData
- Parameters:
parent-dataName-data-units-- Returns:
- The node added.
-
addData
public INexusTree addData(String parent, String dataName, NexusGroupData data, String units, boolean isDetectorEntryData) - Parameters:
parent-dataName-data-units-isDetectorEntryData-- Returns:
- The node added.
-
addData
- Parameters:
parent-data-units-signalVal-- Returns:
- The node added.
-
addData
public static INexusTree addData(INexusTree parent, String dataName, NexusGroupData data, String units, Integer signalVal) - Parameters:
parent-dataName-data-units-signalVal-- Returns:
- The node added.
-
addData
public INexusTree addData(String detName, String dataName, NexusGroupData data, String units, Integer signalVal) -
addData
public INexusTree addData(String detName, NexusGroupData data, String units, Integer signalVal, String interpretation) Adds the specified data to the named detector- Parameters:
detName- The name of the detector to add data todata- The implementation of NexusGroupData to be reported as the dataunits- - if not null a units attribute is addedsignalVal- - if not null a signal attribute is added
-
addData
public INexusTree addData(String detName, String dataName, NexusGroupData data, String units, Integer signalVal, String interpretation) Adds the specified data to the named detector- Parameters:
detName- The name of the detector to add data todata- The implementation of NexusGroupData to be reported as the dataunits- - if not null a units attribute is addedsignalVal- - if not null a signal attribute is addedinterpretation- - if not null an interpretation string
-
addData
public INexusTree addData(String detName, String dataName, NexusGroupData data, String units, Integer signalVal, String interpretation, boolean isPointDependent) -
addData
public static INexusTree addData(INexusTree parent, String dataName, NexusGroupData data, String units, Integer signalVal, String interpretation, boolean isPointDependent) -
addFileName
Add the string as a NXNote - used when the detector writes data to a file itself to be agglomerated into the NExus file later.- Parameters:
detName- The name of the detector to add data tofilename- filename
-
addFileNames
public NexusTreeNode addFileNames(String detName, String nodeName, String[] filenames, boolean isPointDependent, boolean isDetectorEntryData) Adds a DATA_FILE_SDS_NAME SDS item for the collection of filenames as a child of the portion of the tree for a detector. This is useful when a detector creates its own data file or a collection of data files- Parameters:
detName- The name of the detector to add data tonodeName- The name of the createdfilenames- filenames collection of filenames to add to sectionisPointDependent- boolean to signal is the data is to be provided for each point in a scan.isDetectorEntryData- Flag to indicate that when writing this value to a file the entry is to linked to the NXEntry/NXDetector section as a variable of the scan
-
addScanFileLink
Deprecated.useaddExternalFileLink(String, String, int)instead asNexusScanDataWriterrequires the rank of the external data node in order to correctly tag theNXdatagroup according to the 2014 format.Create exactly one file link under a node named "data".- Parameters:
detName- the detector namelinkTargetPath- the path of the node to link to in the external file in the formatnxfile://externalFilePath#nodePathWithinFile", getFilepath(), getInternalPath()
-
addExternalFileLink
Create exactly one file link under a node named "data". Note: This method should not be called- Parameters:
detName- the detector namelinkTargetPath- the path of the node to link to in the external file in the formatnxfile://externalFilePath#nodePathWithinFile", getFilepath(), getInternalPath()
-
addExternalFileLink
@Deprecated(since="GDA 9.21") public void addExternalFileLink(String detName, String linkNodeName, String linkTargetPath, boolean isPointDependent, boolean isDetectorEntryData) Deprecated.use the version of this method that takes dataRank, as this is required byNexusScanDataWriterCreate a link node with the given name to the given external file path.- Parameters:
detName- the detector namelinkNodeName- the name of the link node in the detector treelinkTargetPath- the path of the node to link to in the external file in the formatnxfile://externalFilePath#nodePathWithinFile", getFilepath(), getInternalPath()
-
addExternalFileLink
public void addExternalFileLink(String detName, String linkNodeName, String linkTargetPath, int dataRank) Create a link node with the given name to the given external file path.- Parameters:
detName- the detector namelinkNodeName- the name of the link node in the detector treelinkTargetPath- the path of the node to link to in the external file in the formatnxfile://externalFilePath#nodePathWithinFile", getFilepath(), getInternalPath()dataRank- the rank of the external dataset, required byNexusScanDataWriterfor correct tagging of theNXdatagroup according to the 2014 format.
-
addExternalFileLink
@Deprecated(since="GDA 9.21") public void addExternalFileLink(String detName, String linkNodeName, String linkTargetPath, boolean isPointDependent, boolean isDetectorEntryData, int dataRank) Deprecated.calladdExternalFileLink(String, String, String, int)instead, asisPointDependentis always ignored andNexusDataWriteralso ignoresisDetectorEntryData(NexusScanDataWriterdoes not).Create a link node with the given name to the given external file path.- Parameters:
detName- the detector namelinkNodeName- the name of the link node in the detector treelinkTargetPath- the path of the node to link to in the external file in the formatnxfile://externalFilePath#nodePathWithinFile", getFilepath(), getInternalPath()isPointDependent- ignored as we simply create a linkisDetectorEntryData-truefor the linked data set to also be linked to from anNXdatagroup,falseotherwise. Note thatNexusDataWriterdataRank- the rank of the external dataset, required byNexusScanDataWriterfor correct tagging of theNXdatagroup according to the 2014 format.
-
addAxis
public void addAxis(String detName, String name, NexusGroupData axis_sds, Integer axisValue, Integer primaryValue, String units, boolean isPointDependent) Adds the specified Axis to the named detector. Note: This method tags the- Parameters:
detName- The name of the detector to add data toname- The name of the Axisaxis_sds- The implementation of NexusGroupData to be reported as the axis dataaxisValue- The dimension which this axis relates to from the detector point of view, i.e. 1 is the first detector axis, scan dimensions will be added as required by the DataWriterprimaryValue- The importance of this axis, 1 is the most relevant, then 2 etc.units- The units the axis is specified inisPointDependent- If this data should be added to the nexus at every point set this to true, if its a one off, make this false
-
addElement
public void addElement(String detName, String name, NexusGroupData axisSDS, String units, boolean isPointDependent) Adds the specified Axis to the named detector- Parameters:
detName- The name of the detector to add data toname- The name of the AxisaxisSDS- The values of the Axis, i.e the actual valuesunits- The units the axis is specified inisPointDependent- If this data should be added to the nexus at every point set this to true, if its a one off, make this false
-
addNote
Adds a simple note to the detector- Parameters:
detName- the name of the detectornote- the string contents of the note
-
addNote
Adds a simple note to the detector- Parameters:
detTree-note-
-
getData
- Specified by:
getDatain interfaceGDANexusDetectorData- Parameters:
detName-dataName- name of the child whose data is to be returned. If null or empty the first detector entry is usedclassName- class name of the child whose data is to be returned e.g. NexusExtractor.SDSClassName- Returns:
- NexusGroupData
-
setPrioritisedData
- Specified by:
setPrioritisedDatain interfaceGDANexusDetectorData- Parameters:
detName-dataName- name of the child whose data should have their priority changed.className- class name of the child whose data is to be changed e.g. NexusExtractor.SDSClassName
-
setPlottableValue
Sets the Double in the PlottableDataArray the is associated with the passed in extraName to the value handed in.- Parameters:
forExtraName-value-
-
getDoubleVals
- Specified by:
getDoubleValsin interfacePlottableDetectorData- Returns:
- Array of doubles - the length must match the length of the detector's extraNames. null items are allowed and will not be plotted.
-
setDoubleVals
Deprecated.Use this to set the plottable Double values, if you prefer that over the convenience methods that use the scannable constructor of this class. Consider checking your extraNames and providing an outputFormat as well then. Using this method makes it difficult in inheriting classes to provide additional information, hence the use is not recommended. Use setPlottableValue instead.- Parameters:
vals-
-
toString
-
getOutputFormat
- Specified by:
getOutputFormatin interfaceGDANexusDetectorData
-
getExtraNames
- Specified by:
getExtraNamesin interfaceGDANexusDetectorData
-
mergeIn
- Specified by:
mergeInin interfaceGDANexusDetectorData
-
NexusScanDataWriter