|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javaseis.io.Seisio
public class Seisio
Top level class for managing JavaSeis datasets.
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 |
---|
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
public static final java.util.logging.Logger _logger
public 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
public static java.lang.String FILE_PROPERTIES
public static java.lang.String MODE_READ_ONLY
public static java.lang.String MODE_READ_WRITE
public static java.lang.String NAME_PROPERTIES
public static java.lang.String TRACE_DATA
public static java.lang.String TRACE_HEADERS
public static java.lang.String TRACE_MAP
public static java.lang.String TRACE_PROPERTIES
public static final int VERSION_C_PROMAX
public static final int VERSION_J_REFERENCE
Constructor Detail |
---|
public Seisio(java.lang.String path)
path
- The JavaSeis file-structure path.public Seisio(java.lang.String path, GridDefinition gridDefinition) throws SeisException
path
- The JavaSeis file path.gridDefinition
- The JavaSeis grid definition
SeisException
public Seisio(java.lang.String path, GridDefinition gridDefinition, DataDefinition dataDefinition, TraceProperties headerDefinition) throws SeisException
path
- The JavaSeis file-structure path.gridDefinition
- The JavaSeis grid definition.dataDefinition
- The JavaSeis data definition.headerDefinition
- The JavaSeis header definition.
SeisException
public Seisio(java.lang.String path, int ndim, int[] idim) throws SeisException
path
- The JavaSeis file-structure path.gridDefinition
- The JavaSeis grid definition.dataDefinition
- The JavaSeis data definition.headerDefinition
- The JavaSeis header definition.
SeisException
public Seisio(java.lang.String path, int ndim, int[] idim, java.nio.ByteOrder byteOrder) throws SeisException
SeisException
public Seisio(java.lang.String path, java.lang.String[] vfioDirs)
path
- The JavaSeis file-structure path.Method Detail |
---|
public void addComments(java.lang.String comments)
comments
- The JavaSeis file-structure comments to add.public void close() throws SeisException
openMode
- The open mode (MODE_READ_ONLY, MODE_READ_WRITE).
SeisException
protected int convertBytesToTraces(int numBytes)
numBytes
- The number of bytes.
protected int convertTracesToBytes(int numTraces)
numTraces
- The number of traces.
public void create() throws SeisException
SeisException
public void create(java.lang.String[] vfioDirs, int vfioNumExtents, boolean allocateExtents) throws SeisException
vfioDirs
- The directories to use for virtual file extents.vfioNumExtents
- The number of virtual exent files to createAllocate
- the extents during create
SeisException
public void create(java.lang.String[] vfioDirs, long vfioExtentSize) throws SeisException
vfioDirs
- The directories to use for virtual file extents.vfioExtentSize
- The maximum size of virtual file extents.
SeisException
protected void createHeaderPropertiesFile() throws SeisException
SeisException
- Thrown on file creation and properties errors.public boolean delete()
public static boolean delete(java.lang.String path)
path
- (in) path name for dataset to be deleted.
public long findLogicalIndex(int axisIndex, long logicalPosition) throws SeisException
axisIndex
- The index of the dimension.logicalPosition
- The logical position within the dimension.
SeisException
- Thrown on positioning error.public boolean frameExists(int[] position) throws SeisException
SeisException
public java.util.Iterator<int[]> frameIterator()
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(); }
public java.lang.String getBasePath()
public java.nio.ByteOrder getByteOrder()
public java.lang.String getComments()
public DataDefinition getDataDefinition()
protected double getFilePropertyDouble(java.lang.String name) throws SeisException
name
- The property name.
SeisException
- Thrown on property error.protected int getFilePropertyDoubleArray(java.lang.String name, double[] values, java.lang.String sep) throws SeisException
name
- The property name.values
- The property double values storage.
SeisException
- Thrown on property error.protected int getFilePropertyInteger(java.lang.String name) throws SeisException
name
- The property name.
SeisException
- Thrown on property error.protected int getFilePropertyIntegerArray(java.lang.String name, int[] values, java.lang.String sep) throws SeisException
name
- The property name.values
- The property integer values storage.
SeisException
- Thrown on property error.protected long getFilePropertyLong(java.lang.String name) throws SeisException
name
- The property name.
SeisException
- Thrown on property error.protected int getFilePropertyLongArray(java.lang.String name, long[] values, java.lang.String sep) throws SeisException
name
- The property name.values
- The property long values storage.
SeisException
- Thrown on property error.protected java.lang.String getFilePropertyString(java.lang.String name) throws SeisException
name
- The property name.
SeisException
- Thrown on property error.protected java.lang.String[] getFilePropertyStringArray(java.lang.String name, java.lang.String sep) throws SeisException
name
- The property name.
SeisException
- Thrown on property error.protected int getFilePropertyStringArray(java.lang.String name, java.lang.String[] values, java.lang.String sep) throws SeisException
name
- The property name.values
- The property string values storage.
SeisException
- Thrown on property error.public GridDefinition getGridDefinition()
public int[][] getHeaderDataArray()
public VirtualIO getHeaderIO()
public float getHeaderIoRate()
public VirtualIO getMapIO()
public int[] getPosition()
public static AxisLabel[] getPreferredAxisLabels(DataType dataType) throws SeisException
SeisException
public static AxisLabel[] getPreferredAxisLabels(java.lang.String dataTypeStr) throws SeisException
SeisException
public long getTotalIoBytes()
public float getTotalIoRate()
public float getTotalIoTime()
public float[][] getTraceDataArray()
public long getTraceIndex()
public VirtualIO getTraceIO()
public float getTraceIoRate()
public TraceProperties getTraceProperties()
public int getTracesInFrame()
public java.lang.String getVersionString()
public static boolean isJavaSeis(java.lang.String path)
path
- The file path.
public boolean isMapped()
public boolean isVirtual()
public static void log(java.util.logging.Level logLevel, java.lang.String message)
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- The arguments for testing.
SeisException
- Thrown on testing errors.
java.lang.Exception
protected void mapFlush() throws SeisException
SeisException
- Thrown on trace map flush errors.public void mapFrame(int frameIndex, int numTraces) throws SeisException
frameIndex
- The index of the frame to be added.numTraces
- The number of traces in the frame.
SeisException
- Thrown on invalid position or mapping errors.public void mapVolume(int[] position) throws SeisException
position
- The volume location for subsequent mapping operations.
SeisException
- Thrown on invalid position.public void open(java.lang.String openMode) throws SeisException
openMode
- The open mode (MODE_READ_ONLY, MODE_READ_WRITE).
SeisException
protected void parseFilePropertiesProMAX_C(java.util.Properties properties) throws SeisException
properties
- The properties to parse.
SeisException
- Thrown on property parsing errors.public int readFrame() throws SeisException
SeisException
- Throw on read errors.public int readFrame(int[] position) throws SeisException
position
- The position to set.
SeisException
- Throw on read errors.public int readFrameHeaders() throws SeisException
SeisException
- Throw on read errors.public void readFrameScattered(int tracesInFrame, long[] traceIndex) throws SeisException
traceIndex
- array of trace index locations
SeisException
- on read errorspublic void readMultiArray(MultiArray a, int[] position) throws SeisException
a
- MultiArray that will contain data on output.position
- starting position in the JavaSeis dataset
SeisException
- on errorspublic void readTrace(long traceIndex) throws SeisException
traceIndex
- array of trace index locations
SeisException
- on read errorspublic void readTraceMap(int[][] storage) throws java.lang.Exception
java.lang.Exception
public void setComments(java.lang.String comments)
comments
- The JavaSeis file-structure comments.protected void setFilePropertyDoubleArray(java.lang.String name, double[] values)
name
- The property name.values
- The property values.protected void setFilePropertyIntArray(java.lang.String name, int[] values)
name
- The property name.values
- The property values.protected void setFilePropertyLongArray(java.lang.String name, long[] values)
name
- The property name.values
- The property values.protected void setFilePropertyString(java.lang.String name, java.lang.String value)
name
- The property name.value
- The property value.protected void setFilePropertyStringArray(java.lang.String name, java.lang.String[] values)
name
- The property name.values
- The property values.public static void setLogLevel(java.util.logging.Level logLevel)
public void setMapped()
public int setPosition(int[] position) throws SeisException
position
- The position to set.
SeisException
- Thrown on positioning errors.public void setTraceDataArray(float[][] trc) throws SeisException
trc
- the array use for trace I/O operations
SeisException
- if input array is too smallpublic void setTraceHeaderArray(int[][] hdr) throws SeisException
hdr
- the array use for header I/O operations
SeisException
- if input array is too smallpublic void setVersionToInput(int versionInput)
version
- The version (see JavaSeisDefs) to use for input.public static java.lang.String[] StringToArray(java.lang.String s, java.lang.String sep, char start, char end)
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. ",}").
public static Seisio testFileStruct(java.lang.String testDesc, java.lang.String path, java.lang.String[] vfioDirs, int vfioExtentSize) throws java.lang.Exception
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.
SeisException
- Thrown on testing errors.
java.lang.Exception
public void trackIoRate(boolean flag)
protected void transferHeaders(int numTraces, boolean readingHeaders)
numTraces
- The number of traces for which to copy headers.readingHeaders
- true if reading; false if writing.public int writeFrame() throws SeisException
SeisException
- Throw on write errors.public int writeFrame(int[] position) throws SeisException
position
- The position to set.
SeisException
- Throw on write errors.public void writeMultiArray(MultiArray a, int[] position) throws SeisException
a
- MultiArray containing data to be written.position
- starting position in the JavaSeis dataset
SeisException
- on errorspublic void writeTrace(long traceIndex) throws SeisException
SeisException
- Throw on write errors.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |