edu.sc.seis.fissuresUtil.mseed
Class FissuresConvert

java.lang.Object
  extended by edu.sc.seis.fissuresUtil.mseed.FissuresConvert

public class FissuresConvert
extends java.lang.Object

FissuresConvert.java Created: Fri Oct 15 09:09:32 1999


Field Summary
static TimeInterval DAY
           
static int RECORD_SIZE_1024
           
static byte RECORD_SIZE_1024_POWER
           
static int RECORD_SIZE_256
           
static byte RECORD_SIZE_256_POWER
           
static int RECORD_SIZE_4096
           
static byte RECORD_SIZE_4096_POWER
           
static int RECORD_SIZE_512
           
static byte RECORD_SIZE_512_POWER
           
 
Method Summary
static LocalSeismogramImpl append(LocalSeismogramImpl seis, DataRecord seed)
          assume all records from same channel and in time order with no gaps/overlaps.
static LocalSeismogramImpl append(LocalSeismogramImpl seis, DataRecord[] seed)
          assume all records from same channel and in time order with no gaps/overlaps.
static short[] calcSeedMultipilerFactor(SamplingImpl sampling)
          calculates the seed representation of a sample rate as factor and multiplier.
static SeismogramAttrImpl convertAttributes(DataRecord seed)
           
static TimeSeriesDataSel convertData(DataRecord seed)
           
static SamplingImpl convertSampleRate(DataRecord seed)
           
static SamplingImpl convertSampleRate(int multi, int factor)
           
static UnitImpl fromBytes(byte[] bytes)
          Turns a byte array containing just a serialized UnitImpl object back into an UnitImpl
static Btime getBtime(MicroSecondDate date)
           
static java.lang.String getISOTime(Btime startStruct)
          get the value of start time in ISO format
static MicroSecondDate getMicroSecondTime(Btime startStruct)
          get the value of start time in MicroSecondDate format
static MicroSecondTimeRange getTimeRange(BtimeRange bTime)
           
static byte[] toBytes(UnitImpl obj)
          Turns a UnitImpl into a byte array using Java serialization
static EncodedData[] toEncodedData(int[] data)
           
static LocalSeismogramImpl toFissures(DataRecord seed)
           
static LocalSeismogramImpl toFissures(DataRecord[] seed)
          assume all records from same channel and in time order with no gaps/overlaps.
static LocalSeismogramImpl toFissures(DataRecord[] seed, byte defaultCompression, byte defaultByteOrder)
          assume all records from same channel and in time order with no gaps/overlaps.
static java.util.List<LocalSeismogramImpl> toFissures(java.util.List<DataRecord> seed)
          assume all records from same channel and in time order.
static LocalSeismogramImpl toFissures(java.lang.String filename)
           
static LocalSeismogramImpl toFissuresSeismogram(java.util.List<DataRecord> seed)
          assume all records from same channel and in time order with no gaps/overlaps.
static DataRecord[] toMSeed(DataChunk chunk)
           
static java.util.LinkedList<DataRecord> toMSeed(EncodedData[] eData, ChannelId channel_id, MicroSecondDate start, SamplingImpl sampling_info, int seqStart)
           
static java.util.LinkedList<DataRecord> toMSeed(EncodedData[] eData, ChannelId channel_id, MicroSecondDate start, SamplingImpl sampling_info, int seqStart, char typeCode)
           
static java.util.List<DataRecord> toMSeed(java.util.List<PlottableChunk> chunkList)
           
static DataRecord[] toMSeed(LocalSeismogram seis)
           
static DataRecord[] toMSeed(LocalSeismogram seis, int seqStart)
           
static PlottableChunk toPlottable(DataRecord dr)
           
static java.util.List<PlottableChunk> toPlottable(java.util.List<DataRecord> drList)
          Exctract plottables stored in miniseed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RECORD_SIZE_4096_POWER

public static final byte RECORD_SIZE_4096_POWER
See Also:
Constant Field Values

RECORD_SIZE_4096

public static int RECORD_SIZE_4096

RECORD_SIZE_1024_POWER

public static final byte RECORD_SIZE_1024_POWER
See Also:
Constant Field Values

RECORD_SIZE_1024

public static int RECORD_SIZE_1024

RECORD_SIZE_512_POWER

public static final byte RECORD_SIZE_512_POWER
See Also:
Constant Field Values

RECORD_SIZE_512

public static int RECORD_SIZE_512

RECORD_SIZE_256_POWER

public static final byte RECORD_SIZE_256_POWER
See Also:
Constant Field Values

RECORD_SIZE_256

public static int RECORD_SIZE_256

DAY

public static final TimeInterval DAY
Method Detail

toMSeed

public static DataRecord[] toMSeed(LocalSeismogram seis)
                            throws SeedFormatException
Throws:
SeedFormatException

toMSeed

public static DataRecord[] toMSeed(LocalSeismogram seis,
                                   int seqStart)
                            throws SeedFormatException
Throws:
SeedFormatException

toMSeed

public static DataRecord[] toMSeed(DataChunk chunk)
                            throws SeedFormatException
Throws:
SeedFormatException

toMSeed

public static java.util.LinkedList<DataRecord> toMSeed(EncodedData[] eData,
                                                       ChannelId channel_id,
                                                       MicroSecondDate start,
                                                       SamplingImpl sampling_info,
                                                       int seqStart)
                                                throws SeedFormatException
