Log I/O
|
Class for representing the content of one logical LAS file. More...
Public Member Functions | |
void | AddCurve (LasCurve curve) |
Add the specified curve to the default definition section of this LAS file. | |
void | AddCurve (string definitionSectionName, LasCurve curve) |
Add the specified curve to this LAS file and associate it with the section of the given name. | |
void | AddSection (LasSection section) |
Add the specified section to this LAS file. | |
void | ClearCurves () |
Clear all curves of this LAS file. | |
void | ClearCurves (LasSection dataSection) |
Clear the curves of the specified data section. | |
LasSection | FindDataSection (LasSection definitionSection) |
Find the data section of a given definition section. | |
LasSection | FindOtherSection () |
Find the "other" section of this LAS file. | |
LasSection | FindParameterSection () |
Find the parameter section of this LAS file. | |
LasSection | FindSection (string name) |
Find the first section starting with the specified name. | |
LasSection | FindVersionSection () |
Find the version section of this file. | |
LasSection | FindWellSection () |
Find the well section of this LAS file. | |
IList< LasCurve > | GetCurves () |
Return the curves of this LAS file. | |
IList< LasCurve > | GetCurves (LasSection dataSection) |
Return the curves of the specified data section. | |
IList< LasSection > | GetDataSections () |
Return all the data sections of this LAS file. | |
char | GetFieldDelimiter () |
Get the data field delimiter of this LAS file. | |
string | GetName () |
Return the name of this LAS file. | |
string | GetNoValue () |
Get the string that defines no-value for this LAS file when the file is written to disk. | |
string | GetParameterValue (string parameterName) |
Return the value of the specified parameter. | |
DateTime? | GetParameterValueAsDate (LasSection section, string parameterName) |
Return the specified parameter in the given section as a date. | |
double? | GetParameterValueAsDouble (LasSection section, string parameterName) |
Return the value of the specified parameter as a double. | |
IList< LasSection > | GetSections () |
Return all the sections of this LAS file. | |
LasVersion | GetVersion () |
Return the version of this LAS file. | |
bool | HasCurveData () |
Check if this LAS file instance contains bulk data. | |
LasFile (string name, LasVersion version) | |
Create an empty LAS file instance that can be populated with data and later saved to disk. | |
override string | ToString () |
Class for representing the content of one logical LAS file.
A LAS file is a collection of metadata sections and curves.
LasFile | ( | string | name, |
LasVersion | version ) |
Create an empty LAS file instance that can be populated with data and later saved to disk.
The mandatory ~Version
section will be auto-populated.
The mandatory ~Well
section must be created by the client, but parameters associated with the curve data (STRT
, STOP
, STEP
and NULL
) will be auto-populated if the section is present.
Required parameter sections must be provided by the client.
The definition section(s) will be auto-populated based on provided curves.
The instance may later be written to file using LasFileWriter.
name | Name of LAS file. Null if none. |
version | LAS version. Non-null. |
ArgumentNullException | If version is null. |
void AddCurve | ( | LasCurve | curve | ) |
Add the specified curve to the default definition section of this LAS file.
The first curve added will be the index curve. Curves should be prepopulated with values, and should all have the same number of values.
If a well section has been added to the LAS file instance prior to calling addCurve, the STRT
, STOP
and STEP
entries will automatically be included if they are not present already. If they are present, no validation will be done on these entries.
If values are added to the curves after they are added to the LAS file instance, the client must take responsibility for the STRT
, STOP
and STEP
entries.
curve | Curve to add. Non-null. |
ArgumentNullException | If curve is null. |
ArgumentException | If curve has an invalid number of values. |
void AddCurve | ( | string | definitionSectionName, |
LasCurve | curve ) |
Add the specified curve to this LAS file and associate it with the section of the given name.
The first curve added will be the index curve. Curves should be pre-populated with values, and should all have the same number of values.
If this is LAS 2.0 the specified section name is not used as the definition and data sections are implicit. Null may be specified in this case. If this is LAS 3.0 the specified section name must be without the "~" prefix and "_Definition"/"_Data" suffix. If null is specified, the default "Log" name is being used.
If a well section has been added to the LAS file instance prior to calling AddCurve, the STRT
, STOP
and STEP
entries will automatically be included if they are not present already. If they are present, no validation will be done on these entries.
If values are added to the curves after they are added to the LAS file instance, the client must take responsibility for the STRT
, STOP
and STEP
entries.
definitionSectionName | Name of definition section to add to. Null for default. |
curve | Curve to add. Non-null. |
ArgumentNullException | If curve is null. |
ArgumentException | If curve has an invalid number of values. |
void AddSection | ( | LasSection | section | ) |
Add the specified section to this LAS file.
section | Section to add. Non-null. |
ArgumentNullException | If section is null. |
void ClearCurves | ( | ) |
Clear all curves of this LAS file.
This method is typically used with files of LAS 2.0 where there is only one set of curves.
void ClearCurves | ( | LasSection | dataSection | ) |
Clear the curves of the specified data section.
This method is typically used with files of LAS 3.0 where multiple data sections are possible. For LAS 2.0 the ClearCurves()
(without an argument) can be used for the same purpose.
dataSection | The data section to clear the curves of. Non-null |
ArgumentNullException | If dataSection is null. |
ArgumentException | If LasSection is of section type data. |
LasSection FindDataSection | ( | LasSection | definitionSection | ) |
Find the data section of a given definition section.
A data section will have an association pointer to its definition as follows:
~XXX_Definition ~XXX_Data | XXX_Definition
Passing the XXX_Definition section into this method will return the XXX_Data section.
For LAS 2.0 there is an implicit association between the "CURVE" section and the corresponding "ASCII" section which is handled in this method.
definitionSection | Section to find data section of. Non-null. |
ArgumentNullException | If definitionSection is null. |
LasSection FindOtherSection | ( | ) |
Find the "other" section of this LAS file.
This section is a feature of LAS version <= 2.0 only.
LasSection FindParameterSection | ( | ) |
Find the parameter section of this LAS file.
This method is most useful for LAS 2.0 files where there is exactly one parameter section of a predefined name. In LAS 3.0 there may be several parameter sections with arbitrary names.
LasSection FindSection | ( | string | name | ) |
Find the first section starting with the specified name.
The search is case insensitive.
name | (Start of) name of section to find. "W" or "WELL" will both return the "~WELL" section and so on. Non-null. |
ArgumentNullException | If name is null. |
LasSection FindVersionSection | ( | ) |
Find the version section of this file.
LasSection FindWellSection | ( | ) |
Find the well section of this LAS file.
The well section is mandatory in LAS files, but if this instance originates from a file where it was not present, it may still be absent.
IList< LasCurve > GetCurves | ( | ) |
Return the curves of this LAS file.
This methods is typically used with files of LAS 2.0 where there is only one set of curves.
IList< LasCurve > GetCurves | ( | LasSection | dataSection | ) |
Return the curves of the specified data section.
This methods is typically used with files of LAS 3.0.
For LAS 2.0 this method can be called with the ascii section as argument, or GetCurves() (without arguments) can be used.
dataSection | Data section of curves to get. Non-null. |
ArgumentNullException | If dataSection is null. |
IList< LasSection > GetDataSections | ( | ) |
Return all the data sections of this LAS file.
For a LAS 2.0 file this will be at most one, while for LAS 3.0 it may be several. In any case, the associated curves can be retrieved by the GetCurves(LasSection dataSection) method.
char GetFieldDelimiter | ( | ) |
Get the data field delimiter of this LAS file.
The field delimiter is defined in the DLM parameter of the VERSION section. For LAS 2.0 the field delimiter is always ' '.
string GetName | ( | ) |
Return the name of this LAS file.
Typically the name of the back-end disk file, or null if not set.
string GetNoValue | ( | ) |
Get the string that defines no-value for this LAS file when the file is written to disk.
The no-value is defined in the NULL
parameter of the ~WELL
section.
NOTE: This is for information only; The client program should use null
consistently when specifying or testing for no-value.
string GetParameterValue | ( | string | parameterName | ) |
Return the value of the specified parameter.
Search all sections.
parameterName | Name of parameter to get value of. Non-null. |
ArgumentNullException | If parameterName is null. |
DateTime? GetParameterValueAsDate | ( | LasSection | section, |
string | parameterName ) |
Return the specified parameter in the given section as a date.
If the parameter is not found, or if the parameter isn't a valid date, null is returned. Several date formats are checked in order to parse the parameter value.
NOTE: This method is at the file level rather than the section level as no-values needs to be resolved. The no-value concept is defined at the file level.
section | Section to find value from. Null to search all sections. |
parameterName | Name of parameter to get date of. Non.null. |
ArgumentNullException | If parameterName is null. |
double? GetParameterValueAsDouble | ( | LasSection | section, |
string | parameterName ) |
Return the value of the specified parameter as a double.
NOTE: This method is at the file level rather than the section level as no-values needs to be resolved. The no-value concept is defined at the file level.
section | Section to query. Null to search all sections. |
parameterName | Name of parameter to get value of. Non-null. |
ArgumentNullException | If parameterName is null. |
IList< LasSection > GetSections | ( | ) |
Return all the sections of this LAS file.
LasVersion GetVersion | ( | ) |
Return the version of this LAS file.
bool HasCurveData | ( | ) |
Check if this LAS file instance contains bulk data.