Package adams.data.io.input
Class SPCSpectrumReader.FileParser
- java.lang.Object
-
- adams.data.io.input.SPCSpectrumReader.AbstractParser
-
- adams.data.io.input.SPCSpectrumReader.FileParser
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- SPCSpectrumReader
public static class SPCSpectrumReader.FileParser extends SPCSpectrumReader.AbstractParser
Parser class for SPC files (header).- Version:
- $Revision: 2242 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_AxisLabels
whether axis labeled stored (0:0x20h).protected boolean
m_Blocks16bit
whether blocks are in 16bit integer (0:0x01h).protected Date
m_CollectionDate
the collection date.protected String
m_Comment
the comment.protected String
m_ExperimentType
the instrument experiment technique (2).protected byte
m_Exponent
the scaling exponent.protected double
m_FirstX
the value of the first X.protected String
m_ID
the ID to use.protected double
m_LastX
the value of the last X.protected SampleData
m_Log
the log values.protected boolean
m_MultiFile
whether multi-file (0:0x04h).protected float
m_MultWInc
the multiple W value increment.protected float
m_MultZInc
the multiple Z value increment.protected boolean
m_NonEvenX
whether X data is non-evenly spaced (0:0x80h).protected int
m_NumFiles
the number of sub-files.protected int
m_NumPoints
the number of points.protected int
m_NumWPlanes
the number of W places in 4D data.protected int
m_OffsetLogstc
the offset for LOGSTC.protected boolean
m_Ordered
whether ordered (0:0x10h).protected int
m_PeakPointNum
the peak point number.protected String
m_Resolution
the resolution.protected String
m_Source
the source.protected List<Spectrum>
m_Spectra
the parsed spectrum.protected boolean
m_UniqueXs
whether each subfile has unique X array (0:0x40h).protected String
m_Version
the version (1).protected String
m_WAxis
the label of the W axis.protected String
m_XAxis
the label of the X axis.protected boolean
m_YasIEEE32bit
whether Y values are stored in IEEE 32bit floats.protected String
m_YAxis
the label of the Y axis.protected String
m_ZAxis
the label of the Z axis.-
Fields inherited from class adams.data.io.input.SPCSpectrumReader.AbstractParser
m_BytesRead, m_Data, m_Offset, m_Parent
-
-
Constructor Summary
Constructors Constructor Description FileParser(String id, byte[] data)
Initializes the parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
determineExperimentType(byte data)
Determines the experiment type.protected String
determineLabelType(byte data, char axis)
Determines the label type.double
getFirstX()
Returns the X of the first value.double
getLastX()
Returns the X of the last value.int
getNumFiles()
Returns the number of sub-files.int
getNumPoints()
Returns the number of points to read.List<Spectrum>
getSpectra()
Returns the parsed spectra.protected String
parseData()
Parses the spectral data.protected String
parseFooter()
Parses the footer data (if any).protected String
parseHeader()
Parses the header data.protected String
postProcess()
For post-processing the data.-
Methods inherited from class adams.data.io.input.SPCSpectrumReader.AbstractParser
copyBytes, getBytesRead, getParent, parse, sumBytes
-
-
-
-
Field Detail
-
m_ID
protected String m_ID
the ID to use.
-
m_Blocks16bit
protected boolean m_Blocks16bit
whether blocks are in 16bit integer (0:0x01h).
-
m_MultiFile
protected boolean m_MultiFile
whether multi-file (0:0x04h).
-
m_Ordered
protected boolean m_Ordered
whether ordered (0:0x10h).
-
m_AxisLabels
protected boolean m_AxisLabels
whether axis labeled stored (0:0x20h).
-
m_UniqueXs
protected boolean m_UniqueXs
whether each subfile has unique X array (0:0x40h).
-
m_NonEvenX
protected boolean m_NonEvenX
whether X data is non-evenly spaced (0:0x80h).
-
m_Version
protected String m_Version
the version (1).
-
m_ExperimentType
protected String m_ExperimentType
the instrument experiment technique (2).
-
m_Exponent
protected byte m_Exponent
the scaling exponent.
-
m_YasIEEE32bit
protected boolean m_YasIEEE32bit
whether Y values are stored in IEEE 32bit floats.
-
m_NumPoints
protected int m_NumPoints
the number of points.
-
m_FirstX
protected double m_FirstX
the value of the first X.
-
m_LastX
protected double m_LastX
the value of the last X.
-
m_NumFiles
protected int m_NumFiles
the number of sub-files.
-
m_XAxis
protected String m_XAxis
the label of the X axis.
-
m_YAxis
protected String m_YAxis
the label of the Y axis.
-
m_ZAxis
protected String m_ZAxis
the label of the Z axis.
-
m_CollectionDate
protected Date m_CollectionDate
the collection date.
-
m_Resolution
protected String m_Resolution
the resolution.
-
m_Source
protected String m_Source
the source.
-
m_PeakPointNum
protected int m_PeakPointNum
the peak point number.
-
m_Comment
protected String m_Comment
the comment.
-
m_OffsetLogstc
protected int m_OffsetLogstc
the offset for LOGSTC.
-
m_MultZInc
protected float m_MultZInc
the multiple Z value increment.
-
m_NumWPlanes
protected int m_NumWPlanes
the number of W places in 4D data.
-
m_MultWInc
protected float m_MultWInc
the multiple W value increment.
-
m_WAxis
protected String m_WAxis
the label of the W axis.
-
m_Log
protected SampleData m_Log
the log values.
-
-
Constructor Detail
-
FileParser
public FileParser(String id, byte[] data)
Initializes the parser.- Parameters:
id
- the ID to usedata
- the data to parse
-
-
Method Detail
-
determineExperimentType
protected String determineExperimentType(byte data)
Determines the experiment type.- Parameters:
data
- the byte to inspect- Returns:
- the type
-
determineLabelType
protected String determineLabelType(byte data, char axis)
Determines the label type.- Parameters:
data
- the byte to inspectaxis
- the axis to determine the label for (x,y,z)- Returns:
- the type
-
parseHeader
protected String parseHeader()
Parses the header data.- Specified by:
parseHeader
in classSPCSpectrumReader.AbstractParser
- Returns:
- null if successfully parsed, otherwise error message
-
parseData
protected String parseData()
Parses the spectral data.- Specified by:
parseData
in classSPCSpectrumReader.AbstractParser
- Returns:
- null if successfully parsed, otherwise error message
-
parseFooter
protected String parseFooter()
Parses the footer data (if any).- Overrides:
parseFooter
in classSPCSpectrumReader.AbstractParser
- Returns:
- null if successfully parsed, otherwise error message
-
postProcess
protected String postProcess()
For post-processing the data.- Overrides:
postProcess
in classSPCSpectrumReader.AbstractParser
- Returns:
- null if successfully parsed, otherwise error message
-
getNumPoints
public int getNumPoints()
Returns the number of points to read.- Returns:
- the number of points
-
getFirstX
public double getFirstX()
Returns the X of the first value.- Returns:
- the first X
-
getLastX
public double getLastX()
Returns the X of the last value.- Returns:
- the last X
-
getNumFiles
public int getNumFiles()
Returns the number of sub-files.- Returns:
- the number of files
-
-