org.javaseis.io
Class Seisio

java.lang.Object
  extended by org.javaseis.io.Seisio
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SeisioVoxet

public class Seisio
extends java.lang.Object
implements java.io.Serializable

Top level class for managing JavaSeis datasets.

Version:
2006.2
Author:
Chuck Mosher for JavaSeis.org
See Also:
Serialized Form

Nested Class Summary
protected  class Seisio.TraceMap
          The TraceMap class provides mapping support for the JavaSeisFileIO class.
 
Field Summary
protected  java.nio.ByteOrder _byteOrder
           
protected  java.lang.String _comments
           
protected  DataDefinition _dataDefinition
           
protected  java.util.Properties _fileProperties
           
protected  java.io.File _filePropertiesFile
           
protected  long _frameHeaderLength
           
protected  int _frameIndex
           
protected  long _frameLength
           
protected  GridDefinition _gridDefinition
           
protected  java.nio.ByteBuffer _headerBuffer
           
protected  java.nio.IntBuffer _headerBufferView
           
protected  int[][] _headerData
           
protected  long _headerFilePosition
           
protected  VirtualIO _headerIO
           
protected  int _headerLengthBytes
           
protected  int _headerLengthWords
           
protected  boolean _isChanged
           
protected  boolean _isMapped
           
protected  boolean _isReadOnly
           
protected  boolean _isVirtual
           
static java.util.logging.Logger _logger
           
static java.util.logging.Level _logLevel
           
protected  java.nio.ByteBuffer _mapBuffer
           
protected  java.nio.IntBuffer _mapBufferView
           
protected  VirtualIO _mapIO
           
protected  java.lang.String _path
           
protected  int[] _position
           
protected static boolean _testMode
           
protected  java.nio.ByteBuffer _traceBuffer
           
protected  java.nio.FloatBuffer _traceBufferView
           
protected  TraceCompressor _traceCompressor
           
protected  float[][] _traceData
           
protected  long _traceFilePosition
           
protected  long _traceIndex
           
protected  VirtualIO _traceIO
           
protected  int _traceLength
           
protected  int _traceLengthWords
           
protected  Seisio.TraceMap _traceMap
           
protected  TraceProperties _traceProperties
           
protected  java.io.File _tracePropertiesFile
           
protected  int _tracesInFrame
           
protected  boolean _usesHeaderPropertiesFile
           
protected  java.lang.String _version
           
protected  int _versionInput
           
protected  int _versionOutput
           
protected  java.lang.String[] _vfioDirs
           
protected  int _volumeIndex
           
protected  long _volumeLength
           
static java.lang.String FILE_PROPERTIES
           
static java.lang.String MODE_READ_ONLY
           
static java.lang.String MODE_READ_WRITE
           
static java.lang.String NAME_PROPERTIES
           
static java.lang.String TRACE_DATA
           
static java.lang.String TRACE_HEADERS
           
static java.lang.String TRACE_MAP
           
static java.lang.String TRACE_PROPERTIES
           
static int VERSION_C_PROMAX
          Constant that defines the "ProMAX" C version.
static int VERSION_J_REFERENCE
          Constant that defines the "reference" Java version.
 
Constructor Summary
Seisio(java.lang.String path)
          Constructs an instance of Seisio.
Seisio(java.lang.String path, GridDefinition gridDefinition)
          Create a new JavaSeis dataset with a specified GridDefinition, default DataDefinition, and no trace properties.
Seisio(java.lang.String path, GridDefinition gridDefinition, DataDefinition dataDefinition, TraceProperties headerDefinition)
          Constructs an instance of Seisio.
Seisio(java.lang.String path, int ndim, int[] idim)
          Constructs an instance of Seisio.
Seisio(java.lang.String path, int ndim, int[] idim, java.nio.ByteOrder byteOrder)
           
Seisio(java.lang.String path, java.lang.String[] vfioDirs)
          Constructs an instance of Seisio.
 
Method Summary
 void addComments(java.lang.String comments)
          Adds to the JavaSeis file-structure comments (history).
 void close()
          Closes a JavaSeis file-structure.
protected  int convertBytesToTraces(int numBytes)
          Converts number of bytes to number of traces.
protected  int convertTracesToBytes(int numTraces)
          Converts number of traces to number of bytes.
 void create()
          Creates a JavaSeis file-structure (non-virtual).
 void create(java.lang.String[] vfioDirs, int vfioNumExtents, boolean allocateExtents)
          Creates a JavaSeis file-structure (virtual).
 void create(java.lang.String[] vfioDirs, long vfioExtentSize)
          Creates a JavaSeis file-structure (virtual).
protected  void createHeaderPropertiesFile()
          Creates a header properties file.
 boolean delete()
          Deletes a JavaSeis file-structure.
static boolean delete(java.lang.String path)
          Deletes a JavaSeis dataset.
 long findLogicalIndex(int axisIndex, long logicalPosition)
          Finds the index of a logical position, for the specified dimension.
 boolean frameExists(int[] position)
           
 java.util.Iterator<int[]> frameIterator()
          Provide an Iterator that can be used to traverse all of the frames in a JavaSeis dataset.
 java.lang.String getBasePath()
          Returns the base path of the JavaSeis file-structure.
 java.nio.ByteOrder getByteOrder()
          Return the ByteOrder class for this JavaSeis file
 java.lang.String getComments()
          Gets the JavaSeis file-structure comments (history).
 DataDefinition getDataDefinition()
          Gets the JavaSeis data definition.
protected  double getFilePropertyDouble(java.lang.String name)
          Gets the double value of a file property.
protected  int getFilePropertyDoubleArray(java.lang.String name, double[] values, java.lang.String sep)
          Gets the double-array values of a file property.
protected  int getFilePropertyInteger(java.lang.String name)
          Gets the integer value of a file property.
protected  int getFilePropertyIntegerArray(java.lang.String name, int[] values, java.lang.String sep)
          Gets the integer-array values of a file property.
protected  long getFilePropertyLong(java.lang.String name)
          Gets the long value of a file property.
protected  int getFilePropertyLongArray(java.lang.String name, long[] values, java.lang.String sep)
          Gets the long-array values of a file property.
protected  java.lang.String getFilePropertyString(java.lang.String name)
          Gets the string value of a file property.
protected  java.lang.String[] getFilePropertyStringArray(java.lang.String name, java.lang.String sep)
          Gets the string-array values of a file property.
protected  int getFilePropertyStringArray(java.lang.String name, java.lang.String[] values, java.lang.String sep)
          Gets the string-array values of a file property.
 GridDefinition getGridDefinition()
          Gets the JavaSeis grid definition.
 int[][] getHeaderDataArray()
          Gets the frame trace header array used for read/write operations.
 VirtualIO getHeaderIO()
           
 float getHeaderIoRate()
           
 VirtualIO getMapIO()
           
 int[] getPosition()
          Gets the current position.
static AxisLabel[] getPreferredAxisLabels(DataType dataType)
           
static AxisLabel[] getPreferredAxisLabels(java.lang.String dataTypeStr)
           
 long getTotalIoBytes()
           
 float getTotalIoRate()
           
 float getTotalIoTime()
           
 float[][] getTraceDataArray()
          Gets the frame trace data array used for read/write operations.
 long getTraceIndex()
          Return trace index at the current position
 VirtualIO getTraceIO()
           
 float getTraceIoRate()
           
 TraceProperties getTraceProperties()
          Gets the JavaSeis header definition.
 int getTracesInFrame()
          Return number of traces in the current frame
 java.lang.String getVersionString()
          Returns the JavaSeis version as a string.
static boolean isJavaSeis(java.lang.String path)
          Checks if path points to a JavaSeis directory.
 boolean isMapped()
          Returns the "mapped" status of the JavaSeis file-structure.
 boolean isVirtual()
          Returns the "virtual" status of the JavaSeis file-structure.
static void log(java.util.logging.Level logLevel, java.lang.String message)
           
static void main(java.lang.String[] args)
          The "main" method used for testing.
protected  void mapFlush()
          Flushes the trace map buffer.
 void mapFrame(int frameIndex, int numTraces)
          Adds a new frame to a mapped dataset.
 void mapVolume(int[] position)
          Preps a new volume for a mapped dataset.
 void open(java.lang.String openMode)
          Opens a JavaSeis file-structure.
