0

I have simply made everything ready for saving my NetCDF but during saving the file I cannot save the timestamp as before. Previously, the timestamp was 1970-01-01 00:00:00.0 and the unit hours since 1900-01-01 00:00:00.0, see the first picture. When I save it, I get the same unit, but the hours change and not the months, see second picture. This is how I save my NetCDF file:

shp = st_read("path/shapefile.shp")
temp = brick("path/temperature70-78.nc")

nc.mask = mask(temp, shp)
writeRaster(nc.mask, filename = "path.nc", overwrite = TRUE, format = "CDF", varname = "t2m", varunit = "K", longname = "temperatuer in 2 metres", xname = "longitude", yname = "latitude", zname = "time", zunit = "hours since 1900-01-01 00:00:00.0")

untitled

untitled2

ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
Thomas
  • 441
  • 3
  • 16

0 Answers0