Hi list,

First, a big thank you to the people behind the development of the
"raster" package - I find it very useful, especially with the addition
of the Z dimension. Now, a question - I've imported climate data into R
from the CMIP5 project. All the data is in NetCDF format, which is much
easier to handle now (big thanks for that!). I find the 'rotate'
function especially useful because most of these datasets seem to be
between 0 and 360 degrees. 

I've used rotate successfully on one band of the imported data, but it
throws up an error with bricks or stacks. See the code below. Is this a
known error, or am I doing something wrong?

Cheers,
Andy

Example file downloaded from
http://pcmdi3.llnl.gov/esgcet/dataset/cmip5.output1.CCCma.CanESM2.esmHis
torical.mon.atmos.Amon.r1i1p1.html

f="CMIP5/CCCma/CanESM2/historical/mon/atmos/Amon/r1i1p1/v20111028/pr/pr_
Amon_CanESM2_historical_r1i1p1_185001-200512.nc"

rb <- brick(f, crs="+proj=longlat +datum=WGS84")
rb
class       : RasterBrick
dimensions  : 64, 128, 8192, 1872  (nrow, ncol, ncell, nlayers)
resolution  : 2.8125, 2.789327  (x, y)
extent      : -1.40625, 358.5938, -89.25846, 89.25846  (xmin, xmax,
ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
values      : /media/WD
MYBOOK/CMIP5/CCCma/CanESM2/historical/mon/atmos/Amon/r1i1p1/v20111028/pr
/pr_Amon_CanESM2_historical_r1i1p1_185001-200512.nc
zvar        : pr
rbr <- rotate(rb)
Error in rowSums(is.na(x)) :
  'x' must be an array of at least two dimensions

r <- subset(rb, 1)
rr <- rotate(r)
rr
class       : RasterLayer
dimensions  : 64, 128, 8192  (nrow, ncol, ncell)
resolution  : 2.8125, 2.789327  (x, y)
extent      : -181.4062, 178.5938, -89.25846, 89.25846  (xmin, xmax,
ymin, ymax)
coord. ref. : NA
values      : in memory
min value   : 0
max value   : 0.0003839434
--
Andrew Hartley Climate Impacts Risk Analyst
Met Office FitzRoy Road Exeter EX1 3PB United Kingdom
Tel: +44 (0)1392 885720 Fax: +44 (0)1392 885681
E-mail: andrew.hartley@metoffice.gov.uk http://www.metoffice.gov.uk
<blocked::http://www.metoffice.gov.uk/>  

Join us in celebrating 150 years of forecasting for the nation and enter
our photo competition
http://www.metoffice.gov.uk/about-us/who/our-history
<blocked::http://www.metoffice.gov.uk/about-us/who/our-history> 


	[[alternative HTML version deleted]]

