0

I have the problem, that I cannot convert the numeric dates from NetCDF file:

2114380800 2114384400 2114388000 2114391600 2114395200 2114398800 2114402400 2114406000... 

to the dates on R. I have tried the most common possibility that I've found:

library(ncdf4) library(RNetCDF) library(chron) ncin <- nc_open("meteo.nc") vars <-c(names(ncin$var)) t <- ncvar_get(ncin, "time") tunits <- ncatt_get(ncin,"time","units") tustr <- strsplit(tunits$value, " ") tdstr <- strsplit(unlist(tustr)[3], "-") tmonth <- as.integer(unlist(tdstr)[2]) tday <- as.integer(unlist(tdstr)[3]) tyear <- as.integer(unlist(tdstr)[1]) chron(t,origin=c(tmonth, tday, tyear)) 

This chron function really gives me the date,s but they are unrealistic (I know there should be january to august 2017):

01/04/28 11/12/37 09/21/47 07/30/57 06/08/67 04/16/77 02/23/87 01/01/97 ... 

I guess the problem is the tunits refer to "seconds since 1950-01-01 00:00:00", not days. Please, help me to find solution for the seconds.

2

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.