public class DataHeader extends ControlHeader
Modifier and Type | Field and Description |
---|---|
protected byte |
activityFlags |
protected byte[] |
channelIdentifier |
protected java.lang.String |
channelIdentifierString |
protected int |
dataBlocketteOffset |
protected int |
dataOffset |
protected byte |
dataQualityFlags |
protected byte |
ioClockFlags |
protected byte[] |
locationIdentifier |
protected java.lang.String |
locationIdentifierString |
protected byte[] |
networkCode |
protected java.lang.String |
networkCodeString |
protected byte |
numBlockettes |
protected int |
numSamples |
protected int |
sampleRateFactor |
protected int |
sampleRateMultiplier |
protected byte[] |
startTime |
protected byte[] |
stationIdentifier |
protected java.lang.String |
stationIdentifierString |
protected int |
timeCorrection |
continuationCode, sequenceNum, typeCode
Constructor and Description |
---|
DataHeader(int sequenceNum,
char typeCode,
boolean continuationCode)
creates a DataHeader object with listed sequence number, type code, and
continuation code boolean.
|
Modifier and Type | Method and Description |
---|---|
float |
calcSampleRateFromMultipilerFactor()
get the sample rate.
|
static short[] |
calcSeedMultipilerFactor(double sps) |
byte |
getActivityFlags()
Get the value of activityFlags.
|
java.lang.String |
getChannelIdentifier()
Get the value of channelIdentifier.
|
java.lang.String |
getCodes() |
int |
getDataBlocketteOffset()
Get the value of dataBlocketteOffset.
|
int |
getDataOffset()
Get the value of dataOffset.
|
byte |
getDataQualityFlags()
Get the value of dataQualityFlags.
|
byte |
getIOClockFlags()
Get the value of IOClockFlags.
|
java.lang.String |
getLocationIdentifier()
Get the value of locationIdentifier.
|
java.lang.String |
getNetworkCode()
Get the value of networkCode.
|
byte |
getNumBlockettes()
Get the value of numBlockettes.
|
int |
getNumSamples()
Get the value of numSamples.
|
char |
getQualityIndicator()
same as getTypeCode() in ControlHeader, just a convenience method as the type code is called a
Data header/quality indicator in the seed documentation for data header.
|
int |
getSampleRateFactor()
Get the value of sampleRateFactor.
|
int |
getSampleRateMultiplier()
Get the value of sampleRateMultiplier.
|
short |
getSize() |
Btime |
getStartBtime() |
java.lang.String |
getStartTime()
Get the value of startTime.
|
java.lang.String |
getStationIdentifier()
Get the value of stationIdentifier.
|
int |
getTimeCorrection()
Get the value of timeCorrection.
|
protected void |
read(byte[] buf,
int offset)
populates this object with Fixed Section Data Header info.
|
static DataHeader |
read(java.io.DataInput in,
int sequenceNum,
char typeCode,
boolean continuationCode)
Instantiate an object of this class and read an FSDH byte stream into it,
parsing the contents into the instance variables of this object, which
represent the individual FSDH fields.
Note, first 8 bytes are assumed to already have been read. |
void |
setActivityFlags(byte v)
Set the value of activityFlags.
|
void |
setChannelIdentifier(java.lang.String v)
Set the value of channelIdentifier.
|
void |
setDataBlocketteOffset(short v)
Set the value of dataBlocketteOffset.
|
void |
setDataOffset(short v)
Set the value of dataOffset.
|
void |
setDataQualityFlags(byte v)
Set the value of dataQualityFlags.
|
void |
setIOClockFlags(byte v)
Set the value of IOClockFlags.
|
void |
setLocationIdentifier(java.lang.String v)
Set the value of locationIdentifier.
|
void |
setNetworkCode(java.lang.String v)
Set the value of networkCode.
|
void |
setNumBlockettes(byte v)
Set the value of numBlockettes.
|
void |
setNumSamples(short v)
Set the value of numSamples.
|
void |
setSampleRate(double samplePerSecond) |
void |
setSampleRateFactor(short v)
Set the value of sampleRateFactor.
|
void |
setSampleRateMultiplier(short v)
Set the value of sampleRateMultiplier.
|
void |
setStartBtime(Btime btime) |
void |
setStationIdentifier(java.lang.String v)
Set the value of stationIdentifier.
|
void |
setTimeCorrection(int v)
Set the value of timeCorrection.
|
java.lang.String |
toString()
Present a default string representation of the contents of this object
|
protected void |
write(java.io.DataOutput dos)
write DataHeader contents to a DataOutput stream
|
void |
writeASCII(java.io.PrintWriter out)
Writes an ASCII version of the record header.
|
void |
writeASCII(java.io.PrintWriter out,
java.lang.String indent) |
getSequenceNum, getTypeCode, isContinuation, main, read, tester
protected byte[] stationIdentifier
protected java.lang.String stationIdentifierString
protected byte[] locationIdentifier
protected java.lang.String locationIdentifierString
protected byte[] channelIdentifier
protected java.lang.String channelIdentifierString
protected byte[] networkCode
protected java.lang.String networkCodeString
protected byte[] startTime
protected int numSamples
protected int sampleRateFactor
protected int sampleRateMultiplier
protected byte activityFlags
protected byte ioClockFlags
protected byte dataQualityFlags
protected byte numBlockettes
protected int timeCorrection
protected int dataOffset
protected int dataBlocketteOffset
public DataHeader(int sequenceNum, char typeCode, boolean continuationCode)
sequenceNum
- sequence number of the record represented by this object.typeCode
- character representing the type of record represented by this
objectcontinuationCode
- true if this record is flagged as a continuation from its
previous SEED recordpublic void writeASCII(java.io.PrintWriter out) throws java.io.IOException
writeASCII
in class ControlHeader
out
- a Writerjava.io.IOException
public void writeASCII(java.io.PrintWriter out, java.lang.String indent) throws java.io.IOException
writeASCII
in class ControlHeader
java.io.IOException
public static DataHeader read(java.io.DataInput in, int sequenceNum, char typeCode, boolean continuationCode) throws java.io.IOException, SeedFormatException
in
- SEED data stream offset 8 bytes from beginning of record.sequenceNum
- 6 digit ascii sequence tag at the beginning of
SEED record.typeCode
- character representing the type of record being readcontinuationCode
- true if this record is flagged as a continuation from its
previous SEED record.java.io.IOException
SeedFormatException
protected void read(byte[] buf, int offset)
buf
- data buffer containing FSDH informationoffset
- byte offset to begin reading bufprotected void write(java.io.DataOutput dos) throws java.io.IOException
write
in class ControlHeader
dos
- DataOutput stream to write tojava.io.IOException
public short getSize()
getSize
in class ControlHeader
public char getQualityIndicator()
public java.lang.String getStationIdentifier()
public void setStationIdentifier(java.lang.String v)
v
- Value to assign to stationIdentifier.public java.lang.String getLocationIdentifier()
public void setLocationIdentifier(java.lang.String v)
v
- Value to assign to locationIdentifier.public java.lang.String getChannelIdentifier()
public void setChannelIdentifier(java.lang.String v)
v
- Value to assign to channelIdentifier.public java.lang.String getNetworkCode()
public void setNetworkCode(java.lang.String v)
v
- Value to assign to networkCode.public Btime getStartBtime()
public void setStartBtime(Btime btime)
public java.lang.String getStartTime()
public int getNumSamples()
public void setNumSamples(short v)
v
- Value to assign to numSamples.public int getSampleRateFactor()
public void setSampleRateFactor(short v)
v
- Value to assign to sampleRateFactor.public int getSampleRateMultiplier()
public void setSampleRateMultiplier(short v)
v
- Value to assign to sampleRateMultiplier.public void setSampleRate(double samplePerSecond)
public float calcSampleRateFromMultipilerFactor()
public static short[] calcSeedMultipilerFactor(double sps)
public byte getActivityFlags()
public void setActivityFlags(byte v)
v
- Value to assign to activityFlags.public byte getIOClockFlags()
public void setIOClockFlags(byte v)
v
- Value to assign to IOClockFlags.public byte getDataQualityFlags()
public void setDataQualityFlags(byte v)
v
- Value to assign to dataQualityFlags.public byte getNumBlockettes()
public void setNumBlockettes(byte v)
v
- Value to assign to numBlockettes.public int getTimeCorrection()
public void setTimeCorrection(int v)
v
- Value to assign to timeCorrection.public int getDataOffset()
public void setDataOffset(short v)
v
- Value to assign to dataOffset.public int getDataBlocketteOffset()
public void setDataBlocketteOffset(short v)
v
- Value to assign to dataBlocketteOffset.public java.lang.String toString()
toString
in class ControlHeader
public java.lang.String getCodes()