필터 지우기
필터 지우기

Problem in determining time dimension in netcdf file

조회 수: 7 (최근 30일)
Poulomi Ganguli
Poulomi Ganguli 2019년 7월 6일
답변: Walter Roberson 2019년 7월 7일
Hello:
I am analyzing EURO CORDEX wind data for 1979 - 01-01-1979-12-30 period. The time dimension of the associated netcdf file is attached here. If I do ncdisp of the netcdf file, I get following message:
Format:
netcdf4_classic
Dimensions:
time = 1440 (UNLIMITED)
Variables:
time
Size: 1440x1
Dimensions: time
Datatype: double
Attributes:
standard_name = 'time'
long_name = 'time'
bounds = 'time_bnds'
units = 'days since 1949-12-01 00:00:00'
calendar = '360_day'
axis = 'T'
I need to calculate number of minutes from 1979-01-01 since the first time stamp. I tried foll. ways:
time = ncread(sprintf('%s%s',fullfile(dir_input),'\uas\uas_EUR-11_MOHC-HadGEM2-ES_historical_r1i1p1_SMHI-RCA4_v1_3hr_197901010000-197912302100_6hrly.nc'),'time');
t = datenum(1949,12,01,double(time),0,0);
refdatenum = datenum(1979,1,1);
time2 = (t(1,1)-refdatenum)*24*60
But I am always end up with negative values. I suppose to get 6-hourly wind output from 1979 onwards. Any help will be deeply appreciated. Thanks,

답변 (1개)

Walter Roberson
Walter Roberson 2019년 7월 7일
You are putting the input values into the hours slot instead of the days slot.
minutes(datetime(1949,12,1) + time - datetime(1979,1,1))

카테고리

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