com.las2witsml
Class LasDataFile

java.lang.Object
  |
  +--com.las2witsml.LasDataFile

public class LasDataFile
extends java.lang.Object

Title: LasDataFile.java Description: This is the main class that reads the LAS data and performs the WITSML conversion. Copyright: Copyright (c) 2005 Company: Satyam Computer Services Ltd.


Constructor Summary
LasDataFile()
          Constructor LasDataFile
 
Method Summary
 void createBlockDefnElements(LasData objLasData, org.w3c.dom.Document logDoc, org.w3c.dom.Node parentNode)
          Method createBlockDefnElements Description: This method writes the block information
 void createLogDefnElements(LasData objLasData, org.w3c.dom.Document logDoc, org.w3c.dom.Node ndParentNode)
          Method createLogDefnElements Description: This method writes the log curve information
 void createLogParamElements(LasData objLasData, org.w3c.dom.Document logDoc, org.w3c.dom.Node parentNode)
          Method createLogParamElements Description: This method writes the log param information
 void findElementAndWriteAttributeData(org.w3c.dom.Document xmlDoc, java.lang.String strElemName, java.lang.String strAttribName, java.lang.Object objData)
          Method findElementAndWriteAttributeData Description: This method searches for an element in a DOM tree and writes the attrbute data for that element
 void findElementAndWriteData(org.w3c.dom.Document xmlDoc, java.lang.String strElemName, java.lang.Object objData, java.lang.String strPrevSibling)
          Method findElementAndWriteData Description: This method searches for an element in a DOM tree and writes the data to DOM tree
 void generateWITSML(org.w3c.dom.Document domSrc, java.lang.String strWriteSection, java.lang.String strDestFolder)
          Method generateWITSML Description: This method creates the WITSML output file depending on the section in the destination folder as per the DOM Tree
 void getDataFromLine(java.lang.String strLineData, int intDelimiter, java.util.ArrayList alDataArray)
          Method getDataFromLine Description: This will read the different blocks of data from a line of LAS data.
 int getDelimiter()
          Method getDelimiter Description: This will returns the delimiter of the LAS file
 LasData getLasData()
          Method getLasData Description: This will return LasData object for holding the LAS file data.
 void getLineData(java.lang.String strLineData, java.lang.String strMnemonic, java.lang.String strUnits, java.lang.String strValue, java.lang.String strDescription, java.lang.String strFormat, java.lang.String strArrayAsocs)
          Method getLineData Description: This method gets the different blocks from the line of LAS data read
 int getLineFromBlock(java.lang.String strInputString, java.lang.String strRetString, int intStartIndex)
          Method getLineFromBlock Description: This method will read a line of data from the passed input string
 java.io.PrintWriter getLogger()
          Method getLogger This method returns Logger information
 java.lang.String getMappingFile()
          Method getMappingFile This method returns the mapping file to be used for conversion
 java.util.Vector getOutputFiles()
          Method getOutputFiles This method returns the output files vector
 java.lang.String getSelectionFile()
          Method getSelectionFile This method returns the selection file name
 java.lang.String getSrcFileDataBlock(java.lang.String strFileFullName, java.lang.String strBlockStart)
          Method getSrcFileDataBlock Description: This method processes the source LAS file and reads the contents of the file to a string and returns it to calling function
 java.lang.String getVersion()
          Method getVersion Description: This will returns the version of the LAS file
 int getWellParamSize()
          Method getWellParamSize This method returns the number of well info parameters
 java.lang.String getWrap()
          Method getWrap Description: This will returns the WRAP mode of the LAS file, This can be Multiple lines per depth step or One line per depth step
 void LoadFileData(java.lang.String strLasFileName)
          Method LoadFileData Description: This will returns an instance of LasData object
 void processCustomLogSection(java.lang.String strSrcFileFullName, java.lang.String strSearchString, LasData objLasData, int intLoopVar, java.lang.String strDestFolder, java.lang.String strSrcFileContents)
          Method processLogSection Description: This method reads the run parameter data and generates the WITMSL output files
 void processLogData(java.lang.String strSrcFileFullName, java.util.ArrayList saDataArray, java.lang.String strSearchString, int intRecLimit, org.w3c.dom.Document logDoc, java.lang.String strSrcFileContents, LasData objLasData)
          Method processLogData Description: This method will read details of ASCII or LOG Data block in the input LAS File and write the log data to DOM tree.
 void processLogSection(java.lang.String strSrcFileFullName, LasData objLasData)
          Method processLogSection Description: This method processes the well log data by reading the block of data from the LAS file
 void processWellSection(java.lang.String strSrcFileFullName, LasData objLasData)
          Method processWellSection Description: This writes the well data to DOM tree and generates the WITSML Files.
 void readLogDefinitionsData(java.lang.String strSrcFileFullName, java.util.ArrayList alArrayList, java.lang.String strSearchString, LasData objLasData)
          Method readLogDefinitionsData Description: This method will read details of CURVE INFORMATION block in the input LAS File.
 void readParametersSectionData(java.lang.String strSrcFileFullName, LasData objLasData)
          Method readParametersSectionData Description: This will read details of WELL INFORMATION and PARAMETER INFORMATION block in the input LAS File.
 void readRunParametersSectionData(java.lang.String strSrcFileFullName, LasData objLasData, java.lang.String strSearchString)
          Method readRunParametersSectionData Description: This will read details of PARAMETER INFORMATION block in the input LAS File.
 void readVersionInformation(java.lang.String strSrcFileFullName, java.lang.String strVers, java.lang.String strWrap, int intDelimiter)
          Method readVersionInformation Description: This will read the version information of the LAS file.
 void readWellSectionData(java.lang.String strSrcFileFullName, LasData objLasData, java.util.ArrayList alWellData)
          Method readWellSectionData Description: This will read details of WELL INFORMATION block in the input LAS File.
 void setDelimiter(int intDelim)
          Method setDelimiter This method sets the delimiter
 void setLasData(LasData objLasData)
          Method setLasData This method sets the LasData object
 void setLogger(java.io.PrintWriter pwPrintWriter)
          Method setLogger This method sets the logger information
 void setMappingFile(java.lang.String strMappingFile)
          Method setMappingFile This method will set the mapping file to be used for conversion
 void setOutputFiles(java.util.Vector vecOutputFiles)
          Method setOutputFiles This method will set the output files vector
 void setSelectionFile(java.lang.String strSelectionFile)
          Method setSelectionFile This method sets the selection file
 void setVersion(java.lang.String strVers)
          Method setVersion This method sets the version of the LAS file
 void setWellParamSize(int intParamSize)
          Method setWellParamSize This method sets the well information size
 void setWrap(java.lang.String strWr)
          Method setWrap This method sets the WRAP of the LAS file
 void writeAuditTrailData(org.w3c.dom.Document xmlDoc, java.lang.String dtDate, java.lang.String strRespParty, java.lang.String strComment)
          Method writeAuditTrailData Description: This method writes the audit trail data to DOM tree
 void writeDefaultHeaderContent(org.w3c.dom.Document xmlDoc, java.lang.String strDocName)
          Method writeDefaultHeaderContent Description: This writes the default header data to DOM tree
 void writeLogSectionData(java.lang.String strSrcFileFullName, java.lang.String strSearchString, org.w3c.dom.Document logDoc, LasData objLasData, MappingReader objMappingReader, java.lang.String strSrcFileContents)
          Method writeLogSectionData Description: This method write the log section data by reading the DOM tree
 void writeWellSectionData(org.w3c.dom.Document xmlDoc, LasData objLasData, MappingReader objMappingReader)
          Method writeWellSectionData Description: This method write the well section data to a DOM tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LasDataFile

