[R-sig-Geo] problem while creating netcdf files
Ana
rrasterr at gmail.com
Sun May 13 18:55:29 CEST 2012
Hi!
I am creating netcdf files for climatic daily datasets for 50 years.
The problem is that I end up with huge files when trying just one point, and
I have 2000 more points to add. Am I doing something wrong or is it supposed
to be like this?
The code I am using:
# Make a few dimensions we can use
dimX <- dim.def.ncdf( "Long", "degrees", Longvector )
dimY <- dim.def.ncdf( "LAT", "degrees", Latvector )
dimT <- dim.def.ncdf( "Time", "days", 1:18250, unlim=FALSE )
# Make varables of various dimensionality, for illustration purposes
mv <- 1.e30 # missing value to use
var1d <- var.def.ncdf( "var1d", "units", dimX, mv,prec="double" )
var2d <- var.def.ncdf( "var2d", "units", list(dimX,dimY), mv,prec="double" )
var3d <- var.def.ncdf( "var3d", "units", list(dimX,dimY,dimT),
mv,prec="double" )
# Create the test file
nc <- create.ncdf( "writevals.nc", list(var1d,var2d,var3d) )
# !!*Creates a nc file with + 4 Gb*
# Adding the complete time series for one point (teh first point in the
list)
put.var.ncdf( nc, var3d,dataset[[1]], start=c(Longvector[1],Latvector[1],1),
count=c(1,1,-1))
# !! increases to + 16Gb
Longvector and Latvector are vectors taken from the matrix with the Long and
Lat for each point
The dataset is in list format and for each point I have a list of numeric
values.
I am using the first example given in the ndcf package:
http://127.0.0.1:29386/library/ncdf/html/aput.var.ncdf.html
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/problem-while-creating-netcdf-files-tp7555235.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
More information about the R-sig-Geo
mailing list