%many_concat.m appends more than 2 EPIC files and updates attributes. % Modified to only update minima and maxima in variables that already % have those attributes. Fran Hotchkiss 17 Feb 1999 %%% START USGS BOILERPLATE -------------% There is no published documentation for these programs- use the % internal comments and help function. % Programs written in Matlab- as early as 7.2.0.232 (R2006a) and % most recent modifications in v7.8.0 (R2009a) % Programs ran on PC with Windows XP Professional OS, and RHEL4 linux. % % "Although this program has been used by the USGS, no warranty, % expressed or implied, is made by the USGS or the United States % Government as to the accuracy and functioning of the program % and related program material nor shall the fact of distribution % constitute any such warranty, and no responsibility is assumed % by the USGS in connection therewith." %%% END USGS BOILERPLATE -------------- result=fcopy('wind9711-alp.nc','windconcat.nc') nccat('windconcat.nc','wind9801-alp.nc','44013-alp.nc') nc = netcdf('windconcat.nc', 'write'); if isempty(nc), return, end nctime = nc{'time'}(:); nctime2 = nc{'time2'}(:); ncstime = ep_datenum([nctime(1) nctime2(1)]); ncn = length(nctime)%; ncltime = ep_datenum([nctime(ncn) nctime2(ncn)]); nc.COMPOSITE = ncdouble(1); nc.start_time = datestr(ncstime,0); nc.stop_time = datestr(ncltime,0); nc.CREATION_DATE = ncchar(datestr(now,0)); history = ['Concatenation of files wind9711-alp.nc through 44013-alp.nc :' nc.history(:)]%; nc.history = ncchar(history); nc{'time'}.type = ncchar('UNEVEN'); nc{'time2'}.type = ncchar('UNEVEN'); % Update variable min/max. ncrecvar = recvar(nc)%; for i = [1:length(ncrecvar)] dvar = nc{name(ncrecvar{i})}; if (~isempty(dvar.minimum(:))) dvar = autonan(dvar,1); data = dvar(:); dvar.minimum = ncfloat(min(data)); dvar.maximum = ncfloat(max(data)); end end ncclose