public LasDataFile()
Constructor LasDataFile

Method Detail

getLasData

public LasData getLasData()
Method getLasData Description: This will return LasData object for holding the LAS file data.

Returns:
objLasData

setLasData

public void setLasData(LasData objLasData)
Method setLasData This method sets the LasData object

Parameters:
objLasData - Data to be set from the LAS file

getVersion

public java.lang.String getVersion()
Method getVersion Description: This will returns the version of the LAS file

Returns:
version number

setVersion

public void setVersion(java.lang.String strVers)
Method setVersion This method sets the version of the LAS file

Parameters:
strVers - version number

getWrap

public java.lang.String getWrap()
Method getWrap Description: This will returns the WRAP mode of the LAS file, This can be Multiple lines per depth step or One line per depth step

Returns:
WRAP mode of the LAS file

setWrap

public void setWrap(java.lang.String strWr)
Method setWrap This method sets the WRAP of the LAS file

Parameters:
strWr - WRAP mode of the LAS file

getDelimiter

public int getDelimiter()
Method getDelimiter Description: This will returns the delimiter of the LAS file

Returns:
Delimiter of the LAS file

setDelimiter

public void setDelimiter(int intDelim)
Method setDelimiter This method sets the delimiter

Parameters:
intDelim - Delimiter of the LAS file

