edu.iris.Fissures.seed.app
Class JseedrTest

java.lang.Object
  extended by edu.iris.Fissures.seed.app.JseedrTest

public class JseedrTest
extends java.lang.Object

JseedrTest Class used for testing JavaSeed via Jseedr. Can be set to print waveform data or to alter and write out data. A good test harness for running diagnostics.

Author:
Kevin Frechette, ISTI, (modified by) Robert Casey, IRIS DMC

Field Summary
static int B1000_DATA_RECORD_LENGTH_FIELD
           
static int B1000_ENCODING_FORMAT_FIELD
           
static int B1000_NEXT_BLOCKETTE_BYTE_NUMBER
          Blockette 1000 Fixed Section Data Header fields.
static int B1000_RESERVED_FIELD
           
static int B1000_WORD_ORDER_FIELD
           
static int B999_BEGINNING_OF_DATA
           
static int B999_CHANNEL_IDENTIFIER_FIELD
           
static int B999_LOCATION_IDENTIFIER_FIELD
           
static int B999_RECORD_START_TIME_FIELD
           
static int B999_SAMPLE_COUNT_FIELD
           
static int B999_SAMPLE_RATE_FACTOR_FIELD
           
static int B999_SAMPLE_RATE_MULTIPLIER_FIELD
           
static int B999_STATION_IDENTIFIER_FIELD
          Blockette 999 Fixed Section Data Header fields.
static int PREFERRED_DATA_RECORD_LENGTH
          The preferred data record length in bytes.
static int PREFERRED_DATA_RECORD_LENGTH_EXP
          The preferred data record length expressed as an exponent as a power of 2 (2^12=4096.)
protected  boolean replaceDataFlag
          Replace data flag: true to replace the data with re-encoded data or false to leave the data as is.
static java.lang.String SEED_TYPE
          SEED type.
static byte STEIM1_ENCODING_FORMAT
          Steim1 encoding format (used in B1000.)
static java.lang.String STEIM1_ENCODING_METHOD
          Steim1 encoding.
protected  boolean verboseMode
          set to true to turn Jseedr verbose mode ON
protected  boolean verboseModeWhenExport
          set to true to turn Jseedr verbose mode ON when exporting
 
Constructor Summary
JseedrTest()
           
 
Method Summary
 int getDataRecordLength(int dataRecordLengthExp)
          Gets the data record length.
static int getInteger(Blockette blk, int fieldNum)
          Get the integer from the blockette field.
static java.lang.Number getNumber(Blockette blk, int fieldNum)
          Get the number from the blockette field.
static void main(java.lang.String[] args)
           
 int modifyBlock1000(Blockette dataBlk)
          Modifies the blockette 1000 based upon the waveform.
 void printData(java.io.File seedVolume)
           
 void processData(java.io.File seedVolume)
           
static void setFieldVal(Blockette blk, int fieldNum, byte value)
           
