[R-sig-Geo] dates with brick and multilayer netcdf file are off

Ariel Ortiz-Bobea aortizbobea at arec.umd.edu
Thu Oct 18 20:14:03 CEST 2012


Hello,

I'm having a problem when trying to import a multi-layer netcdf file using
brick() in the raster package. The dates in the raster/brick object are off
by a lot and after importing the file I get the warning message:
 
    In .doTime(r, nc, zvar, dim3) : assuming a standard calender  

The netcdf files corresponds to the output of a climate model with years of
360 days so perhaps this has to do with the problem. I suppose the .doTime
function is having a hard time extracting this date format.

I selected a small file of 30 days (3.4MB) that you can download to
reproduce the problem:
https://dl.dropbox.com/u/45311184/tasmin_day_HadGEM2-ES_rcp85_r1i1p1_20991201-20991230.nc

That file contains data for time periods 2099/12/01-2099/12/30. When
imported, the reported range of dates is 2096/06/20-2096/07/19. So it's 30
time periods, but the wrong ones.

I could manually set the time periods given that I know the boundary dates
and the time step, but I rather have a more elegant solution.

Any help would be great. 

Thanks,

Ariel


# Reproducible code: #-----------------

# load package
   library(raster)

# Working directory where you placed the nc file
   setwd("/Users/Ariel/Downloads")
   
# Load file
   r <- brick("tasmin_day_HadGEM2-ES_rcp85_r1i1p1_20991201-20991230.nc",
varname="tasmin")
   # here I get the following warning:
   # Warning message:
   # In .doTime(r, nc, zvar, dim3) : assuming a standard calender  

# See layer names
   r at layernames # does not match the 2099/12/01-2099/12/30 time period,
dates are off ~ 2.5 years




-----
Ariel Ortiz-Bobea
PhD Candidate in Agricultural & Resource Economics
University of Maryland - College Park
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/dates-with-brick-and-multilayer-netcdf-file-are-off-tp7581332.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list