Problem to access OPeNDAP data behind https:// urls
Show older comments
Hi!
I'm trying to access an OPeNDAP server with the https:// handle. I have the R2019b version of matlab. As far as I understand, matlab can't access the file directly because of security reasons(?). But it seems as though sometimes my code works and extracts the variable, sometimes not. See here
>> m=1
chl_A(m)=ncread(url, 'chlor_a', [lonnumber(m)-1,latnumber(m)-1,timeM(m)-1],[1 1 1]); %this code extracts data
>> m=2
>> chl_A(m)=ncread(url, 'chlor_a', [lonnumber(m)-1,latnumber(m)-1,timeM(m)-1],[1 1 1]); %this does not
Error using netcdflib
The NetCDF library encountered an error during execution of 'open' function - 'I/O failure (NC_EIO)'. If the data source was an OPeNDAP URL,
see the OPeNDAP Troubleshooting section in the Users Guide.
Error in netcdf.open (line 67)
[varargout{:}] = netcdflib ( 'open', filename, varargin{1} );
Error in internal.matlab.imagesci.nc/openToRead (line 1278)
this.ncRootid = netcdf.open(this.Filename,'NOWRITE');
Error in internal.matlab.imagesci.nc (line 121)
this.openToRead();
Error in ncread (line 61)
ncObj = internal.matlab.imagesci.nc(ncFile);
and basically matlab does this to the whole data. I have 158 points to extract and it only extracts about 30 of them, for the others the error comes up. Why?
This code used to work when the server was a http:// one. Is there any way to fix it or bypass it?
Thanks in advance!
2 Comments
Rashed Mohammed
on 26 Nov 2020
Hi Sofya
Could you please provide the URL and Operating System you are using so that we can replicate the issue
Sofya Kuzmina
on 26 Nov 2020
Accepted Answer
More Answers (0)
Categories
Find more on NetCDF Files 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!