error reading online netcdf data
Show older comments
Dear All,
I am trying to read this file with Matlab, using the following as advised by Columbia website :
loaddap('http://iridl.ldeo.columbia.edu/SOURCES/.UCSB/.CHIRPS/.v2p0/.daily-improved/.global/.0p05/.prcp/Y/%281N%29%2817N%29RANGEEDGES/X/%2830E%29%2850E%29RANGEEDGES/dods')
loaddap is not working so I used this and it works :
filename =
'http://iridl.ldeo.columbia.edu/SOURCES/.UCSB/.CHIRPS/.v2p0/.daily-improved/.global/.0p05/.prcp/Y/%281N%29%2817N%29RANGEEDGES/X/%2830E%29%2850E%29RANGEEDGES/dods'
and these are the variables in the netcdf file (latitude, longitude, time and precipitation) :
ncdisp(filename)
Source:
Format:
classic
Global Attributes:
Conventions = 'IRIDL'
Dimensions:
T = 14244
X = 400
Y = 320
Variables:
T
Size: 14244x1
Dimensions: T
Datatype: single
Attributes:
standard_name = 'time'
pointwidth = 1
calendar = 'standard'
expires = 1580515200
gridtype = 0
units = 'julian_day'
Y
Size: 320x1
Dimensions: Y
Datatype: single
Attributes:
standard_name = 'latitude'
pointwidth = 0.05
gridtype = 0
units = 'degree_north'
X
Size: 400x1
Dimensions: X
Datatype: single
Attributes:
standard_name = 'longitude'
pointwidth = 0.05
gridtype = 0
units = 'degree_east'
prcp
Size: 400x320x14244
Dimensions: X,Y,T
Datatype: single
Attributes:
pointwidth = 1
missing_value = -9999
standard_name = 'lwe_precipitation_rate'
units = 'mm/day'
long_name = 'precipitation'
expires = 1580515200
CE = 100
maxncolor = 254
scale_min = 0
CS = 0
colormap = '13882323
16777215
16777215
16777184
6
15453831
6
16748574
14
13434880
18
4026644
24
7451452
21
9419919
43
9234160
44
6333684
41
2237106
43
2237106'
colorscalename = 'prcp_dailyrate_max100_smooth'
scale_max = 100
ncolor = 254
Now if I read the variables latitude, longitude and time (X,Y and T), it works perfectly, but then when I arrive to read the precipitation variables I get the following error :
longitude=ncread (filename, 'X');
latitude=ncread (filename, 'Y');
time=ncread (filename, 'T');
prec=ncread (filename, 'prcp');
66 vardata = ncObj.read(varName, varargin{:});
Error using netcdflib
The NetCDF library encountered an error during execution of 'getVarFloat' function - 'Access failure (-77)'.
Error in netcdf.getVar (line 140)
data = netcdflib(funcstr,ncid,varid,varargin{:});
Error in internal.matlab.imagesci.nc/read (line 605)
data = netcdf.getVar(gid, varid);
Error in ncread (line 66)
vardata = ncObj.read(varName, varargin{:});
Can you please help me ?
Accepted Answer
More Answers (0)
Categories
Find more on NetCDF in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!