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
2017 年 11 月 21 日
7 件のコメント
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
2017 年 11 月 21 日
Remove C:\SeisLab_10.0301\S4M\Geophysics_3.0\private from the list.
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
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
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
2017 年 12 月 5 日
array2table(wlog.curves, 'VariableNames', wlog.curve_info(1,:))
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 件)
カテゴリ
ヘルプ センター および File Exchange で String Parsing についてさらに検索
参考
2017 年 11 月 21 日
2017 年 12 月 5 日
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