Throws:
SeedFormatException

toMSeed

public static java.util.LinkedList<DataRecord> toMSeed(EncodedData[] eData,
                                                       ChannelId channel_id,
                                                       MicroSecondDate start,
                                                       SamplingImpl sampling_info,
                                                       int seqStart,
                                                       char typeCode)
                                                throws SeedFormatException
Throws:
SeedFormatException

calcSeedMultipilerFactor

public static short[] calcSeedMultipilerFactor(SamplingImpl sampling)
calculates the seed representation of a sample rate as factor and multiplier.


toFissures

public static LocalSeismogramImpl toFissures(java.lang.String filename)
                                      throws SeedFormatException,
                                             java.io.IOException,
                                             FissuresException
Throws:
SeedFormatException
java.io.IOException
FissuresException

toFissures

public static java.util.List<LocalSeismogramImpl> toFissures(java.util.List<DataRecord> seed)
                                                      throws SeedFormatException,
                                                             FissuresException
assume all records from same channel and in time order. Separate seismograms created if there are gaps/overlaps.

Throws:
SeedFormatException
FissuresException

toFissuresSeismogram

public static LocalSeismogramImpl toFissuresSeismogram(java.util.List<DataRecord> seed)
                                                throws SeedFormatException,
                                                       FissuresException
assume all records from same channel and in time order with no gaps/overlaps.

Throws:
SeedFormatException
FissuresException

toFissures

public static LocalSeismogramImpl toFissures(DataRecord[] seed)
                                      throws SeedFormatException,
                                             FissuresException
assume all records from same channel and in time order with no gaps/overlaps.

Throws:
SeedFormatException
FissuresException

toFissures

public static LocalSeismogramImpl toFissures(DataRecord[] seed,
                                             byte defaultCompression,
                                             byte defaultByteOrder)
                                      throws SeedFormatException,
                                             FissuresException
assume all records from same channel and in time order with no gaps/overlaps. Specifying a default compression and byte order. This should only be used in cases where the miniseed records are older than the Blockette 1000 SEED specification and where the compression and byte order are known from outside sources. Per the SEED specification, valid miniseed MUST have a blockette 1000 and so this method exists only for reading older data.

Parameters:
defaultCompression - compression to use if there is no blockette 1000, See the SEED specification for blockette 1000 for valid compression types.
defaultByteOrder - byte order to use if there is no blockette 1000. 0 indicates little-endian order and a 1 indicates big-endian.
Throws:
SeedFormatException
FissuresException

append

public static LocalSeismogramImpl append(LocalSeismogramImpl seis,
                                         DataRecord[] seed)
                                  throws SeedFormatException,
                                         FissuresException
assume all records from same channel and in time order with no gaps/overlaps.

Throws:
SeedFormatException
FissuresException

append

public static LocalSeismogramImpl append(LocalSeismogramImpl seis,
                                         DataRecord seed)
                                  throws SeedFormatException,
                                         FissuresException
assume all records from same channel and in time order with no gaps/overlaps.

Throws:
SeedFormatException
FissuresException

toFissures

public static LocalSeismogramImpl toFissures(DataRecord seed)
                                      throws SeedFormatException
Throws:
SeedFormatException

toMSeed

public static java.util.List<DataRecord> toMSeed(java.util.List<PlottableChunk> chunkList)
                                          throws SeedFormatException
Throws:
SeedFormatException

toPlottable

public static java.util.List<PlottableChunk> toPlottable(java.util.List<DataRecord> drList)
                                                  throws SeedFormatException,
                                                         FissuresException
Exctract plottables stored in miniseed. Assume all datarecords are in order and from the same channel.

Throws:
FissuresException
SeedFormatException

toPlottable

public static PlottableChunk toPlottable(DataRecord dr)
                                  throws SeedFormatException,
                                         FissuresException
Throws:
SeedFormatException
FissuresException

convertSampleRate

public static SamplingImpl convertSampleRate(DataRecord seed)

convertSampleRate

public static SamplingImpl convertSampleRate(int multi,
                                             int factor)

convertData

public static TimeSeriesDataSel convertData(DataRecord seed)
                                     throws SeedFormatException
Throws:
SeedFormatException

toEncodedData

public static EncodedData[] toEncodedData(int[] data)

convertAttributes

public static SeismogramAttrImpl convertAttributes(DataRecord seed)
                                            throws SeedFormatException
Throws:
SeedFormatException

getISOTime

public static java.lang.String getISOTime(Btime startStruct)
get the value of start time in ISO format

Returns:
the value of start time in ISO format

getMicroSecondTime

public static MicroSecondDate getMicroSecondTime(Btime startStruct)
get the value of start time in MicroSecondDate format

Returns:
the value of start time in MicroSecondDate format

getBtime

public static Btime getBtime(MicroSecondDate date)

getTimeRange

public static MicroSecondTimeRange getTimeRange(BtimeRange bTime)

toBytes

public static byte[] toBytes(UnitImpl obj)
Turns a UnitImpl into a byte array using Java serialization


fromBytes

public static UnitImpl fromBytes(byte[] bytes)
                          throws java.io.IOException
Turns a byte array containing just a serialized UnitImpl object back into an UnitImpl

Throws:
java.io.IOException