protected  void parseFilePropertiesProMAX_C(java.util.Properties properties)
          Parses the file properties for VERSION_C_PROMAX.
 int readFrame()
          Reads into the the frame buffer from the currently-set position in the dataset.
 int readFrame(int[] position)
          Reads into the the frame buffer from the specified position in the dataset.
 int readFrameHeaders()
          Reads headers only for at the curent position in the dataset.
 void readFrameScattered(int tracesInFrame, long[] traceIndex)
          Read a frame using a set of potentially scattered trace index locations.
 void readMultiArray(MultiArray a, int[] position)
          Reads data from an open JavaSeis dataset into a MultiArray Shape must be greater than or equal to the JavaSeis dataset axis lengths for the subset that will be read.
 void readTrace(long traceIndex)
          Read a frame using a set of potentially scattered trace index locations.
 void readTraceMap(int[][] storage)
           
 void setComments(java.lang.String comments)
          Sets the JavaSeis file-structure comments (history).
protected  void setFilePropertyDoubleArray(java.lang.String name, double[] values)
          Sets the double-array values of a file property.
protected  void setFilePropertyIntArray(java.lang.String name, int[] values)
          Sets the integer-array values of a file property.
protected  void setFilePropertyLongArray(java.lang.String name, long[] values)
          Sets the long-array values of a file property.
protected  void setFilePropertyString(java.lang.String name, java.lang.String value)
          Sets the string value of a file property.
protected  void setFilePropertyStringArray(java.lang.String name, java.lang.String[] values)
          Sets the string-array values of a file property.
static void setLogLevel(java.util.logging.Level logLevel)
           
 void setMapped()
          Sets the mapped status to "true".
 int setPosition(int[] position)
          Sets the current position.
 void setTraceDataArray(float[][] trc)
          Sets the frame trace data array used for read/write operations.
 void setTraceHeaderArray(int[][] hdr)
          Sets the frame header data array used for read/write operations.
 void setVersionToInput(int versionInput)
          Sets the version to use for input.
static java.lang.String[] StringToArray(java.lang.String s, java.lang.String sep, char start, char end)
          Converts a string to a property array.
static Seisio testFileStruct(java.lang.String testDesc, java.lang.String path, java.lang.String[] vfioDirs, int vfioExtentSize)
          The private method used for "main" test.
 void trackIoRate(boolean flag)
           
protected  void transferHeaders(int numTraces, boolean readingHeaders)
          Transfers headers to/from the header buffer.
 int writeFrame()
          Writes from the frame buffer to the currently-set position in the dataset.
 int writeFrame(int[] position)
          Writes from the frame buffer to the specified position in the dataset.
 void writeMultiArray(MultiArray a, int[] position)
          Write data from a MultiArray to an open JavaSeis dataset Shape must be conformable with the JavaSeis dataset axis lengths for the subset that will be written.
 void writeTrace(long traceIndex)
          Writes from the frame buffer to the currently-set position in the dataset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_byteOrder

protected java.nio.ByteOrder _byteOrder

_comments

protected java.lang.String _comments

_dataDefinition

protected DataDefinition _dataDefinition

_fileProperties

protected java.util.Properties _fileProperties

_filePropertiesFile

protected java.io.File _filePropertiesFile

_frameHeaderLength

protected long _frameHeaderLength

_frameIndex

protected int _frameIndex

_frameLength

protected long _frameLength

_gridDefinition

protected GridDefinition _gridDefinition

_headerBuffer

protected java.nio.ByteBuffer _headerBuffer

_headerBufferView

protected java.nio.IntBuffer _headerBufferView

_headerData

protected int[][] _headerData

_headerFilePosition

protected long _headerFilePosition

_headerIO

protected VirtualIO _headerIO

_headerLengthBytes

protected int _headerLengthBytes

_headerLengthWords

protected int _headerLengthWords

_isChanged

protected boolean _isChanged

_isMapped

protected boolean _isMapped

_isReadOnly

protected boolean _isReadOnly

_isVirtual

protected boolean _isVirtual

_logger

public static final java.util.logging.Logger _logger

_logLevel

public static java.util.logging.Level _logLevel

_mapBuffer

protected java.nio.ByteBuffer _mapBuffer

_mapBufferView

protected java.nio.IntBuffer _mapBufferView

