Log I/O
LasFileReader Class Reference

Reader for LAS log data files. More...

Public Member Functions

IList< LasMessageGetMessages ()
 Return messages related to the previous LAS file read operation. More...
 
 LasFileReader (FileInfo file)
 Create a LAS file reader for the specified disk file. More...
 
 LasFileReader (Stream stream)
 Create a LAS file reader for the specified stream. More...
 
IList< LasFileRead (bool shouldReadBulkData=true)
 Read the disk file and return the associated LasFile instances. More...
 

Static Public Member Functions

static double IsLasFile (FileInfo file, byte[] content=null)
 Check if the specified file appears to be a LAS file. More...
 

Detailed Description

Reader for LAS log data files.

Typical usage:

    LasFileReader reader = new LasFileReader(new FileInfo("/path/to/file.LAS"));
    IList<LasFile> lasFiles = reader.Read();
  

The method always returns a list of LasFile instances in case the disk file contans multiple logical files in sequence.

Author
Petroware AS

Constructor & Destructor Documentation

LasFileReader ( FileInfo  file)

Create a LAS file reader for the specified disk file.

Parameters
fileDisk file to read. Non-null.
Exceptions
ArgumentNullExceptionIf file is null.
LasFileReader ( Stream  stream)

Create a LAS file reader for the specified stream.

Parameters
streamStream to read. Non-null.
Exceptions
ArgumentNullExceptionIf stream is null.

Member Function Documentation

IList<LasMessage> GetMessages ( )

Return messages related to the previous LAS file read operation.

Returns
List of messages associated with the read operation. Never null.
static double IsLasFile ( FileInfo  file,
byte[]  content = null 
)
static

Check if the specified file appears to be a LAS 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.

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();
  

The reason the client is asked to do this part is for efficiency; The same file portion can be passed to different classifiers in order to find the most probable type.

Parameters
fileFile to check. Non-null.
contentA number of bytes from the start of the file. Null to classify on file name only.
Returns
Probability that the file is a LAS file. [0.0,1.0].
Exceptions
ArgumentNullExceptionIf file is null.
IList<LasFile> Read ( bool  shouldReadBulkData = true)

Read the disk file and return the associated LasFile instances.

Parameters
shouldReadBulkDataTrue to indicates that bulk data should be read. Otherwise curves will be created, but not populated.
Returns
All the logical LasFile instances read.

The documentation for this class was generated from the following file: