Why receive error message "Could not find variable or group 'Bandl' in file."
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Simbarashe Chidzambwa
le 29 Mar 2023
Commenté : Simbarashe Chidzambwa
le 29 Mar 2023
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 commentaires
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 29 Mar 2023
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.
Voir également
Catégories
En savoir plus sur NetCDF dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!