static void setFieldVal(Blockette blk, int fieldNum, int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEED_TYPE

public static final java.lang.String SEED_TYPE
SEED type.

See Also:
Constant Field Values

STEIM1_ENCODING_METHOD

public static final java.lang.String STEIM1_ENCODING_METHOD
Steim1 encoding. Can be encoded to integers with the 'Waveform' class.

See Also:
Waveform, Constant Field Values

STEIM1_ENCODING_FORMAT

public static final byte STEIM1_ENCODING_FORMAT
Steim1 encoding format (used in B1000.)

See Also:
Constant Field Values

PREFERRED_DATA_RECORD_LENGTH_EXP

public static final int PREFERRED_DATA_RECORD_LENGTH_EXP
The preferred data record length expressed as an exponent as a power of 2 (2^12=4096.)

See Also:
Constant Field Values

PREFERRED_DATA_RECORD_LENGTH

public static final int PREFERRED_DATA_RECORD_LENGTH
The preferred data record length in bytes.

See Also:
Constant Field Values

B999_STATION_IDENTIFIER_FIELD

public static final int B999_STATION_IDENTIFIER_FIELD
Blockette 999 Fixed Section Data Header fields.

See Also:
Constant Field Values

B999_LOCATION_IDENTIFIER_FIELD

public static final int B999_LOCATION_IDENTIFIER_FIELD
See Also:
Constant Field Values

B999_CHANNEL_IDENTIFIER_FIELD

public static final int B999_CHANNEL_IDENTIFIER_FIELD
See Also:
Constant Field Values

B999_RECORD_START_TIME_FIELD

public static final int B999_RECORD_START_TIME_FIELD
See Also:
Constant Field Values

B999_SAMPLE_COUNT_FIELD

public static final int B999_SAMPLE_COUNT_FIELD
See Also:
Constant Field Values

B999_SAMPLE_RATE_FACTOR_FIELD

public static final int B999_SAMPLE_RATE_FACTOR_FIELD
See Also:
Constant Field Values

B999_SAMPLE_RATE_MULTIPLIER_FIELD

public static final int B999_SAMPLE_RATE_MULTIPLIER_FIELD
See Also:
Constant Field Values

B999_BEGINNING_OF_DATA

public static final int B999_BEGINNING_OF_DATA
See Also:
Constant Field Values

B1000_NEXT_BLOCKETTE_BYTE_NUMBER

public static final int B1000_NEXT_BLOCKETTE_BYTE_NUMBER
Blockette 1000 Fixed Section Data Header fields.

See Also:
Constant Field Values

B1000_ENCODING_FORMAT_FIELD

public static final int B1000_ENCODING_FORMAT_FIELD
See Also:
Constant Field Values

B1000_WORD_ORDER_FIELD

public static final int B1000_WORD_ORDER_FIELD
See Also:
Constant Field Values

B1000_DATA_RECORD_LENGTH_FIELD

public static final int B1000_DATA_RECORD_LENGTH_FIELD
See Also:
Constant Field Values

B1000_RESERVED_FIELD

public static final int B1000_RESERVED_FIELD
See Also:
Constant Field Values

verboseMode

protected boolean verboseMode
set to true to turn Jseedr verbose mode ON


verboseModeWhenExport

protected boolean verboseModeWhenExport
set to true to turn Jseedr verbose mode ON when exporting


replaceDataFlag

protected boolean replaceDataFlag
Replace data flag: true to replace the data with re-encoded data or false to leave the data as is.

Constructor Detail

JseedrTest

public JseedrTest()
Method Detail

printData

public void printData(java.io.File seedVolume)
               throws java.lang.Exception
Throws:
java.lang.Exception

processData

public void processData(java.io.File seedVolume)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getDataRecordLength

public int getDataRecordLength(int dataRecordLengthExp)
Gets the data record length.

Parameters:
dataRecordLengthExp - the dataRecordLength exponent.
Returns:
the data record length.

getInteger

public static int getInteger(Blockette blk,
                             int fieldNum)
Get the integer from the blockette field.

Parameters:
blk - the blockette.
fieldNum - the field number.
Returns:
the integer or 0 if none.

getNumber

public static java.lang.Number getNumber(Blockette blk,
                                         int fieldNum)
Get the number from the blockette field.

Parameters:
blk - the blockette.
fieldNum - the field number.
Returns:
the number or null if none.

modifyBlock1000

public int modifyBlock1000(Blockette dataBlk)
                    throws SeedException
Modifies the blockette 1000 based upon the waveform.

Parameters:
dataBlk - the data blockette.
Returns:
the existing data record length exponent or 0 if none.
Throws:
SeedException - if error.

setFieldVal

public static void setFieldVal(Blockette blk,
                               int fieldNum,
                               byte value)
                        throws SeedException
Throws:
SeedException

setFieldVal

public static void setFieldVal(Blockette blk,
                               int fieldNum,
                               int value)
                        throws SeedException
Throws:
SeedException

main

public static void main(java.lang.String[] args)