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 booleanm_AxisLabelswhether axis labeled stored (0:0x20h).protected booleanm_Blocks16bitwhether blocks are in 16bit integer (0:0x01h).protected Datem_CollectionDatethe collection date.protected Stringm_Commentthe comment.protected Stringm_ExperimentTypethe instrument experiment technique (2).protected bytem_Exponentthe scaling exponent.protected doublem_FirstXthe value of the first X.protected Stringm_IDthe ID to use.protected doublem_LastXthe value of the last X.protected SampleDatam_Logthe log values.protected booleanm_MultiFilewhether multi-file (0:0x04h).protected floatm_MultWIncthe multiple W value increment.protected floatm_MultZIncthe multiple Z value increment.protected booleanm_NonEvenXwhether X data is non-evenly spaced (0:0x80h).protected intm_NumFilesthe number of sub-files.protected intm_NumPointsthe number of points.protected intm_NumWPlanesthe number of W places in 4D data.protected intm_OffsetLogstcthe offset for LOGSTC.protected booleanm_Orderedwhether ordered (0:0x10h).protected intm_PeakPointNumthe peak point number.protected Stringm_Resolutionthe resolution.protected Stringm_Sourcethe source.protected List<Spectrum>m_Spectrathe parsed spectrum.protected booleanm_UniqueXswhether each subfile has unique X array (0:0x40h).protected Stringm_Versionthe version (1).protected Stringm_WAxisthe label of the W axis.protected Stringm_XAxisthe label of the X axis.protected booleanm_YasIEEE32bitwhether Y values are stored in IEEE 32bit floats.protected Stringm_YAxisthe label of the Y axis.protected Stringm_ZAxisthe 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 StringdetermineExperimentType(byte data)Determines the experiment type.protected StringdetermineLabelType(byte data, char axis)Determines the label type.doublegetFirstX()Returns the X of the first value.doublegetLastX()Returns the X of the last value.intgetNumFiles()Returns the number of sub-files.intgetNumPoints()Returns the number of points to read.List<Spectrum>getSpectra()Returns the parsed spectra.protected StringparseData()Parses the spectral data.protected StringparseFooter()Parses the footer data (if any).protected StringparseHeader()Parses the header data.protected StringpostProcess()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:
parseHeaderin classSPCSpectrumReader.AbstractParser- Returns:
- null if successfully parsed, otherwise error message
-
parseData
protected String parseData()
Parses the spectral data.- Specified by:
parseDatain classSPCSpectrumReader.AbstractParser- Returns:
- null if successfully parsed, otherwise error message
-
parseFooter
protected String parseFooter()
Parses the footer data (if any).- Overrides:
parseFooterin classSPCSpectrumReader.AbstractParser- Returns:
- null if successfully parsed, otherwise error message
-
postProcess
protected String postProcess()
For post-processing the data.- Overrides:
postProcessin 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
-
-