_mapIO

protected VirtualIO _mapIO

_path

protected java.lang.String _path

_position

protected int[] _position

_testMode

protected static boolean _testMode

_traceBuffer

protected java.nio.ByteBuffer _traceBuffer

_traceBufferView

protected java.nio.FloatBuffer _traceBufferView

_traceCompressor

protected TraceCompressor _traceCompressor

_traceData

protected float[][] _traceData

_traceFilePosition

protected long _traceFilePosition

_traceIndex

protected long _traceIndex

_traceIO

protected VirtualIO _traceIO

_traceLength

protected int _traceLength

_traceLengthWords

protected int _traceLengthWords

_traceMap

protected Seisio.TraceMap _traceMap

_traceProperties

protected TraceProperties _traceProperties

_tracePropertiesFile

protected java.io.File _tracePropertiesFile

_tracesInFrame

protected int _tracesInFrame

_usesHeaderPropertiesFile

protected boolean _usesHeaderPropertiesFile

_version

protected java.lang.String _version

_versionInput

protected int _versionInput

_versionOutput

protected int _versionOutput

_vfioDirs

protected java.lang.String[] _vfioDirs

_volumeIndex

protected int _volumeIndex

_volumeLength

protected long _volumeLength

FILE_PROPERTIES

public static java.lang.String FILE_PROPERTIES

MODE_READ_ONLY

public static java.lang.String MODE_READ_ONLY

MODE_READ_WRITE

public static java.lang.String MODE_READ_WRITE

NAME_PROPERTIES

public static java.lang.String NAME_PROPERTIES

TRACE_DATA

public static java.lang.String TRACE_DATA

TRACE_HEADERS

public static java.lang.String TRACE_HEADERS

TRACE_MAP

public static java.lang.String TRACE_MAP

TRACE_PROPERTIES

public static java.lang.String TRACE_PROPERTIES

VERSION_C_PROMAX

public static final int VERSION_C_PROMAX
Constant that defines the "ProMAX" C version.

See Also:
Constant Field Values

VERSION_J_REFERENCE

public static final int VERSION_J_REFERENCE
Constant that defines the "reference" Java version.

See Also:
Constant Field Values
Constructor Detail

Seisio

public Seisio(java.lang.String path)
Constructs an instance of Seisio.

Parameters:
path - The JavaSeis file-structure path.

Seisio

public Seisio(java.lang.String path,
              GridDefinition gridDefinition)
       throws SeisException
Create a new JavaSeis dataset with a specified GridDefinition, default DataDefinition, and no trace properties.

Parameters:
path - The JavaSeis file path.
gridDefinition - The JavaSeis grid definition
Throws:
SeisException

Seisio

public Seisio(java.lang.String path,
              GridDefinition gridDefinition,
              DataDefinition dataDefinition,
              TraceProperties headerDefinition)
       throws SeisException
Constructs an instance of Seisio.

Parameters:
path - The JavaSeis file-structure path.
gridDefinition - The JavaSeis grid definition.
dataDefinition - The JavaSeis data definition.
headerDefinition - The JavaSeis header definition.
Throws:
SeisException

Seisio

public Seisio(java.lang.String path,
              int ndim,
              int[] idim)
       throws SeisException
Constructs an instance of Seisio.

Parameters:
path - The JavaSeis file-structure path.
gridDefinition - The JavaSeis grid definition.
dataDefinition - The JavaSeis data definition.
headerDefinition - The JavaSeis header definition.
Throws:
SeisException

Seisio

public Seisio(java.lang.String path,
              int ndim,
              int[] idim,
              java.nio.ByteOrder byteOrder)
       throws SeisException
Throws:
SeisException

Seisio

public Seisio(java.lang.String path,
              java.lang.String[] vfioDirs)
Constructs an instance of Seisio.

Parameters:
path - The JavaSeis file-structure path.
Method Detail

addComments

public void addComments(java.lang.String comments)
Adds to the JavaSeis file-structure comments (history).

Parameters:
comments - The JavaSeis file-structure comments to add.

close

public void close()
           throws SeisException
Closes a JavaSeis file-structure.

Parameters:
openMode - The open mode (MODE_READ_ONLY, MODE_READ_WRITE).
Throws:
SeisException

