Package gda.data.nexus.extractor
Class NexusGroupData
java.lang.Object
gda.data.nexus.extractor.NexusGroupData
- All Implemented Interfaces:
Serializable
Data class that is returned by first class Nexus aware detectors
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionint[]This array may be used to indicate a preferred choice of chunking to the datawriter.Setting this can advise a data-writer to use the specified compression algorithm for a choice see:NexusFile.COMPRESSION_*When usingNexusScanDataWriter, andisDetectorEntryDataistrue, then setting this field causes the corresponding dataset in the nexus file to be added to anNXdatagroup with the given name.int[]dimensions of dataintIf this data represents a link to an external file (where the data value is the path to that file in the format nxfile://externalFilePath#nodePath), then this field specifies the rank of the data written at each point in the scan.booleanFlag 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 scanstatic final intMaximum length of any text string encoded as bytes -
Constructor Summary
ConstructorsConstructorDescriptionNexusGroupData(boolean b) NexusGroupData(byte... b) NexusGroupData(double... d) NexusGroupData(double[][] d) NexusGroupData(double[][][] d) NexusGroupData(float... f) NexusGroupData(int i) NexusGroupData(int... i) NexusGroupData(int[][] i) NexusGroupData(int[][][] i) NexusGroupData(int[] dims, byte... b) NexusGroupData(int[] dims, double... d) NexusGroupData(int[] dims, float... f) NexusGroupData(int[] dims, int... i) NexusGroupData(int[] dims, long... l) NexusGroupData(int[] dims, short... s) NexusGroupData(int length, int[] dims, String[] s) NexusGroupData(int length, String... s) NexusGroupData(long... l) NexusGroupData(short... s) NexusGroupData(short[][] s) NexusGroupData(org.eclipse.january.dataset.IDataset data) -
Method Summary
Modifier and TypeMethodDescriptionasByte()asChar()asDouble()asFloat()asInt()asLong()asShort()static NexusGroupDatacreateFromDataset(org.eclipse.january.dataset.IDataset dataset) dataToTxt(boolean newlineAfterEach, boolean dataAsString, boolean wrap) booleangetBuffer(boolean encode) int[]Class<? extends org.eclipse.january.dataset.Dataset> getType()inthashCode()booleanisChar()booleanisDouble()booleanisFloat()voidsetMaxStringLength(int length) Set maximum length of any string when encoded as bytesSet type to be unsignedorg.eclipse.january.dataset.DatasetCreate a dataset based on contentsorg.eclipse.january.dataset.DatasettoDataset(boolean keepBitWidth) Create a dataset based on contentsorg.eclipse.january.dataset.ILazyWriteableDatasetCreate a lazy dataset based on contentstoString()
-
Field Details
-
dimensions
public int[] dimensionsdimensions of data -
chunkDimensions
public int[] chunkDimensionsThis array may be used to indicate a preferred choice of chunking to the datawriter. The data-writer might well ignore that though (for now all will). -
compressionType
Setting this can advise a data-writer to use the specified compression algorithm for a choice see:NexusFile.COMPRESSION_* -
isDetectorEntryData
public boolean isDetectorEntryDataFlag 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 -
externalDataRank
public int externalDataRankIf this data represents a link to an external file (where the data value is the path to that file in the format nxfile://externalFilePath#nodePath), then this field specifies the rank of the data written at each point in the scan. Note that the actual rank of the dataset written will be this number plus the scan rank. -
dataGroupName
When usingNexusScanDataWriter, andisDetectorEntryDataistrue, then setting this field causes the corresponding dataset in the nexus file to be added to anNXdatagroup with the given name.If this field is
null, then a newNXdatagroup will be created with the dataset as the signal field. -
MAX_TEXT_LENGTH
public static final int MAX_TEXT_LENGTHMaximum length of any text string encoded as bytes- See Also:
-
-
Constructor Details
-
NexusGroupData
public NexusGroupData(org.eclipse.january.dataset.IDataset data) - Parameters:
data-
-
NexusGroupData
- Parameters:
s- String from which to make a NexusGroupData
-
NexusGroupData
- Parameters:
length- of encoded string in bytess- Strings from which to make a NexusGroupData
-
NexusGroupData
- Parameters:
length- of encoded string in bytesdims-s- Strings from which to make a NexusGroupData
-
NexusGroupData
public NexusGroupData(byte... b) -
NexusGroupData
public NexusGroupData(int[] dims, byte... b) -
NexusGroupData
public NexusGroupData(short... s) -
NexusGroupData
public NexusGroupData(int[] dims, short... s) -
NexusGroupData
public NexusGroupData(short[][] s) -
NexusGroupData
public NexusGroupData(int i) -
NexusGroupData
public NexusGroupData(int... i) -
NexusGroupData
public NexusGroupData(int[] dims, int... i) -
NexusGroupData
public NexusGroupData(int[][] i) -
NexusGroupData
public NexusGroupData(int[][][] i) -
NexusGroupData
public NexusGroupData(long... l) -
NexusGroupData
public NexusGroupData(int[] dims, long... l) -
NexusGroupData
public NexusGroupData(boolean b) -
NexusGroupData
public NexusGroupData(float... f) -
NexusGroupData
public NexusGroupData(int[] dims, float... f) -
NexusGroupData
public NexusGroupData(double... d) -
NexusGroupData
public NexusGroupData(int[] dims, double... d) -
NexusGroupData
public NexusGroupData(double[][] d) -
NexusGroupData
public NexusGroupData(double[][][] d)
-
-
Method Details
-
createFromDataset
- Parameters:
dataset-- Returns:
- group data
-
setMaxStringLength
public void setMaxStringLength(int length) Set maximum length of any string when encoded as bytes- Parameters:
length-
-
setUnsigned
Set type to be unsigned- Returns:
- this
-
isChar
public boolean isChar()- Returns:
- true if data contains characters
-
getBuffer
- Returns:
- The data buffer compatible with type, null if data not extracted
-
getBuffer
- Parameters:
encode- if true, convert to strings to UTF-8 bytes- Returns:
- The data buffer compatible with type, null if data not extracted
-
releaseData
- Returns:
- Returns the value of data and sets data to null
-
toString
-
dataToTxt
- Parameters:
newlineAfterEach-dataAsString-wrap-- Returns:
- XML representation of the object
-
getFirstValue
-
toLazyDataset
public org.eclipse.january.dataset.ILazyWriteableDataset toLazyDataset()Create a lazy dataset based on contents- Returns:
- lazy dataset
-
toDataset
public org.eclipse.january.dataset.Dataset toDataset()Create a dataset based on contents- Returns:
- dataset
-
toDataset
public org.eclipse.january.dataset.Dataset toDataset(boolean keepBitWidth) Create a dataset based on contents- Parameters:
keepBitWidth-- Returns:
- dataset
-
getInterface
- Returns:
- dataset interface
-
getType
- Returns:
- type of data e.g. "NX_CHAR"
-
getDimensions
public int[] getDimensions() -
asChar
- Returns:
- data with output type as char
-
asByte
- Returns:
- data with output type as byte
-
asShort
- Returns:
- data with output type as short
-
asInt
- Returns:
- data with output type as integer
-
asLong
- Returns:
- data with output type as long
-
asFloat
- Returns:
- data with output type as float
-
asDouble
- Returns:
- data with output type as double
-
isFloat
public boolean isFloat() -
isDouble
public boolean isDouble() -
hashCode
public int hashCode() -
equals
-