my netcdf.open can not open the url I want ;help!!!!!​!!!!!!!!!!​!!!!!!!!!!​!!!!!!!!!!​!

조회 수: 1 (최근 30일)
guanhao
guanhao 2024년 5월 16일
댓글: guanhao 2024년 5월 17일
error:
...
READDAP_New: did not work at 98 try: lets try again.
READDAP_New: did not work at 99 try: lets try again.
READDAP_New: did not work at 100 try: lets try again.
READDAP_New: did not work at 101 try: lets try again.
错误使用 readdap (line 45)
READDAP_New: repeated failures after 100 queries
出错 get_ECCO_subgrid (line 45)
lon=readdap(path,'LONGITUDE_T',[]);
出错 download_ECCO (line 65)
get_ECCO_subgrid(fname,lonmin,lonmax,latmin,latmax);
出错 make_OGCM (line 122)
eval(['download_',OGCM,'(Ymin,Ymax,Mmin,Mmax,lonmin,lonmax,latmin,latmax,',...
readdap (line 45):
if nargin <2
disp(['not engough input argments']);
elseif nargin <3 || isempty(query)
disp(['READDAP_New: Extract : ', varname])
while isempty(data)
if ntry>nmax
error(['READDAP_New: repeated failures after ',num2str(nmax),' queries'])
end
ntry=ntry+1;
try
ncid = netcdf.open ( url,'NOWRITE' );
varid = netcdf.inqVarID(ncid,varname);
data = netcdf.getVar(ncid,varid,'double');
netcdf.close (ncid);
catch
data=[];
disp(['READDAP_New: did not work at ',num2str(ntry),' try: lets try again.'])
end
end
else
.......
the problem:
  댓글 수: 2
Walter Roberson
Walter Roberson 2024년 5월 16일
Please post the URL as plain text so we can experiment with it.
guanhao
guanhao 2024년 5월 16일
url = 'http://apdrc.soest.hawaii.edu/thredds/dodsC/las/ecco2_cube92/data_apdrc.soest.hawaii.edu_dods_public_data_ECCO_ECCO2_cube92_'
Thanks! my friend!!!!!

댓글을 달려면 로그인하십시오.

답변 (1개)

R
R 2024년 5월 17일
The error occurred because the URL provided is not a valid OPenDAP URL. When the NETCDF-C library encounters a path resembling a URL and lacks additional information, it interprets it as an OPenDAP request.
To address this, you will need to determine the correct OPenDAP URL. The best way to do this is to find the thredds catalog entry for the file and see if the proper OPenDAP URL is listed on that page. You can access the desired dataset via the link below and select the OPENDAP URL to resolve the error:
I tried a few examples from the list and it worked:
ncid = netcdf.open('http://apdrc.soest.hawaii.edu//thredds/dodsC/las/ecco2_cube92/data_apdrc.soest.hawaii.edu_dods_public_data_ECCO_ECCO2_cube92_monthly_mxldepth.jnl','NOWRITE')
ncid = 65536

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by