convertBytesToTraces

protected int convertBytesToTraces(int numBytes)
Converts number of bytes to number of traces.

Parameters:
numBytes - The number of bytes.
Returns:
The number of traces; -1 if not exact trace multiple.

convertTracesToBytes

protected int convertTracesToBytes(int numTraces)
Converts number of traces to number of bytes.

Parameters:
numTraces - The number of traces.
Returns:
The number of bytes.

create

public void create()
            throws SeisException
Creates a JavaSeis file-structure (non-virtual).

Throws:
SeisException

create

public void create(java.lang.String[] vfioDirs,
                   int vfioNumExtents,
                   boolean allocateExtents)
            throws SeisException
Creates a JavaSeis file-structure (virtual).

Parameters:
vfioDirs - The directories to use for virtual file extents.
vfioNumExtents - The number of virtual exent files to create
Allocate - the extents during create
Throws:
SeisException

create

public void create(java.lang.String[] vfioDirs,
                   long vfioExtentSize)
            throws SeisException
Creates a JavaSeis file-structure (virtual).

Parameters:
vfioDirs - The directories to use for virtual file extents.
vfioExtentSize - The maximum size of virtual file extents.
Throws:
SeisException

createHeaderPropertiesFile

protected void createHeaderPropertiesFile()
                                   throws SeisException
Creates a header properties file.

Throws:
SeisException - Thrown on file creation and properties errors.

delete

public boolean delete()
Deletes a JavaSeis file-structure.


delete

public static boolean delete(java.lang.String path)
Deletes a JavaSeis dataset.

Parameters:
path - (in) path name for dataset to be deleted.
Returns:
true if successfull; false on errors.

findLogicalIndex

public long findLogicalIndex(int axisIndex,
                             long logicalPosition)
                      throws SeisException
Finds the index of a logical position, for the specified dimension.

Parameters:
axisIndex - The index of the dimension.
logicalPosition - The logical position within the dimension.
Returns:
The logical index.
Throws:
SeisException - Thrown on positioning error.

frameExists

public boolean frameExists(int[] position)
                    throws SeisException
Throws:
SeisException

frameIterator

public java.util.Iterator<int[]> frameIterator()
Provide an Iterator that can be used to traverse all of the frames in a JavaSeis dataset. The iterator returns the next available frame in the dataset into a MultiArray supplied to the constructor for the Iterator. The return value is the dataset position from which the frame was read. Typical usage when reading from input to output:
 Seisio inseis;
 Seisio outseis;
   ... open input and create output ...
 float[][] intrc = inseis.getTraceDataArray(); 
 float[][] outtrc = outseis.getTraceDataArray();
 Iterator in = inseis.frameIterator();
 while (in.hasNext()) {
   position = in.next();
   operateOnData( intrc, outtrc );
   outseis.setPosition( position );
   outseis.writeFrame();
 }
 

Returns:
Iterator for frames in the dataset

getBasePath

public java.lang.String getBasePath()
Returns the base path of the JavaSeis file-structure.

Returns:
The base path of the JavaSeis file-structure.

getByteOrder

public java.nio.ByteOrder getByteOrder()
Return the ByteOrder class for this JavaSeis file

Returns:

getComments

public java.lang.String getComments()
Gets the JavaSeis file-structure comments (history).

Returns:
The JavaSeis file-structure comments.

getDataDefinition

public DataDefinition getDataDefinition()
Gets the JavaSeis data definition.

Returns:
The JavaSeis data definition.

getFilePropertyDouble

protected double getFilePropertyDouble(java.lang.String name)
                                throws SeisException
Gets the double value of a file property.

Parameters:
name - The property name.
Returns:
The property double value.
Throws:
SeisException - Thrown on property error.

getFilePropertyDoubleArray

protected int getFilePropertyDoubleArray(java.lang.String name,
                                         double[] values,
                                         java.lang.String sep)
                                  throws SeisException
Gets the double-array values of a file property.

Parameters:
name - The property name.
values - The property double values storage.
Returns:
The number of property values.
Throws:
SeisException - Thrown on property error.

getFilePropertyInteger

protected int getFilePropertyInteger(java.lang.String name)
                              throws SeisException
Gets the integer value of a file property.

