Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

readEcostressSig

ECOSTRESS スペクトル ライブラリからのデータの読み取り

R2020a 以降

説明

libData = readEcostressSig(filenames) は、指定した ECOSTRESS スペクトル ファイルからスペクトル データを読み取ります。

この関数は ECOSTRESS スペクトル ファイルのみをサポートしています。すべての入力は接尾辞 spectrum.txt を持つテキスト ファイルでなければなりません。

libData = readEcostressSig(dirname) は、指定したディレクトリに格納された ECOSTRESS スペクトル ファイルからスペクトル データを読み取ります。

libData = readEcostressSig(dirname,keyword) は、指定したディレクトリに格納された ECOSTRESS スペクトル ファイルのうち、指定したキーワードをファイル名に含むファイルのみからスペクトル データを読み取ります。

メモ

この関数には Image Processing Toolbox™ Hyperspectral Imaging Library が必要です。Image Processing Toolbox Hyperspectral Imaging Library はアドオン エクスプローラーからインストールできます。アドオンのインストールの詳細については、アドオンの入手と管理を参照してください。

Image Processing Toolbox Hyperspectral Imaging LibraryMATLAB® Online™ または MATLAB Mobile™ ではサポートされないため、デスクトップの MATLAB が必要となります。

すべて折りたたむ

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')

Figure contains an axes object. The axes object with title Spectra of Sea Foam, xlabel Wavelength, ylabel Reflectance Value contains an object of type line.

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 スペクトル ファイルが含まれるディレクトリの絶対パスを指定します。

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
      ⋮

入力引数

すべて折りたたむ

ECOSTRESS ファイル名。文字ベクトル、string スカラー、文字ベクトルの cell 配列または string のベクトルとして指定します。複数の ECOSTRESS ファイルから同時にデータを読み取るには、文字ベクトルの cell 配列または string のベクトルを使用してください。この関数は、指定した順序でファイル内のデータを読み取ります。ECOSTRESS ファイルが現在のフォルダーに存在しない場合は、各ファイルの絶対パスを指定しなければなりません。

データ型: char | string

ECOSTRESS ファイルを含むディレクトリの名前。文字ベクトルまたは string スカラーとして指定します。ディレクトリが現在のフォルダーに存在しない場合は、ディレクトリの絶対パスを指定しなければなりません。

データ型: char | string

ファイル検索キーワード。文字ベクトルまたは string スカラーとして指定します。この関数は、ECOSTRESS スペクトル ファイルのうち、指定したキーワードをファイル名に含むファイルのみからデータを返します。複数のキーワードを同時に指定することはできません。

データ型: char | string

出力引数

すべて折りたたむ

ECOSTRESS ファイルのスペクトル データ。1 行 K 列の構造体配列として返されます。K は関数が読み取ったスペクトル ファイルの数です。構造体配列の各要素には、スペクトル ファイルのヘッダー情報を格納する 24 個のフィールドがあります。

フィールド名説明
Name測定したサンプルまたは物質の名前
Typeサンプル のタイプ。"mineral""rock""tree"、または "manmade" など。
Class

サンプル タイプのクラス

たとえば、サンプル タイプが "mineral" の場合、クラスは "native elements""silicates""oxides""sulfides""sulfates""halides""carbonates""phosphates"、または "mineraloids" になります。

SubClass

サンプル タイプのサブクラス

Type 値が "mineral""rock""manmade""soil""lunar"、または "meteorite" でない場合、このフィールドには空の配列または "none" が格納されます。

ParticleSize

サンプル タイプの粒子径

Type 値が "mineral""rock""manmade""soil""lunar"、または "meteorite" でない場合、このフィールドには空の配列が格納されます。

Genus

サンプルの属

Type 値が "vegetation" または "nonphotosynthetic" でない場合、このフィールドには空の配列が格納されます。

Species

サンプルの種

Type 値が "vegetation" または "nonphotosynthetic" でない場合、このフィールドには空の配列が格納されます。

SampleNo

サンプル番号

この値は関連するサンプルの識別子です。

Ownerサンプルの所有者
WavelengthRange

測定したサンプルの波長範囲

この値は "All""TIR"、または "VSWIR" でなければなりません。

Originデータの取得元となった場所
CollectionDate

サンプルを収集した日付

この値は mm/dd/yy 形式です。

Description

測定したサンプルの説明

このフィールドはサンプルの特徴に関する追加情報を提供します。

Measurementサンプルの測定に使用したスペクトル測定モード
FirstColumnスペクトル ファイルにあるデータ値の先頭列
SecondColumnスペクトル ファイルにあるデータ値の 2 番目の列
WavelengthUnit

サンプルのスペクトル波長の測定単位

どのサンプル タイプの値も "micrometer" です。このフィールドは、ECOSTRESS スペクトル ファイルのヘッダー データの X Units フィールドに対応します。

DataUnit

スペクトル測定モードの単位

スペクトル測定モードには、反射率、透過率、透過度、伝達率などがあります。単位はパーセントです。このフィールドは、ECOSTRESS スペクトル ファイルのヘッダー データの Y Units フィールドに対応します。

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 で導入