- 积分
- 8255
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-9-6
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
想提取nc文件中的 FinalAerosolAbsOpticalDepth500这一变量,但报错时显示nc文件中并无此变量,奇怪。
程序如下:
clc; %清屏
clear; %清空
datadir='G:\AODdata\2005\'; %指定批量数据所在的文件夹
filelist=dir([datadir,'*.nc']); %指定批量数据的类型
a=filelist(1).name; %查看你要读取的文件的编号。filelist(1).name在window下为第一个标号数据
b=filelist(2).name; %查看你要读取的文件的编号。filelist(2).name在window下为第二个标号数据
k=length(filelist);
for s=1:k
filename=[datadir,filelist(s).name];
ncid=netcdf.open(filename,'NC_NOWRITE');
ncdisp('G:\AODdata\2005\OMI-Aura_L3-OMAERUVd_2005m0930_v003-2012m0325t110429.he5.nc'); %在命令窗中显示nc文件的变量
AODData = ncread(filename,' FinalAerosolAbsOpticalDepth500'); %读入变量
TimeData = ncread(filename,'time'); %读入变量time
LonData = ncread(filename,'lon'); %读入变量lon
LatData = ncread(filename,'lat'); %读入变量lat
netcdf.close(ncid); % 关闭文件
end;
运行后显示:
Source:
G:\AODdata\2005\OMI-Aura_L3-OMAERUVd_2005m0930_v003-2012m0325t110429.he5.nc
Format:
classic
Global Attributes:
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.OrbitNumber = [6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461]
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.OrbitPeriod = [5933 5932 5933 5932 5933 5932 5933 5932 5933 5932 5933 5932 5933 5932 5933 5932 5933 5932 5933 5932 5933 5933 5932 5932 5933 5932 5933 5932 5933 5933 5932 5932 5933 5933 5932 5933 5932 5933 5932 5933 5932 5933 5932 5933]
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.InstrumentName = 'OMI'
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.ProcessLevel = '3'
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.GranuleMonth = 9
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.GranuleDay = 30
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.GranuleYear = 2005
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.GranuleDayOfYear = 273
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.TAI93At0zOfGranule = 402192005
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.PGEVersion = '\"1.2.0.1\"'
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.StartUTC = '2005-09-29T12:15:00.000000Z'
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.EndUTC = '2005-10-01T11:45:00.000000Z'
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.Period = 'Daily'
HDFEOS_ADDITIONAL_FILE_ATTRIBUTES.fullnamepath = '/HDFEOS/ADDITIONAL/FILE_ATTRIBUTES'
HDFEOS_GRIDS_Aerosol_NearUV_Grid.GCTPProjectionCode = 0
HDFEOS_GRIDS_Aerosol_NearUV_Grid.Projection = 'Geographic'
HDFEOS_GRIDS_Aerosol_NearUV_Grid.GridOrigin = 'Center'
HDFEOS_GRIDS_Aerosol_NearUV_Grid.GridSpacing = '(1.0,1.0)'
HDFEOS_GRIDS_Aerosol_NearUV_Grid.GridSpacingUnit = 'deg'
HDFEOS_GRIDS_Aerosol_NearUV_Grid.GridSpan = '(-180,180,-90,90)'
HDFEOS_GRIDS_Aerosol_NearUV_Grid.GridSpanUnit = 'deg'
HDFEOS_GRIDS_Aerosol_NearUV_Grid.NumberOfLongitudesInGrid = 360
HDFEOS_GRIDS_Aerosol_NearUV_Grid.NumberOfLatitudesInGrid = 180
HDFEOS_GRIDS_Aerosol_NearUV_Grid.fullnamepath = '/HDFEOS/GRIDS/Aerosol NearUV Grid'
HDFEOS_INFORMATION.HDFEOSVersion = 'HDFEOS_5.1.11'
HDFEOS_INFORMATION.fullnamepath = '/HDFEOS INFORMATION'
Dimensions:
lat = 180
lon = 360
StructMetadata_0_len = 2491
Variables:
FinalAerosolAbsOpticalDepth388
Size: 360x180
Dimensions: lon,lat
Datatype: single
Attributes:
_FillValue = -1.267650600228229e+30
units = 'NoUnits'
title = 'Final Aerosol Absorption Optical Depth at 388 nm'
UniqueFieldDefinition = 'OMI-Specific'
scale_factor = 1
add_offset = 0
missing_value = -1.267650600228229e+30
origname = 'FinalAerosolAbsOpticalDepth388'
fullnamepath = '/HDFEOS/GRIDS/Aerosol NearUV Grid/Data Fields/FinalAerosolAbsOpticalDepth388'
orig_dimname_list = 'YDim XDim'
FinalAerosolAbsOpticalDepth500
Size: 360x180
Dimensions: lon,lat
Datatype: single
Attributes:
_FillValue = -1.267650600228229e+30
units = 'deg'
title = 'Final Aerosol Absorption Optical Depth at 500 nm'
UniqueFieldDefinition = 'Aura-Shared'
scale_factor = 1
add_offset = 0
missing_value = -1.267650600228229e+30
origname = 'FinalAerosolAbsOpticalDepth500'
fullnamepath = '/HDFEOS/GRIDS/Aerosol NearUV Grid/Data Fields/FinalAerosolAbsOpticalDepth500'
orig_dimname_list = 'YDim XDim'
FinalAerosolExtOpticalDepth388
Size: 360x180
Dimensions: lon,lat
Datatype: single
Attributes:
_FillValue = -1.267650600228229e+30
units = 'NoUnits'
title = 'Final Aerosol Extinction Optical Depth at 388 nm'
UniqueFieldDefinition = 'OMI-Specific'
scale_factor = 1
add_offset = 0
missing_value = -1.267650600228229e+30
origname = 'FinalAerosolExtOpticalDepth388'
fullnamepath = '/HDFEOS/GRIDS/Aerosol NearUV Grid/Data Fields/FinalAerosolExtOpticalDepth388'
orig_dimname_list = 'YDim XDim'
FinalAerosolExtOpticalDepth500
Size: 360x180
Dimensions: lon,lat
Datatype: single
Attributes:
_FillValue = -1.267650600228229e+30
units = 'NoUnits'
title = 'Final Aerosol Extinction Optical Depth at 500 nm'
UniqueFieldDefinition = 'OMI-Specific'
scale_factor = 1
add_offset = 0
missing_value = -1.267650600228229e+30
origname = 'FinalAerosolExtOpticalDepth500'
fullnamepath = '/HDFEOS/GRIDS/Aerosol NearUV Grid/Data Fields/FinalAerosolExtOpticalDepth500'
orig_dimname_list = 'YDim XDim'
FinalAerosolSingleScattAlb388
Size: 360x180
Dimensions: lon,lat
Datatype: single
Attributes:
_FillValue = -1.267650600228229e+30
units = 'NoUnits'
title = 'Final Aerosol Single Scattering Albedo at 388 nm'
UniqueFieldDefinition = 'OMI-Specific'
scale_factor = 1
add_offset = 0
missing_value = -1.267650600228229e+30
origname = 'FinalAerosolSingleScattAlb388'
fullnamepath = '/HDFEOS/GRIDS/Aerosol NearUV Grid/Data Fields/FinalAerosolSingleScattAlb388'
orig_dimname_list = 'YDim XDim'
FinalAerosolSingleScattAlb500
Size: 360x180
Dimensions: lon,lat
Datatype: single
Attributes:
_FillValue = -1.267650600228229e+30
units = 'NoUnits'
title = 'Final Aerosol Single Scattering Albedo at 500 nm'
UniqueFieldDefinition = 'OMI-Specific'
scale_factor = 1
add_offset = 0
missing_value = -1.267650600228229e+30
origname = 'FinalAerosolSingleScattAlb500'
fullnamepath = '/HDFEOS/GRIDS/Aerosol NearUV Grid/Data Fields/FinalAerosolSingleScattAlb500'
orig_dimname_list = 'YDim XDim'
UVAerosolIndex
Size: 360x180
Dimensions: lon,lat
Datatype: single
Attributes:
_FillValue = -1.267650600228229e+30
units = 'NoUnits'
title = 'UV Aerosol Index'
UniqueFieldDefinition = 'OMI-Specific'
scale_factor = 1
add_offset = 0
missing_value = -1.267650600228229e+30
origname = 'UVAerosolIndex'
fullnamepath = '/HDFEOS/GRIDS/Aerosol NearUV Grid/Data Fields/UVAerosolIndex'
orig_dimname_list = 'YDim XDim'
StructMetadata_0
Size: 2491x1
Dimensions: StructMetadata_0_len
Datatype: char
Attributes:
origname = 'StructMetadata.0'
fullnamepath = '/HDFEOS INFORMATION/StructMetadata.0'
lon
Size: 360x1
Dimensions: lon
Datatype: single
Attributes:
units = 'degrees_east'
lat
Size: 180x1
Dimensions: lat
Datatype: single
Attributes:
units = 'degrees_north'
Error using internal.matlab.imagesci.nc/getGroupAndVarid (line 2083)
Could not find variable or group ' FinalAerosolAbsOpticalDepth500' in file.
Error in internal.matlab.imagesci.nc/read (line 593)
[gid, varid] = getGroupAndVarid(this, location);
Error in ncread (line 58)
vardata = ncObj.read(varName, varargin{:});
Error in dunc (line 12)
AODData = ncread(filename,' FinalAerosolAbsOpticalDepth500'); %读入变量
|
|