Why receive error message "Could not find variable or group 'Bandl' in file."
2 次查看(过去 30 天)
显示 更早的评论
When I dispaly information abut my netcdf file (1982 January average sst) it dispalys the variable "Bandl" which must be the sst data. But when I want to access that variable to through "ncinfo" as shown below I receive an error message "Could not find variable or group 'Bandl' in file." Why is that?
>> ncdisp('198201.sst.avg.nc')
Format:
classic
Global Attributes:
Conventions = 'CF-1.5'
GDAL = 'GDAL 2.4.0, released 2018/12/14'
history = 'Fri Oct 21 14:28:38 2022: GDAL Create( /export/home/dres/SST/monthlyNCEI/sst/198201.sst.avg.nc, ... )'
Dimensions:
lon = 360
lat = 180
Variables:
Band1
Size: 360x180
Dimensions: lon,lat
Datatype: single
Attributes:
long_name = 'GDAL Band Number 1'
_FillValue = -999
units = 'Celsius'
lat
Size: 180x1
Dimensions: lat
Datatype: double
Attributes:
standard_name = 'latitude'
long_name = 'latitude'
units = 'degrees_north'
lon
Size: 360x1
Dimensions: lon
Datatype: double
Attributes:
standard_name = 'longitude'
long_name = 'longitude'
units ='degrees east'
>> ncinfo('198201.sst.avg.nc',"Bandl")
Error using internal.matlab.imagesci.nc/getGroupAndVarid
Could not find variable or group 'Bandl' in file.
Error in internal.matlab.imagesci.nc/info (line 979)
[gid, varid] = getGroupAndVarid(this, location);
Error in ncinfo (line 98)
info = ncObj.info(location);
0 个评论
采纳的回答
更多回答(1 个)
Walter Roberson
2023-3-29
You are asking to access Bandl with the final character being lower-case L . The variable in the file is Band1 with the final character being the number 1.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 NetCDF 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!