function [files]=get_files_from_TDS(url_base); % GET_FILES_FROM_TDS Return list of NetCDF files found in a URL directory % of a THREDDS opendap server s=urlread(url_base); f2=strfind(s,'.nc'); k=0; % for the THREDDS data, there will be 2 .nc's found for every file. % our file names aren't longer than 25 characters for i=2:2:length(f2); k=k+1; tmp=s(f2(i)-25:f2(i)+2); idx=strfind(tmp,''); % preceeds the file name in all cases files{k}=tmp(idx+4:end); end % repeat for cdf. f2=strfind(s,'.cdf'); for i=2:2:length(f2); k=k+1; tmp=s(f2(i)-25:f2(i)+3); idx=strfind(tmp,''); % preceeds the file name in all cases files{k}=tmp(idx+4:end); end % the roots and catalogs don't always match which causes trouble % for stellwagen url_base should look like: % http://stellwagen.er.usgs.gov/thredds/catalog/TSdata/ARGO_MERCHANT/catalog.html % but the individual path to the file is: % http://stellwagen.er.usgs.gov/thredds/dodsC/TSdata/ARGO_MERCHANT/1211-A1H.cdf % % the coast-enviro equivalent url_base is: % http://coast-enviro.er.usgs.gov/thredds/ts/ARGO_MERCHANT.html % with the individual files at: % http://coast-enviro.er.usgs.gov/thredds/dodsC/ARGO_MERCHANT/1211-A1H.cdf