Parameters:
name - The property name.
Returns:
The property integer value.
Throws:
SeisException - Thrown on property error.

getFilePropertyIntegerArray

protected int getFilePropertyIntegerArray(java.lang.String name,
                                          int[] values,
                                          java.lang.String sep)
                                   throws SeisException
Gets the integer-array values of a file property.

Parameters:
name - The property name.
values - The property integer values storage.
Returns:
The number of property values.
Throws:
SeisException - Thrown on property error.

getFilePropertyLong

protected long getFilePropertyLong(java.lang.String name)
                            throws SeisException
Gets the long value of a file property.

Parameters:
name - The property name.
Returns:
The property long value.
Throws:
SeisException - Thrown on property error.

getFilePropertyLongArray

protected int getFilePropertyLongArray(java.lang.String name,
                                       long[] values,
                                       java.lang.String sep)
                                throws SeisException
Gets the long-array values of a file property.

Parameters:
name - The property name.
values - The property long values storage.
Returns:
The number of property values.
Throws:
SeisException - Thrown on property error.

getFilePropertyString

protected java.lang.String getFilePropertyString(java.lang.String name)
                                          throws SeisException
Gets the string value of a file property.

Parameters:
name - The property name.
Returns:
The property string value.
Throws:
SeisException - Thrown on property error.

getFilePropertyStringArray

protected java.lang.String[] getFilePropertyStringArray(java.lang.String name,
                                                        java.lang.String sep)
                                                 throws SeisException
Gets the string-array values of a file property.

Parameters:
name - The property name.
Returns:
The property string values.
Throws:
SeisException - Thrown on property error.

getFilePropertyStringArray

protected int getFilePropertyStringArray(java.lang.String name,
                                         java.lang.String[] values,
                                         java.lang.String sep)
                                  throws SeisException
Gets the string-array values of a file property.

Parameters:
name - The property name.
values - The property string values storage.
Returns:
The number of property values.
Throws:
SeisException - Thrown on property error.

getGridDefinition

public GridDefinition getGridDefinition()
Gets the JavaSeis grid definition.

Returns:
The JavaSeis grid definition.

getHeaderDataArray

public int[][] getHeaderDataArray()
Gets the frame trace header array used for read/write operations.

Returns:
The 2D trace header integer-array.

getHeaderIO

public VirtualIO getHeaderIO()

getHeaderIoRate

public float getHeaderIoRate()

getMapIO

public VirtualIO getMapIO()

getPosition

public int[] getPosition()
Gets the current position.

Returns:
The current position.

getPreferredAxisLabels

public static AxisLabel[] getPreferredAxisLabels(DataType dataType)
                                          throws SeisException
Throws:
SeisException

getPreferredAxisLabels

public static AxisLabel[] getPreferredAxisLabels(java.lang.String dataTypeStr)
                                          throws SeisException
Throws:
SeisException

getTotalIoBytes

public long getTotalIoBytes()

getTotalIoRate

public float getTotalIoRate()

getTotalIoTime

public float getTotalIoTime()

getTraceDataArray

public float[][] getTraceDataArray()
Gets the frame trace data array used for read/write operations.

Returns:
The 2D trace data float-array.

getTraceIndex

public long getTraceIndex()
Return trace index at the current position

Returns:
trace index at the current position

getTraceIO

public VirtualIO getTraceIO()

getTraceIoRate

public float getTraceIoRate()

getTraceProperties

public TraceProperties getTraceProperties()
Gets the JavaSeis header definition.

Returns:
The JavaSeis header definition.

getTracesInFrame

public int getTracesInFrame()
Return number of traces in the current frame

Returns:
number of traces in the frame

getVersionString

public java.lang.String getVersionString()
Returns the JavaSeis version as a string.

Returns:
The JavaSeis version as a string.

isJavaSeis

public static boolean isJavaSeis(java.lang.String path)
Checks if path points to a JavaSeis directory. Only checks for existence of FileProperties and TraceData files, not their validity.

Parameters:
path - The file path.
Returns:
true if JavaSeis files exist; otherwise false.

isMapped

public boolean isMapped()
Returns the "mapped" status of the JavaSeis file-structure.

Returns:
true if mapped; false otherwise.

isVirtual

