And I obtained the following error:
"The NetCDF library encountered an error during execution of 'open' function - 'Access failure (-77)'."
I have the Earthdata login in my .netrc and last year I used it to download ocean currents from the OSCAR data product. Today, I could access those data after one attempt, but when trying again I obtained the following error:
"The NetCDF library encountered an error during execution of 'open' function - 'DAP server error (NC_EDAPSVC)'"
Lastly, I tried the same approach with the two servers reported in the MATLAB tutorial (https://opendap.github.io/documentation/tutorials/matlab_tutorial.html) and I could not access those data either. This time, I obtained the following error:
"The NetCDF library encountered an error during execution of 'open' function - 'Not a valid data type or _FillValue type mismatch (NC_EBADTYPE)'"
I do not have problems using MATLAB to access other OPeNDAP servers (the Copernicus ones, for example). I am wondering if anyone knows the cause of this problem and/or if anyone is having similar issues using MATLAB and the EarthData OPeNDAP. Any help is appreciated.
PS: I am working on a MAC with OS Ventura and MATLAB R2021a
If I restart the browser and connect to the OPeNDAP URL, it asks for my Earthdata login. Is the browser also supposed to obtain this information from the .netrc?
After the login, I have normal access to the URL.
Our SME tried the OPeNDAP URL referenced today: https://opendap.earthdata.nasa.gov/collections/C2036877745-POCLOUD/granules/20230510000000-OSPO-L4_GHRSST-SSTfnd-Geo_Polar_Blended_Night-GLOB-v02.0-fv01.0
She accessed it using her browser and wget, and was able to successfully do a direct download in nc4. However, she had to refresh her requests twice because it was encountering a server issue. The Hyrax team is aware of BES connection issue (it’s an issue with their production env), but we are unsure what their timeline is to fix it.
PO.DAAC User Services
In both cases, I am able to download the data from the opendap url using safari, chrome, and curl in the command line, similar to the last post above.
But, I cannot get access in Matlab. Like the original poster, I can access opendap files using Matlab, e.g. ncdisp('http://test.opendap.org/dap/data/nc/sst.mnmean.nc.gz'), but not those in earthdata.nasa.gov.
I also cannot get the dap4:// protocol to work in the tutorial linked in the original post.
I spent a lot of time trying to get a .dodsrc file right, but I'm not certain that it is right, and I don't think I have another netcdf/C library program to test on this machine.
Do any Matlab users know a tutorial that works through the authentication/access issues for Matlab/Opendap?
- Subject Matter Expert
- Posts: 14
- Joined: Tue May 11, 2021 12:58 pm America/New_York
% wget --http-user=username --ask-password --keep-session-cookies https://opendap.earthdata.nasa.gov/collections/C2270392799-POCLOUD/granules/ssh_grids_v2205_1993020712.dap.nc4
% wget --http-user=username --ask-password --keep-session-cookies https://opendap.earthdata.nasa.gov/collections/C2036877745-POCLOUD/granules/20230510000000-OSPO-L4_GHRSST-SSTfnd-Geo_Polar_Blended_Night-GLOB-v02.0-fv01.0
Regarding the Matlab program, you could try to use the webread() function. It will return a long list of uint8. You probably need to convert it to a structure.