Timestamp creation for netCDF files

조회 수: 2 (최근 30일)
George
George 2016년 2월 26일
Hello all
I have a small question concerning timestamps and netCDF, I written the process although I do not get a timestamp written in the final netCDF file that is humanly readable I have followed this process
T=1:1:length(Data);
start_date = datenum('01-Jan-2010 00:00');
end_date = datenum('01-Jan-2010 02:00'); % the final timestamp is one less that the actual length of the Data
interval = 1; % Interval of recording
start_date = datenum([start_date]);
end_date = datenum([end_date]);
tstep = interval/24; % timestep set
date = datestr(start_date:tstep:end_date);
T=datenum(date);
% create netCDF
ncid = netcdf.create('myfile.nc','netcdf4');
dimidT = netcdf.defDim(ncid,'Time',length(T))
varid3 = netcdf.defVar(ncid,'Time','double',dimidT)
netcdf.close(ncid)
I have tried and omitted the final convection of
T=datenum(date);
But then the netCDF cannot write the the file
First how can i produce timestamp that are humanly readable for netCDF content Secondly is there a way to use the original T (length of Data variable) to generate a timestamp based on that length and an initial time?
Any suggestions welcome Thank you

답변 (0개)

카테고리

Help CenterFile Exchange에서 NetCDF에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by