LoadFileData

public void LoadFileData(java.lang.String strLasFileName)
Method LoadFileData Description: This will returns an instance of LasData object

Parameters:
strLasFileName - LAS file name

readRunParametersSectionData

public void readRunParametersSectionData(java.lang.String strSrcFileFullName,
                                         LasData objLasData,
                                         java.lang.String strSearchString)
Method readRunParametersSectionData Description: This will read details of PARAMETER INFORMATION block in the input LAS File.

Parameters:
strSrcFileFullName - LAS file name
objLasData - LAS data of the LAS file
strSearchString - The parameter section to be read (starting with ~P) in LAS file

readWellSectionData

public void readWellSectionData(java.lang.String strSrcFileFullName,
                                LasData objLasData,
                                java.util.ArrayList alWellData)
Method readWellSectionData Description: This will read details of WELL INFORMATION block in the input LAS File.

Parameters:
strSrcFileFullName - input LAS file name
objLasData - LAS data of the input LAS file
alWellData - The well section to be read (starting with ~W) in input LAS file

readParametersSectionData

public void readParametersSectionData(java.lang.String strSrcFileFullName,
                                      LasData objLasData)
Method readParametersSectionData Description: This will read details of WELL INFORMATION and PARAMETER INFORMATION block in the input LAS File.

Parameters:
strSrcFileFullName - input LAS file name
objLasData - LAS data of the input LAS file

getDataFromLine

public void getDataFromLine(java.lang.String strLineData,
                            int intDelimiter,
                            java.util.ArrayList alDataArray)
Method getDataFromLine Description: This will read the different blocks of data from a line of LAS data.

Parameters:
strLineData - Line of Data from the input LAS file
intDelimiter - Delimiter of the input LAS file
alDataArray - Array for storing data

readVersionInformation

public void readVersionInformation(java.lang.String strSrcFileFullName,
                                   java.lang.String strVers,
                                   java.lang.String strWrap,
                                   int intDelimiter)
Method readVersionInformation Description: This will read the version information of the LAS file.

Parameters:
strSrcFileFullName - LAS file name
strVers - Version number of the input LAS file
strWrap - WRAP mode of the input LAS file
intDelimiter - Delimiter of the input LAS file

getSrcFileDataBlock

public java.lang.String getSrcFileDataBlock(java.lang.String strFileFullName,
                                            java.lang.String strBlockStart)
Method getSrcFileDataBlock Description: This method processes the source LAS file and reads the contents of the file to a string and returns it to calling function

Parameters:
strFileFullName - input LAS file
strBlockStart - The Block to be read from the LAS File (like ~V, ~W, ~P )

getLineFromBlock

public int getLineFromBlock(java.lang.String strInputString,
                            java.lang.String strRetString,
                            int intStartIndex)
Method getLineFromBlock Description: This method will read a line of data from the passed input string

Parameters:
strInputString - Block of data from the input LAS file
strRetString - Line of data from the input LAS file
intStartIndex - StartIndex from where the block starts

getLineData

public void getLineData(java.lang.String strLineData,
                        java.lang.String strMnemonic,
                        java.lang.String strUnits,
                        java.lang.String strValue,
                        java.lang.String strDescription,
                        java.lang.String strFormat,
                        java.lang.String strArrayAsocs)
Method getLineData Description: This method gets the different blocks from the line of LAS data read

Parameters:
strLineData - A Line of data from the input LAS file
strMnemonic - Mnemonic from the Line
strUnits - Units from the Line
strValue - Value from the Line
strDescription - Description from the Line
strFormat - Format from the Line
strArrayAsocs - ArrayAsocs from the Line

processLogSection