public boolean isVirtual()
Returns the "virtual" status of the JavaSeis file-structure.

Returns:
true if virtual; false if non-virtual.

log

public static void log(java.util.logging.Level logLevel,
                       java.lang.String message)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
The "main" method used for testing.

Parameters:
args - The arguments for testing.
Throws:
SeisException - Thrown on testing errors.
java.lang.Exception

mapFlush

protected void mapFlush()
                 throws SeisException
Flushes the trace map buffer.

Throws:
SeisException - Thrown on trace map flush errors.

mapFrame

public void mapFrame(int frameIndex,
                     int numTraces)
              throws SeisException
Adds a new frame to a mapped dataset.

Parameters:
frameIndex - The index of the frame to be added.
numTraces - The number of traces in the frame.
Throws:
SeisException - Thrown on invalid position or mapping errors.

mapVolume

public void mapVolume(int[] position)
               throws SeisException
Preps a new volume for a mapped dataset.

Parameters:
position - The volume location for subsequent mapping operations.
Throws:
SeisException - Thrown on invalid position.

open

public void open(java.lang.String openMode)
          throws SeisException
Opens a JavaSeis file-structure.

Parameters:
openMode - The open mode (MODE_READ_ONLY, MODE_READ_WRITE).
Throws:
SeisException

parseFilePropertiesProMAX_C

protected void parseFilePropertiesProMAX_C(java.util.Properties properties)
                                    throws SeisException
Parses the file properties for VERSION_C_PROMAX.

Parameters:
properties - The properties to parse.
Throws:
SeisException - Thrown on property parsing errors.

readFrame

public int readFrame()
              throws SeisException
Reads into the the frame buffer from the currently-set position in the dataset.

Returns:
The number of traces in the frame, or zero on end-of-file.
Throws:
SeisException - Throw on read errors.

readFrame

public int readFrame(int[] position)
              throws SeisException
Reads into the the frame buffer from the specified position in the dataset.

Parameters:
position - The position to set.
Returns:
The number of trace in the frame, or zero on end-of-file.
Throws:
SeisException - Throw on read errors.

readFrameHeaders

public int readFrameHeaders()
                     throws SeisException
Reads headers only for at the curent position in the dataset.

Returns:
The number of traces in the frame, or zero on end-of-file.
Throws:
SeisException - Throw on read errors.

readFrameScattered

public void readFrameScattered(int tracesInFrame,
                               long[] traceIndex)
                        throws SeisException
Read a frame using a set of potentially scattered trace index locations. Trace locations are defined by a long integer sequence number from 0 to NTraces-1, where NTraces is the total number of traces in the file: NTraces = TracesPerFrame * FramesPerVolume * Volumes

Parameters:
traceIndex - array of trace index locations
Throws:
SeisException - on read errors

readMultiArray

public void readMultiArray(MultiArray a,
                           int[] position)
                    throws SeisException
Reads data from an open JavaSeis dataset into a MultiArray Shape must be greater than or equal to the JavaSeis dataset axis lengths for the subset that will be read. The MultiArray must have at least 2 and not more than 5 dimensions. The first "n" elements of the position array are ignored, where "n" is the number of dimensions of the MultiArray.

Parameters:
a - MultiArray that will contain data on output.
position - starting position in the JavaSeis dataset
Throws:
SeisException - on errors

readTrace

public void readTrace(long traceIndex)
               throws SeisException
Read a frame using a set of potentially scattered trace index locations. Trace locations are defined by a long integer sequence number from 0 to NTraces-1, where NTraces is the total number of traces in the file: NTraces = TracesPerFrame * FramesPerVolume * Volumes

Parameters:
traceIndex - array of trace index locations
Throws:
SeisException - on read errors

readTraceMap

public void readTraceMap(int[][] storage)
                  throws java.lang.Exception
Throws:
java.lang.Exception

setComments

public void setComments(java.lang.String comments)
Sets the JavaSeis file-structure comments (history).

Parameters:
comments - The JavaSeis file-structure comments.

setFilePropertyDoubleArray

protected void setFilePropertyDoubleArray(java.lang.String name,
                                          double[] values)
Sets the double-array values of a file property.

Parameters:
name - The property name.
values - The property values.

setFilePropertyIntArray

