主要内容

Readecsratssig

Read data from ECOSTRESS spectral library

描述

example

libData= readEcostressSig(文件名)从指定的Ecostress Spectrum文件中读取光谱数据。

The function supports only ECOSTRESS spectrum files. All inputs must be text files with suffixspectrum.txt

example

libData= readEcostressSig(dirname)从指定目录中存储的Ecostress Spectrum文件中读取光谱数据。

example

libData= readEcostressSig(dirname,keyword)仅从指定目录中存储在其文件名中的指定关键字中的那些exostress频谱文件中读取光谱数据。

Note

此功能需要图像处理工具箱™高光谱成像库。您可以安装图像处理工具箱高光谱成像库from Add-On Explorer. For more information about installing add-ons, seeGet and Manage Add-Ons

例子

全部折叠

Specify the names of the spectrum files to read from the ECOSTRESS spectral library as a cell array of character vectors.

ecoStressfiles = [{{'soil.utisol.hapludult.none.all.87p707.jhu.becknic.spectrum.txt'},,。。。{'water.seawater.none.liquid.tir.seafoam.jhu.becknic.spectrum.txt'},,。。。{'植被},,。。。{'Manmade.Road.tar.Solid.All.0099uuutar.jhu.becknic.spectrum.txt'}];

Read and display the data from the specified ECOSTRESS spectrum files. The function returns a structure array with a row for each specified ECOSTRESS spectrum file. Each row stores the spectral data read from the associated file.

libdata = readecostresssig(ecoStressfiles)
libdata =1×4 struct array with fields:名称类型类别子类颗粒化属物种Sampleno所有者beantengthrange Origentem Collection Defucterdate描述测量第一柱二列dodunit dataUnit dataunit first xvalue lastxvalue numberofxvalues额外变化波长反射率⋮

Extract the details of the spectral data of the second file from the structure array.

libData(2)
ans =带有字段的结构: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]

从第二文件的光谱数据中提取反射率和波长值。

反射率= libdata(2)。反射;波长= libdata(2).Wavelength;

使用波长和反射率值绘制光谱签名。

图图(波长,反射率)标题([“光谱”libData(2).Name]) xlabel('波长')ylabel('Reflectance Value')

Figure contains an axes object. The axes object with title Spectra of Sea Foam contains an object of type line.

Specify the full path of the directory that contains the ECOSTRESS spectrum files.

fileroot = matlabshared.万博1manbetxsupportpkg.getsupportpackageroot();dirname = fullfile(fileroot,'工具箱','图片','supportpackages','hyperspectral','hyperdata','ECOSTRESSSpectraFiles');

Read and display the spectral data from all the files in the directory. The function returns a structure array with a row for each ECOSTRESS spectrum file in the specified directory.

libData = readEcostressSig(dirname)
libdata =1×15 struct array with fields:名称类型类别子类颗粒化属物种Sampleno所有者beantengthrange Origentem Collection Defucterdate描述测量第一柱二列dodunit dataUnit dataunit first xvalue lastxvalue numberofxvalues额外变化波长反射率⋮

提取第15个文件的光谱数据的详细信息。

libData(15)
ans =带有字段的结构:名称:“自来水”类型:“水”类:“ Tap Water”子类:“无”颗粒:“液体”属:[0×0字符串]物种:[0×0 string] Sampleno:“ Tapwater”所有者:“地球和行星科学系,约翰·霍普金斯大学” Wavelengthrange:“所有来源:” Jhu ir光谱实验室。原始文件名tapwater。CollectionDate:“ n/a”描述:“自来水。原始的Aster Spectral库名称为Jhu.becknic.becknic.water.tap.none.liquid.tapwater.spectrum.txt“测量:”定向(10度)半球形反射率“ FirstColumm:firstColumm:firstColumm:firstColumm:“ x”第二个列:“ y” wavelengthnit:“千分尺” dataunit:“反射率(百分比)” firstxvalue:“ 14.0110” lastxvalue:“ 0.4000” numberOfxvalues:“ 2844”附加信息:“无”波长:“无”波长:[2844×1 double]反射率:[2844×1双]

Specify full path of the directory that contains the ECOSTRESS spectrum files.

fileroot = matlabshared.万博1manbetxsupportpkg.getsupportpackageroot();dirname = fullfile(fileroot,'工具箱','图片','supportpackages','hyperspectral','hyperdata','ECOSTRESSSpectraFiles');

读取并显示带有文件名中的特定关键字的ecostress频谱文件的光谱数据。该函数返回指定目录中的每个频谱文件的结构数组,其中包含其文件名中的关键字。

关键字='水';libdata = readecostresssig(dirname,关键字)
libdata =1×3 struct array with fields:名称类型类别子类颗粒化属物种Sampleno所有者beantengthrange Origentem Collection Defucterdate描述测量第一柱二列dodunit dataUnit dataunit first xvalue lastxvalue numberofxvalues额外变化波长反射率⋮

输入参数

全部折叠

Ecostress文件的名称,指定为字符向量,字符串标量,字符矢量的单元格数或字符串向量。要同时读取来自多个cossress文件的数据,请使用字符串或字符串向量的单元格数组。该函数以您指定的顺序从文件中读取数据。如果未在当前文件夹中“ ecsstres”文件,则必须指定每个文件的完整路径。

数据类型:char|细绳

Name of the directory containing the ECOSTRESS files, specified as a character vector or string scalar. If the directory is not in the current folder, you must specify the full path of the directory.

数据类型:char|细绳

文件搜索关键字,指定为字符向量或字符串标量。该函数仅从其文件名中的指定关键字中返回来自Ecostress Spectrum文件的数据。您不能同时指定多个关键字。

数据类型:char|细绳

输出参数

全部折叠

来自Ecostress Files的光谱数据,作为1乘返回K结构数组。K是该函数读取的频谱文件数量。结构数组的每个元素都有24个字段,其中包含频谱文件的标头信息。

字段名称 描述
Name Name of the measured sample or material
类型 样本类型,例如“矿物”,"rock",“树”, or“人造”
班级

样本类型类

例如,如果样本类型为“矿物”然后,可以是:"native elements","silicates",“氧化物”,“硫化物”,“硫酸盐”,“卤化物”,“碳酸盐”,“磷酸盐”, or“矿物”

子类

Subclass of the sample type

该字段包含一个空数组或“没有任何”,除非类型值是“矿物”,"rock",“人造”,"soil",“月球”, or“陨石”

特别是

Particle size of the sample type

该字段包含一个空数组,除非类型值是“矿物”,"rock",“人造”,"soil",“月球”, or“陨石”

属of the sample

该字段包含一个空数组,除非类型值是“植被”或者“非光合”

Species

Species of the sample

该字段包含一个空数组,除非类型值是“植被”或者“非光合”

SampleNo

Sample number

This value is an identifier for the associated sample.

Owner 样本所有者
WavelengthRange

Wavelength range of the measured sample

The value must be"All","TIR", or“ vswir”

起源 Location from which the data was obtained
采集日期

Date on which the sample was collected

这个值在mm/dd/yyformat.

描述

测量样品的描述

该字段提供了有关样品特征的其他信息。

测量 Spectral measurement mode used to measure the sample
FirstColumn 频谱文件中数据值的第一列
第二列 Second column of data values in the spectrum file
WavelengthUnit

测量样品光谱波长

The value for every sample type is“千分尺”。该字段对应于X单位Ecostress Spectrum文件中的标题数据字段。

DataUnit

光谱测量模式的单位

Spectral measurement mode includes reflectance, transmittance, transittance, and transmission. The unit is percentage. This field corresponds to theY单位Ecostress Spectrum文件中的标题数据字段。

FirstXValue 频谱文件中数据值的第一列中的第一个值
LastXvalue Last value in the first column of data values in the spectrum file
NumberofXValues 频谱文件第一列中的数据值总数
附加信息

有关样本的其他信息

This field includes information that is not part of the spectral data.

Wavelength Wavelength values at which the reflectances were measured
反射 在每个波长下测得的反射率值

参考

[1] Meerdink, Susan K., Simon J. Hook, Dar A. Roberts, and Elsa A. Abbott. “The ECOSTRESS Spectral Library Version 1.0.”环境遥感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

Version History

在R2020a中引入