public void processLogSection(java.lang.String strSrcFileFullName,
                              LasData objLasData)
Method processLogSection Description: This method processes the well log data by reading the block of data from the LAS file

Parameters:
strSrcFileFullName - input LAS file name
objLasData - Data of the input LAS file

processCustomLogSection

public void processCustomLogSection(java.lang.String strSrcFileFullName,
                                    java.lang.String strSearchString,
                                    LasData objLasData,
                                    int intLoopVar,
                                    java.lang.String strDestFolder,
                                    java.lang.String strSrcFileContents)
Method processLogSection Description: This method reads the run parameter data and generates the WITMSL output files

Parameters:
strSrcFileFullName - LAS file name to be processed
strSearchString - SearchString from the LAS file
objLasData - Data from the input LAS file
intLoopVar - variable for section count
strDestFolder - Destination folder to place the generated WITSML files
strSrcFileContents - FileContents of the LAS File.

writeLogSectionData

public void writeLogSectionData(java.lang.String strSrcFileFullName,
                                java.lang.String strSearchString,
                                org.w3c.dom.Document logDoc,
                                LasData objLasData,
                                MappingReader objMappingReader,
                                java.lang.String strSrcFileContents)
Method writeLogSectionData Description: This method write the log section data by reading the DOM tree

Parameters:
strSrcFileFullName - LAS file name
strSearchString - SearchString from the LAS file
logDoc - DOM representation of the XML file
objLasData - Data of the LAS file
objMappingReader - Mapping class to get the LAS-WITSML mappings
strSrcFileContents - Mapping class to get the LAS-WITSML mappings

createLogParamElements

public void createLogParamElements(LasData objLasData,
                                   org.w3c.dom.Document logDoc,
                                   org.w3c.dom.Node parentNode)
Method createLogParamElements Description: This method writes the log param information

Parameters:
objLasData - Data from the LAS file
logDoc - DOM representation of the documetn
parentNode - parentNode for which the log parameters are to be appended

createLogDefnElements

public void createLogDefnElements(LasData objLasData,
                                  org.w3c.dom.Document logDoc,
                                  org.w3c.dom.Node ndParentNode)
Method createLogDefnElements Description: This method writes the log curve information

Parameters:
objLasData - Data from the LAS file
logDoc - DOM representation of the object
ndParentNode - parentNode to append the curve definitions of the LAS file

createBlockDefnElements

public void createBlockDefnElements(LasData objLasData,
                                    org.w3c.dom.Document logDoc,
                                    org.w3c.dom.Node parentNode)
Method createBlockDefnElements Description: This method writes the block information

Parameters:
objLasData - Data from the LAS file
logDoc - DOM representation of the document
parentNode - to append the block information of the LAS file

readLogDefinitionsData

public void readLogDefinitionsData(java.lang.String strSrcFileFullName,
                                   java.util.ArrayList alArrayList,
                                   java.lang.String strSearchString,
                                   LasData objLasData)
Method readLogDefinitionsData Description: This method will read details of CURVE INFORMATION block in the input LAS File.

Parameters:
strSrcFileFullName - Input LAS file name
alArrayList - Log definitions array list
strSearchString - Search string from the LAS file
objLasData - Data from the LAS file

processLogData

public void processLogData(java.lang.String strSrcFileFullName,
                           java.util.ArrayList saDataArray,
                           java.lang.String strSearchString,
                           int intRecLimit,
                           org.w3c.dom.Document logDoc,
                           java.lang.String strSrcFileContents,
                           LasData objLasData)
Method processLogData Description: This method will read details of ASCII or LOG Data block in the input LAS File and write the log data to DOM tree.

Parameters:
strSrcFileFullName - input LAS file name
saDataArray - Array for holding log data
strSearchString - String to be searching from the LAS file
intRecLimit - Record Limit
logDoc - DOM representation of the document
strSrcFileContents - FileContents of the File.
objLasData - LASData object

processWellSection

public void processWellSection(java.lang.String strSrcFileFullName,
                               LasData objLasData)
Method processWellSection Description: This writes the well data to DOM tree and generates the WITSML Files.

Parameters:
strSrcFileFullName - The input LAS file name
objLasData - Data from the LAS file

writeDefaultHeaderContent

