importing .las data as table for analysis.

Dear all, I am using Matlab to analyse some data. The data are in .las format versions from 1 to 3. I can't use readtable as it gives me unknown file format error "Error using readtable (line 198) The file extension '.las' is not recognized." Any idea how to import these files into tables? Thanks

 採用された回答

Walter Roberson
Walter Roberson 2017 年 11 月 21 日

0 投票

7 件のコメント

Moustafa Elzeftawy
Moustafa Elzeftawy 2017 年 11 月 21 日
編集済み: Walter Roberson 2017 年 11 月 21 日
Thanks Walter.
I'm trying adding path but got this warnings:
>> addpath ('C:\SeisLab_10.0301\S4M\Examples','C:\SeisLab_10.0301\S4M\Geophysics_3.0','C:\SeisLab_10.0301\S4M\Geophysics_3.0\private','C:\SeisLab_10.0301\S4M\Geophysics_3.0\@struct','C:\SeisLab_10.0301\S4M\Other','C:\SeisLab_10.0301\S4M\TestData')
Warning: Private directories not allowed in MATLAB path: C:\SeisLab_10.0301\S4M\Geophysics_3.0\private
> In path (line 109)
In addpath (line 88)
Warning: Method directories not allowed in MATLAB path: C:\SeisLab_10.0301\S4M\Geophysics_3.0\@struct
> In path (line 109)
In addpath (line 88)
Any suggestions?
Walter Roberson
Walter Roberson 2017 年 11 月 21 日
Remove C:\SeisLab_10.0301\S4M\Geophysics_3.0\private from the list.
Moustafa Elzeftawy
Moustafa Elzeftawy 2017 年 11 月 29 日
編集済み: Walter Roberson 2017 年 11 月 29 日
Hi Walter,
The tool is working now but can not read the las files.
I have tried to make it read two files, the first, las1, got the following:
>> wlog=read_las_file('las1.txt')
File "las1.txt" not found. Select file interactively.
File C:\Users\19067654\Documents\PhD\Practical\Coal_DT\las1.las interactively selected
wlog =
struct with fields:
type: 'well_log'
tag: 'unspecified'
name: 'las1'
first: 152.5000
last: 1.3895e+03
step: 0.5000
units: 'm'
null: []
from: 'las1.las'
curve_info: {'depth' 'm' ''}
curves: [2475×1 double]
wellname: 'AAO_ANABRANCH_1'
the second file gave me these errors:
>> wlog=read_las_file('las3.las')
Subscripted assignment dimension mismatch.
Error in interpret_las2>data_section_no4 (line 269)
curves(ii,:)=sscanf(tlines{ii},'%g')';
Error in interpret_las2 (line 55)
wlog=data_section_no4(wlog,tlines(index(ii)+1:index(ii+1)-1),wrap);
Error in read_las_file (line 107)
wlog=interpret_las2(tlines(3:end));
Both files are attached for your reference, I've changed the extension to txt to be able to upload.
Regards
Moustafa
Walter Roberson
Walter Roberson 2017 年 11 月 29 日
The curve definition section for las2 ends in
SSN .SSNU : SHORT SPACED NEUTRON Reversed.
indicating that a column entitled SSN is expected. However, there is no such column in the ~A section. The file would probably work if you deleted that line.
Moustafa Elzeftawy
Moustafa Elzeftawy 2017 年 12 月 5 日
編集済み: Moustafa Elzeftawy 2017 年 12 月 5 日
Thanks for your help Walter! It's working now.
I would appreciate if you could help me to extract the curves into a table and use the curves' names as column name.
Regards Moustafa
Walter Roberson
Walter Roberson 2017 年 12 月 5 日
array2table(wlog.curves, 'VariableNames', wlog.curve_info(1,:))
Moustafa Elzeftawy
Moustafa Elzeftawy 2017 年 12 月 5 日
編集済み: Walter Roberson 2017 年 12 月 5 日
Tried the command and got the following error
>> las=array2table(wlog.curves, 'VariableNames', wlog.curve_info(1,:));
Error using matlab.internal.tabular.private.varNamesDim.makeValidName (line 433)
'DEPTH Reversed.' is not a valid variable name.
Error in matlab.internal.tabular.private.varNamesDim/validateAndAssignLabels (line 311)
[newLabels,wasMadeValid] = obj.makeValidName(newLabels,exceptionMode);
Error in matlab.internal.tabular.private.tabularDimension/setLabels (line 173)
obj = obj.validateAndAssignLabels(newLabels,indices,fullAssignment,fixDups,fixEmpties,fixIllegal);
Error in matlab.internal.tabular.private.tabularDimension/createLike_impl (line 355)
obj = obj.setLabels(dimLabels,[]);
Error in matlab.internal.tabular.private.varNamesDim/createLike (line 70)
obj = obj.createLike_impl(dimLength,dimLabels);
Error in tabular/initInternals (line 207)
t.varDim = t.varDim.createLike(nvars,varnames); % error if invalid, duplicate, or empty
Error in table.init (line 327)
t = initInternals(t, vars, numRows, rowLabels, numVars, varnames);
Error in array2table (line 64)
t = table.init(vars,nrows,rownames,nvars,varnames);
Then I created a new variable that has the names in a row as following
>> wlog.curve_name=(wlog.curve_info(:,1))'
wlog =
struct with fields:
type: 'well_log'
tag: 'unspecified'
name: 'las3'
first: 221.1000
last: 523
step: 0.1000
units: 'm'
null: NaN
from: 'las3.las'
curve_info: {17×3 cell}
curves: [3020×17 double]
company: 'M.I.M. HOLDINGS LIMITED'
wellname: 'MIH_EMERALD_1'
field: 'ATP 447P'
location: 'EMERALD'
province: 'QUEENSLAND'
service: 'BPB Wireline Services'
date: '5-JUL-1992'
wellid: 'MIM E01 TD'
curve_name: {1×17 cell}
and tried the modified code
las=array2table(wlog.curves, 'VariableNames',wlog.curve_name);
and the table was created successfully.
Thanks for your help
Moustafa

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by