|
| LisFileReader (FileInfo file) |
| Create a LIS reader for the specified disk file.
|
|
| LisFileReader (Stream inputStream) |
| Create a LIS file reader for the specified stream.
|
|
IList< LisFile > | Read (bool shouldReadCurveData=true, bool shouldCaptureStatistics=false, ILisDataListener dataListener=null) |
| Read all logical LIS files of this disk file.
|
|
void | ReadData (IList< LisFile > lisFiles, bool shouldCaptureStatistics=false, ILisDataListener dataListener=null) |
| Read data from a set of LIS files where the meta data has already been read.
|
|
Class for reading LIS files (sometimes also referred to as TAP files).
Typical usage:
LisFileReader reader = new LisFileReader(new FileInfo("path/to/file"));
IList<LisFile> lisFiles = reader.Read(true);
If the curve data is not needed, it is possible to read only the meta-data from the disk file. The curve data may be filled in later:
LisFileReader reader = new LisFileReader(new FileInfo("path/to/file"));
IList<LisFile> lisFiles = reader.Read(false);
:
reader.ReadData(lisFiles);
Note that even if only meta-data is read, all curve information are properly established as this information comes from meta-data. Only the curve values will be missing.
If disk files are larger than physical memory, it is possible to stream (process than throw away) the data during read. See LisDataListener. The same mechanism may be use to be able to abort the reading process during the operation.
- See also
- LIS 79 Documentation
- Author
- Petroware AS
static double IsLisFile |
( |
FileInfo | file, |
|
|
byte[] | content = null ) |
|
static |
Get the probability that the specified file is a LIS file.
The check can be done with or without considering the content of the file. In the former case, only the file name (typically the extension) is considered. In the latter case a portion of the start of the file is used to match for known patterns. By passing the portion as an argument, the client code can read this once and then pass it to different classifiers in order to determine its most likely type.
Getting a portion of a file can be done by:
FileInfo file = ...;
BinaryReader reader = new BinaryReader(file.OpenRead());
byte[] content = new byte[2000]; //say
reader.Read(content, 0, content.Length);
reader.Close();
- Parameters
-
file | File to check. Null to classify on content only. |
content | A number of bytes from the start of the file. Null to classify on file name only. |
- Returns
- Probability that the file is a LIS file. [0.0,1.0].
void ReadData |
( |
IList< LisFile > | lisFiles, |
|
|
bool | shouldCaptureStatistics = false, |
|
|
ILisDataListener | dataListener = null ) |
Read data from a set of LIS files where the meta data has already been read.
This will preserve the existing LisFile structure in case a LIS file is read in two operations:
// Read meta data
List<LisFile> lisFiles = reader.Read(false);
// Read the curve data
reader.readData(lisFiles);
There is nothing to gain in performance with this approach so in case the result is not cached, the following will be equivalent:
// Read meta data
List<LisFile> lisFiles = reader.Read(false);
// Read the curve data
lisFiles = reader.Read(true);
- Parameters
-
lisFiles | LIS files to populate. Non-null. |
shouldCaptureStatistics | True to capture statistics per curve during read. Statistics capture will reduce read performance slightly, so set this to false if the statistics are not needed. |
dataListener | Listener that will be notified when new data has been read. Null if not used. |
- Exceptions
-
ArgumentNullException | If lisFiles is null. |
IOException | If the read operation fails for some reason. |
OperationCanceledException | If the client returns false from the IDlisDataListener.DataRead method. |