public void writeDefaultHeaderContent(org.w3c.dom.Document xmlDoc,
                                      java.lang.String strDocName)
Method writeDefaultHeaderContent Description: This writes the default header data to DOM tree

Parameters:
xmlDoc - DOM represenation of the Document
strDocName - Document Name

writeAuditTrailData

public void writeAuditTrailData(org.w3c.dom.Document xmlDoc,
                                java.lang.String dtDate,
                                java.lang.String strRespParty,
                                java.lang.String strComment)
Method writeAuditTrailData Description: This method writes the audit trail data to DOM tree

Parameters:
xmlDoc - DOM representation of theXML document
dtDate - Date of Log data
strRespParty - Responsible party
strComment - Comment

findElementAndWriteData

public void findElementAndWriteData(org.w3c.dom.Document xmlDoc,
                                    java.lang.String strElemName,
                                    java.lang.Object objData,
                                    java.lang.String strPrevSibling)
Method findElementAndWriteData Description: This method searches for an element in a DOM tree and writes the data to DOM tree

Parameters:
xmlDoc - DOM representation of the XML document
strElemName - Element that is to be searched/created(if it does not exist)
objData - The actual data to be written for that element
strPrevSibling - Sibling where this new element is to be added in DOM object

writeWellSectionData

public void writeWellSectionData(org.w3c.dom.Document xmlDoc,
                                 LasData objLasData,
                                 MappingReader objMappingReader)
Method writeWellSectionData Description: This method write the well section data to a DOM tree

Parameters:
xmlDoc - DOM representation of the document
objLasData - Data from the LAS file
objMappingReader - Mapping Class that has LAS-WITSML mappings

findElementAndWriteAttributeData

public void findElementAndWriteAttributeData(org.w3c.dom.Document xmlDoc,
                                             java.lang.String strElemName,
                                             java.lang.String strAttribName,
                                             java.lang.Object objData)
Method findElementAndWriteAttributeData Description: This method searches for an element in a DOM tree and writes the attrbute data for that element

Parameters:
xmlDoc - DOM representation of the XML document
strElemName - Element that is to be searched
strAttribName - Attribute to be created/set
objData - The actual data to be written for that attribute

generateWITSML

public void generateWITSML(org.w3c.dom.Document domSrc,
                           java.lang.String strWriteSection,
                           java.lang.String strDestFolder)
Method generateWITSML Description: This method creates the WITSML output file depending on the section in the destination folder as per the DOM Tree

Parameters:
domSrc - DOM representation of the XML document
strWriteSection - The section of the LAS file for which WITMSL file to be generated
strDestFolder - Destination folder for placing the generated files

getOutputFiles

public java.util.Vector getOutputFiles()
Method getOutputFiles This method returns the output files vector

Returns:
Generated WITSML files

setOutputFiles

public void setOutputFiles(java.util.Vector vecOutputFiles)
Method setOutputFiles This method will set the output files vector

Parameters:
vecOutputFiles - input WITSML File

setMappingFile

public void setMappingFile(java.lang.String strMappingFile)
Method setMappingFile This method will set the mapping file to be used for conversion

Parameters:
strMappingFile - Mapping file Name

getMappingFile

public java.lang.String getMappingFile()
Method getMappingFile This method returns the mapping file to be used for conversion

Returns:
Mapping file

setSelectionFile

public void setSelectionFile(java.lang.String strSelectionFile)
Method setSelectionFile This method sets the selection file

Parameters:
strSelectionFile - Selection file

getSelectionFile

public java.lang.String getSelectionFile()
Method getSelectionFile This method returns the selection file name

Returns:
Selection

setWellParamSize

public void setWellParamSize(int intParamSize)
Method setWellParamSize This method sets the well information size

Parameters:
intParamSize - Number of WELL parameters in LAS file

getWellParamSize

public int getWellParamSize()
Method getWellParamSize This method returns the number of well info parameters

Returns:
Number of WELL parameters in LAS file

setLogger

public void setLogger(java.io.PrintWriter pwPrintWriter)
Method setLogger This method sets the logger information

Parameters:
pwPrintWriter - PrintWriter

getLogger

public java.io.PrintWriter getLogger()
Method getLogger This method returns Logger information

Returns:
PrintWriter