readEcostressSig
構文
説明
は、指定したディレクトリに格納された ECOSTRESS スペクトル ファイルのうち、指定したキーワードをファイル名に含むファイルのみからスペクトル データを読み取ります。libData
= readEcostressSig(dirname
,keyword
)
メモ
この関数には Image Processing Toolbox™ Hyperspectral Imaging Library が必要です。Image Processing Toolbox Hyperspectral Imaging Library はアドオン エクスプローラーからインストールできます。アドオンのインストールの詳細については、アドオンの入手と管理を参照してください。
Image Processing Toolbox Hyperspectral Imaging Library は MATLAB® Online™ または MATLAB Mobile™ ではサポートされないため、デスクトップの MATLAB が必要となります。
例
ECOSTRESS スペクトル ファイルの読み取り
ECOSTRESS スペクトル ライブラリから読み取るスペクトル ファイルの名前を、文字ベクトルの cell 配列として指定します。
ecostressfiles = [{'soil.utisol.hapludult.none.all.87p707.jhu.becknic.spectrum.txt'},... {'water.seawater.none.liquid.tir.seafoam.jhu.becknic.spectrum.txt'},... {'vegetation.tree.eucalyptus.maculata.vswir.jpl087.jpl.asd.spectrum.txt'},... {'manmade.road.tar.solid.all.0099uuutar.jhu.becknic.spectrum.txt'}];
指定した ECOSTRESS スペクトル ファイルからデータを読み取って表示します。この関数は指定したそれぞれの ECOSTRESS スペクトル ファイルを表す行を含む構造体配列を返します。各行には関連するファイルから読み取られたスペクトル データが格納されます。
libData = readEcostressSig(ecostressfiles)
libData=1×4 struct array with fields:
Name
Type
Class
SubClass
ParticleSize
Genus
Species
SampleNo
Owner
WavelengthRange
Origin
CollectionDate
Description
Measurement
FirstColumn
SecondColumn
WavelengthUnit
DataUnit
FirstXValue
LastXValue
NumberOfXValues
AdditionalInformation
Wavelength
Reflectance
⋮
構造体配列から、2 番目のファイルのスペクトル データの詳細を抽出します。
libData(2)
ans = struct with fields:
Name: "Sea Foam"
Type: "Water"
Class: "Sea Water"
SubClass: "none"
ParticleSize: "Liquid"
Genus: [0x0 string]
Species: [0x0 string]
SampleNo: "seafoam"
Owner: "Dept. of Earth and Planetary Science, John Hopkins University"
WavelengthRange: "TIR"
Origin: "JHU IR Spectroscopy Lab."
CollectionDate: "N/A"
Description: "Sea foam water. Original filename FOAM Original ASTER Spectral Library name was jhu.becknic.water.sea.none.liquid.seafoam.spectrum.txt"
Measurement: "Directional (10 Degree) Hemispherical Reflectance"
FirstColumn: "X"
SecondColumn: "Y"
WavelengthUnit: "micrometer"
DataUnit: "Reflectance (percent)"
FirstXValue: "14.0112"
LastXValue: "2.0795"
NumberOfXValues: "2110"
AdditionalInformation: "none"
Wavelength: [2110x1 double]
Reflectance: [2110x1 double]
2 番目のファイルのスペクトル データから反射率と波長値を抽出します。
reflectance = libData(2).Reflectance; wavelength = libData(2).Wavelength;
波長と反射率の値を使用してスペクトル シグネチャをプロットします。
figure plot(wavelength,reflectance) title(['Spectra of ' libData(2).Name]) xlabel('Wavelength') ylabel('Reflectance Value')
ディレクトリ内のすべての ECOSTRESS スペクトル ファイルの読み取り
ECOSTRESS スペクトル ファイルが含まれるディレクトリの絶対パスを指定します。
fileroot = matlabshared.supportpkg.getSupportPackageRoot(); dirname = fullfile(fileroot,'toolbox','images','supportpackages','hyperspectral','hyperdata','ECOSTRESSSpectraFiles');
ディレクトリ内のすべてのファイルからスペクトル データを読み取って表示します。この関数は指定したディレクトリ内にあるそれぞれの ECOSTRESS スペクトル ファイルを表す行を含む構造体配列を返します。
libData = readEcostressSig(dirname)
libData=1×15 struct array with fields:
Name
Type
Class
SubClass
ParticleSize
Genus
Species
SampleNo
Owner
WavelengthRange
Origin
CollectionDate
Description
Measurement
FirstColumn
SecondColumn
WavelengthUnit
DataUnit
FirstXValue
LastXValue
NumberOfXValues
AdditionalInformation
Wavelength
Reflectance
⋮
15 番目のファイルのスペクトル データの詳細を抽出します。
libData(15)
ans = struct with fields:
Name: "Tap water"
Type: "Water"
Class: "Tap Water"
SubClass: "none"
ParticleSize: "Liquid"
Genus: [0×0 string]
Species: [0×0 string]
SampleNo: "tapwater"
Owner: "Dept. of Earth and Planetary Science, John Hopkins University"
WavelengthRange: "All"
Origin: "JHU IR Spectroscopy Lab. Original filename TAPWATER."
CollectionDate: "N/A"
Description: "Tap water. Original ASTER Spectral Library name was jhu.becknic.water.tap.none.liquid.tapwater.spectrum.txt"
Measurement: "Directional (10 Degree) Hemispherical Reflectance"
FirstColumn: "X"
SecondColumn: "Y"
WavelengthUnit: "micrometer"
DataUnit: "Reflectance (percent)"
FirstXValue: "14.0110"
LastXValue: "0.4000"
NumberOfXValues: "2844"
AdditionalInformation: "none"
Wavelength: [2844×1 double]
Reflectance: [2844×1 double]
キーワードを使用した ECOSTRESS スペクトル ファイルの検索
ECOSTRESS スペクトル ファイルが含まれるディレクトリの絶対パスを指定します。
fileroot = matlabshared.supportpkg.getSupportPackageRoot(); dirname = fullfile(fileroot,'toolbox','images','supportpackages','hyperspectral','hyperdata','ECOSTRESSSpectraFiles');
ECOSTRESS スペクトル ファイルのうち、特定のキーワードをファイル名に含むファイルからスペクトル データを読み取って表示します。この関数は、指定したディレクトリ内にあるスペクトル ファイルのうち、キーワードをファイル名に含むファイルのそれぞれを表す行を含む構造体配列を返します。
keyword = 'water';
libData = readEcostressSig(dirname,keyword)
libData=1×3 struct array with fields:
Name
Type
Class
SubClass
ParticleSize
Genus
Species
SampleNo
Owner
WavelengthRange
Origin
CollectionDate
Description
Measurement
FirstColumn
SecondColumn
WavelengthUnit
DataUnit
FirstXValue
LastXValue
NumberOfXValues
AdditionalInformation
Wavelength
Reflectance
⋮
入力引数
filenames
— ECOSTRESS ファイル名
文字ベクトル | string スカラー | 文字ベクトルの cell 配列 | string のベクトル
ECOSTRESS ファイル名。文字ベクトル、string スカラー、文字ベクトルの cell 配列または string のベクトルとして指定します。複数の ECOSTRESS ファイルから同時にデータを読み取るには、文字ベクトルの cell 配列または string のベクトルを使用してください。この関数は、指定した順序でファイル内のデータを読み取ります。ECOSTRESS ファイルが現在のフォルダーに存在しない場合は、各ファイルの絶対パスを指定しなければなりません。
データ型: char
| string
dirname
— ディレクトリの名前
文字ベクトル | string スカラー
ECOSTRESS ファイルを含むディレクトリの名前。文字ベクトルまたは string スカラーとして指定します。ディレクトリが現在のフォルダーに存在しない場合は、ディレクトリの絶対パスを指定しなければなりません。
データ型: char
| string
keyword
— ファイル検索キーワード
文字ベクトル | string スカラー
ファイル検索キーワード。文字ベクトルまたは string スカラーとして指定します。この関数は、ECOSTRESS スペクトル ファイルのうち、指定したキーワードをファイル名に含むファイルのみからデータを返します。複数のキーワードを同時に指定することはできません。
データ型: char
| string
出力引数
libData
— ECOSTRESS ファイルのスペクトル データ
構造体配列
ECOSTRESS ファイルのスペクトル データ。1 行 K 列の構造体配列として返されます。K は関数が読み取ったスペクトル ファイルの数です。構造体配列の各要素には、スペクトル ファイルのヘッダー情報を格納する 24 個のフィールドがあります。
フィールド名 | 説明 |
Name | 測定したサンプルまたは物質の名前 |
Type | サンプル のタイプ。"mineral" 、"rock" 、"tree" 、または "manmade" など。 |
Class | サンプル タイプのクラス たとえば、サンプル タイプが |
SubClass | サンプル タイプのサブクラス
|
ParticleSize | サンプル タイプの粒子径
|
Genus | サンプルの属
|
Species | サンプルの種
|
SampleNo | サンプル番号 この値は関連するサンプルの識別子です。 |
Owner | サンプルの所有者 |
WavelengthRange | 測定したサンプルの波長範囲 この値は |
Origin | データの取得元となった場所 |
CollectionDate | サンプルを収集した日付 この値は |
Description | 測定したサンプルの説明 このフィールドはサンプルの特徴に関する追加情報を提供します。 |
Measurement | サンプルの測定に使用したスペクトル測定モード |
FirstColumn | スペクトル ファイルにあるデータ値の先頭列 |
SecondColumn | スペクトル ファイルにあるデータ値の 2 番目の列 |
WavelengthUnit | サンプルのスペクトル波長の測定単位 どのサンプル タイプの値も |
DataUnit | スペクトル測定モードの単位 スペクトル測定モードには、反射率、透過率、透過度、伝達率などがあります。単位はパーセントです。このフィールドは、ECOSTRESS スペクトル ファイルのヘッダー データの |
FirstXValue | スペクトル ファイルのデータ値の先頭列にある最初の値 |
LastXValue | スペクトル ファイルのデータ値の先頭列にある最後の値 |
NumberofXValues | スペクトル ファイルの先頭列にあるデータ値の総数 |
AdditionalInformation | サンプルに関する追加情報 このフィールドにはスペクトル データには含まれない情報が格納されます。 |
Wavelength | 反射率を測定した波長値 |
Reflectance | 各波長で測定された反射率値 |
参照
[1] Meerdink, Susan K., Simon J. Hook, Dar A. Roberts, and Elsa A. Abbott. “The ECOSTRESS Spectral Library Version 1.0.” Remote Sensing of Environment 230 (September 2019): 111196. https://doi.org/10.1016/j.rse.2019.05.015.
[2] Download the ECOSTRESS Spectral Library: https://speclib.jpl.nasa.gov/download
バージョン履歴
R2020a で導入
参考
spectralMatch
| sam
| sid
| hypercube
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)