protected void setFilePropertyIntArray(java.lang.String name,
                                       int[] values)
Sets the integer-array values of a file property.

Parameters:
name - The property name.
values - The property values.

setFilePropertyLongArray

protected void setFilePropertyLongArray(java.lang.String name,
                                        long[] values)
Sets the long-array values of a file property.

Parameters:
name - The property name.
values - The property values.

setFilePropertyString

protected void setFilePropertyString(java.lang.String name,
                                     java.lang.String value)
Sets the string value of a file property.

Parameters:
name - The property name.
value - The property value.

setFilePropertyStringArray

protected void setFilePropertyStringArray(java.lang.String name,
                                          java.lang.String[] values)
Sets the string-array values of a file property.

Parameters:
name - The property name.
values - The property values.

setLogLevel

public static void setLogLevel(java.util.logging.Level logLevel)

setMapped

public void setMapped()
Sets the mapped status to "true".


setPosition

public int setPosition(int[] position)
                throws SeisException
Sets the current position.

Parameters:
position - The position to set.
Throws:
SeisException - Thrown on positioning errors.

setTraceDataArray

public void setTraceDataArray(float[][] trc)
                       throws SeisException
Sets the frame trace data array used for read/write operations.

Parameters:
trc - the array use for trace I/O operations
Throws:
SeisException - if input array is too small

setTraceHeaderArray

public void setTraceHeaderArray(int[][] hdr)
                         throws SeisException
Sets the frame header data array used for read/write operations.

Parameters:
hdr - the array use for header I/O operations
Throws:
SeisException - if input array is too small

setVersionToInput

public void setVersionToInput(int versionInput)
Sets the version to use for input.

Parameters:
version - The version (see JavaSeisDefs) to use for input.

StringToArray

public static java.lang.String[] StringToArray(java.lang.String s,
                                               java.lang.String sep,
                                               char start,
                                               char end)
Converts a string to a property array.

Parameters:
s - The input string to be converted.
sep - The separator to use for parsing array elements.
start - The character used to delimit start of string (i.e. "{").
end - The character used to delimit end of string (i.e. ",}").
Returns:
The array of strings, broken out from input string.

testFileStruct

public static Seisio testFileStruct(java.lang.String testDesc,
                                    java.lang.String path,
                                    java.lang.String[] vfioDirs,
                                    int vfioExtentSize)
                             throws java.lang.Exception
The private method used for "main" test.

Parameters:
testDesc - The description of the dataset being tested (used only for printout).
path - The full path for the dataset.
vfioDirs - The array of directories to use for "virtual" files; use null for "non-virtual".
vfioExtentSize - The maximum extent size to use for "virtual" files.
Throws:
SeisException - Thrown on testing errors.
java.lang.Exception

trackIoRate

public void trackIoRate(boolean flag)

transferHeaders

protected void transferHeaders(int numTraces,
                               boolean readingHeaders)
Transfers headers to/from the header buffer.

Parameters:
numTraces - The number of traces for which to copy headers.
readingHeaders - true if reading; false if writing.

writeFrame

public int writeFrame()
               throws SeisException
Writes from the frame buffer to the currently-set position in the dataset.

Returns:
The number of trace in the frame, or zero on end-of-file.
Throws:
SeisException - Throw on write errors.

writeFrame

public int writeFrame(int[] position)
               throws SeisException
Writes from the frame buffer to the specified position in the dataset.

Parameters:
position - The position to set.
Returns:
The number of trace in the frame, or zero on end-of-file.
Throws:
SeisException - Throw on write errors.

writeMultiArray

public void writeMultiArray(MultiArray a,
                            int[] position)
                     throws SeisException
Write data from a MultiArray to an open JavaSeis dataset Shape must be conformable with the JavaSeis dataset axis lengths for the subset that will be written. The MultiArray must have at least 2 and not more than 5 dimensions. The first "n" elements of the position array are ignored, where "n" is the number of dimensions of the MultiArray.

Parameters:
a - MultiArray containing data to be written.
position - starting position in the JavaSeis dataset
Throws:
SeisException - on errors

writeTrace

public void writeTrace(long traceIndex)
                throws SeisException
Writes from the frame buffer to the currently-set position in the dataset.

Throws:
SeisException - Throw on write errors.