Hi Everyone, Please, could you help me.
I have a .nc file. I am using:
install.packages('fields')
install.packages('ncdf4')
require(ncdf4)
require(fields)
f <- nc_open("/path/f.nc")
lat <- ncvar_get(f, "latitude")
lon <- ncvar_get(f, "longitude")
tm <- ncvar_get(f, "time")
tm <- as.Date(tm, origin = '1900-01-01 00:00:00.0')
tm
The tm is not working as I wanted. I would like to know how I transform my six hourly data from int32 to (00:00, 06:00,12:00,18:00).
Dataset is from January 2007 to December 2017. Details as follows:
Year:
2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
Month:
January, February, March, April, May, June, July, August, September, October, November, December
Day:
01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
Time:
00:00, 06:00, 12:00, 18:00
But when I open "f", it says the origin is 1900-01-00.
Thank you!!
Cheers!