[Rodbcext-commits] r35 - pkg/geoclimate/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 17 06:58:04 CET 2013


Author: jaunario
Date: 2013-01-17 06:58:04 +0100 (Thu, 17 Jan 2013)
New Revision: 35

Modified:
   pkg/geoclimate/R/trmm.r
Log:
Corrected weather object population error (create base raster before populate)

Modified: pkg/geoclimate/R/trmm.r
===================================================================
--- pkg/geoclimate/R/trmm.r	2013-01-17 03:43:57 UTC (rev 34)
+++ pkg/geoclimate/R/trmm.r	2013-01-17 05:58:04 UTC (rev 35)
@@ -61,13 +61,14 @@
 		
 		wth at rmk <- prod.ftp
 		
+		baseraster <- raster(extent(-180,180,-50,50))
+		res(baseraster) <- 0.25
+		cell <- 1:ncell(baseraster)		
+		
 		prec <- matrix(readBin(rawtrmm, double(), endian="big", size=4, n=ncell(baseraster)), ncol=ncol(baseraster), nrow=nrow(baseraster), byrow=TRUE)
 		prec[prec==min(prec)] <- NA
 		prec <- prec[nrow(prec):1,]
 		
-		baseraster <- raster(extent(-180,180,-50,50))
-		res(baseraster) <- 0.25
-		cell <- 1:ncell(baseraster)		
 		baseraster[] <- prec
 
 		wth at w <- as.data.frame(cell)



More information about the Rodbcext-commits mailing list