Closed AchyuthB closed 2 years ago
I think you want the components as is not formatted as a table. They are way more primitive than dlis parameters tho
Hi @ErlendHaa, Extracting details from components returned 6800 rows for each logical file. Most of which looks like repeated data for me. Mnemonics 'PUNI' and 'TUNI' are repeated for around 750 times. Are there any documentation available explaining this structure?
Code
def extract_information_record_data(logical_file_index, logical_file):
global g_information_record_index
g_information_record_index = 0
for information_record in logical_file.wellsite_data():
extract_data(logical_file_index, information_record)
for information_record in logical_file.tool_string_info():
extract_data(logical_file_index, information_record)
for information_record in logical_file.job_identification():
extract_data(logical_file_index, information_record)
def extract_data(logical_file_index, information_record):
global g_information_record_data
global g_information_record_index
for component in information_record.components():
mnemonic = component.mnemonic
value = component.component
units = component.units
component_type = component.type_nb
component_size = component.size
g_information_record_data = g_information_record_data.append({
'LOGICAL_FILE_INDEX': logical_file_index,
'INFORMATION_RECORD_INDEX': g_information_record_index,
'MNEMONIC': mnemonic,
'VALUE': value,
'UNITS': units,
'COMPONENT_TYPE': component_type,
'COMPONENT_SIZE': component_size
},
ignore_index=True)
g_information_record_index = g_information_record_index + 1
Hi,
When the information record is structured (tm), the purpose of the mnemonic field is to indicate which column in the structured table the component block belongs in. Hence the repeated mnemonics. This entire structuring of components is a bit wierd, and the specification doesn't offer any good explanation of the semantic meaning of it. If you want to have a closer look it's defined in chapter 3.3.1.2 in the spec
Hi @ErlendHaa, I read through the chapter 3.3.1.2. Now I guess I understand how the data is structured.
Thanks Again, Achyuth
That's right. This is also a good illustration of them, as it shows how multiple Component Blocks are combined into one row in the table. And I guess one row is sorta analogues to a DLIS parameter.
We might want to update the documentation on this a bit. Maybe even add some support features that extract each "row" as an object (dict?):
param = {
'MNEM' : 'FBSTB',
'STAT' : 'ALLO',
'HEIG' : 0,
'VOLU' : 2.125,
'WEIG' : 468.1,
'PRES' : 0,
'TEMP' : 350,
}
For me it looks like, LIS has more detailed parameter information when compared to DLIS. For DLIS every logical file has hundreds of parameter information, and the parameter_values are arrays (below screenshot). For LIS I feel it is more specific, like for each block and sub-block (though I don't really understand what a block is).
Hi,
This can be closed. I was able to successfully extract the information record data .
-Achyuth
Hi, For DLIS files, I was able to extract the parameter information in a structured format quit easily by doing
logical_file.parameters
. For LIS, it looks like the parameter information is extracted by callingdlisio.lis.InformationRecord()
. But when I do that what I get in return is an unstructured data, which I am not able to understand/process further. Is there an easy way to extract the metadata information from LIS files? It would be much easier if could get the output in a strucured table format, or as a key value pair.Sample code
Output:- I am not able to figure out how to format this data into say... Name, Description and Unit.