Readecsratssig
Read data from ECOSTRESS spectral library
Syntax
描述
仅从指定目录中存储在其文件名中的指定关键字中的那些exostress频谱文件中读取光谱数据。libData
= readEcostressSig(dirname
,keyword
)
Note
此功能需要图像处理工具箱™高光谱成像库。您可以安装图像处理工具箱高光谱成像库from Add-On Explorer. For more information about installing add-ons, seeGet and Manage Add-Ons。
例子
阅读ecostress频谱文件
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')
阅读目录中的所有EcoStress Spectrum文件
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双]
使用关键字搜索Ecostress Spectrum文件
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额外变化波长反射率⋮
输入参数
文件名
—exostress文件的名称
角色向量|细绳scalar|字符向量的单元格数|字符串向量
Ecostress文件的名称,指定为字符向量,字符串标量,字符矢量的单元格数或字符串向量。要同时读取来自多个cossress文件的数据,请使用字符串或字符串向量的单元格数组。该函数以您指定的顺序从文件中读取数据。如果未在当前文件夹中“ ecsstres”文件,则必须指定每个文件的完整路径。
数据类型:char
|细绳
dirname
—目录的名称
角色向量|细绳scalar
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
|细绳
keyword
—File search keyword
角色向量|细绳scalar
文件搜索关键字,指定为字符向量或字符串标量。该函数仅从其文件名中的指定关键字中返回来自Ecostress Spectrum文件的数据。您不能同时指定多个关键字。
数据类型:char
|细绳
输出参数
libData
- 来自Ecostress文件的光谱数据
结构数组
来自Ecostress Files的光谱数据,作为1乘返回K结构数组。K是该函数读取的频谱文件数量。结构数组的每个元素都有24个字段,其中包含频谱文件的标头信息。
字段名称 | 描述 |
Name |
Name of the measured sample or material |
类型 |
样本类型,例如“矿物” ,"rock" ,“树” , or“人造” |
班级 |
样本类型类 例如,如果样本类型为 |
子类 |
Subclass of the sample type 该字段包含一个空数组或 |
特别是 |
Particle size of the sample type 该字段包含一个空数组,除非 |
属 |
属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 |
起源 |
Location from which the data was obtained |
采集日期 |
Date on which the sample was collected 这个值在 |
描述 |
测量样品的描述 该字段提供了有关样品特征的其他信息。 |
测量 |
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 |
DataUnit |
光谱测量模式的单位 Spectral measurement mode includes reflectance, transmittance, transittance, and transmission. The unit is percentage. This field corresponds to the |
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
See Also
matlab命令
您单击了与此MATLAB命令相对应的链接:
通过在MATLAB命令窗口中输入该命令。Web浏览器不支持MATLAB命令。万博1manbetx
选择一个网站
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:。
您还可以从以下列表中选择一个网站:
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.
美洲
- AméricaLatina(Español)
- 加拿大(英语)
- 美国(英语)