search for: tdim

Displaying 7 results from an estimated 7 matches for "tdim".

Did you mean: dim
2009 Nov 10
3
NetCDF output in R
...######## function for writing out the netcdf file ############# write.netcdf.time <- function(filename='outputfile.nc',data,lons,lats,nt){ lon <- dim.def.ncdf('lon','degrees_east',lons) lat <- dim.def.ncdf('lat','degrees_north',lats) times <- 1:nt tdim <- dim.def.ncdf('time','days since 1980-01-01', times, unlim=TRUE) # levs <- dim.def.ncdf('lev','pressure',levs) var <- var.def.ncdf('data','unitless',list(lon,lat,tdim),-999.9) ncid <- create.ncdf(filename,list(var)) put.var.ncdf(ncid, va...
2009 Nov 10
3
NetCDF output in R
...######## function for writing out the netcdf file ############# write.netcdf.time <- function(filename='outputfile.nc',data,lons,lats,nt){ lon <- dim.def.ncdf('lon','degrees_east',lons) lat <- dim.def.ncdf('lat','degrees_north',lats) times <- 1:nt tdim <- dim.def.ncdf('time','days since 1980-01-01', times, unlim=TRUE) # levs <- dim.def.ncdf('lev','pressure',levs) var <- var.def.ncdf('data','unitless',list(lon,lat,tdim),-999.9) ncid <- create.ncdf(filename,list(var)) put.var.ncdf(ncid, va...
2012 Aug 21
1
ncdf - writing variable to a file
...ile. Below is a part of my script and how it fails. I can't find "create.var.ncdf" in help Thanks for any help. Mark nc <- open.ncdf(ncname, readunlim=FALSE, write=TRUE ) missing <- 1.e+30 xdim <- nc$dim[["west_east"]] ydim <- nc$dim[["south_north"]] tdim <- nc$dim[["Time"]] lscalevar <- var.def.ncdf(scalenames[ivar], 'gpoints', list(xdim,ydim,tdim), missing ) nc <- var.add.ncdf( nc, lscalevar ) for( i in 1:nt) put.var.ncdf(nc,lscalevar,scale,verbose=TRUE ) #scale is an array dimensioned (nx,ny) [1] "Hint: make...
2017 Aug 14
2
ncdf4: Why are NAs converted to _FillValue when saving?
...rom netcdf4 manual): library(ncdf4) #---------------- # Make dimensions #---------------- xvals <- 1:360 yvals <- -90:90 nx <- length(xvals) ny <- length(yvals) xdim <- ncdim_def('Lon','degreesE', xvals ) ydim <- ncdim_def('Lat','degreesE', yvals ) tdim <- ncdim_def('Time','days since 1900-01-01', 0, unlim=TRUE ) #--------- # Make var #--------- mv <- 1.e30 # missing value var_temp <- ncvar_def('Temperature','K', list(xdim,ydim,tdim), mv ) #--------------------- # Make new output file #-----------------...
2005 Apr 29
0
handling of zero and negative indices in src/main/subscript.c:mat2indsub() (PR#7824)
...* This code returns a vector containing the integer subscripts */ /* to be extracted when x is regarded as unravelled. */ /* Negative indices are not allowed. */ /* A zero anywhere in a row will cause a zero in the same */ /* position in the result. */ SEXP mat2indsub(SEXP dims, SEXP s) { int tdim, j, i, k, nrs = nrows(s); SEXP rvec; PROTECT(rvec = allocVector(INTSXP, nrs)); s = coerceVector(s, INTSXP); setIVector(INTEGER(rvec), nrs, 0); for (i = 0; i < nrs; i++) { tdim = 1; /* compute 0-based subscripts for a row (0 in the input */ /* gets -1 in the...
2005 May 06
0
(PR#7824) handling of zero and negative indices in
...g the integer subscripts */ > /* to be extracted when x is regarded as unravelled. */ > /* Negative indices are not allowed. */ > /* A zero anywhere in a row will cause a zero in the same */ > /* position in the result. */ > > SEXP mat2indsub(SEXP dims, SEXP s) > { > int tdim, j, i, k, nrs = nrows(s); > SEXP rvec; > > PROTECT(rvec = allocVector(INTSXP, nrs)); > s = coerceVector(s, INTSXP); > setIVector(INTEGER(rvec), nrs, 0); > > for (i = 0; i < nrs; i++) { > tdim = 1; > /* compute 0-based subscripts for a row (0 in th...
2017 Aug 14
0
ncdf4: Why are NAs converted to _FillValue when saving?
...--------- > # Make dimensions > #---------------- > xvals <- 1:360 > yvals <- -90:90 > nx <- length(xvals) > ny <- length(yvals) > xdim <- ncdim_def('Lon','degreesE', xvals ) > ydim <- ncdim_def('Lat','degreesE', yvals ) > tdim <- ncdim_def('Time','days since 1900-01-01', 0, unlim=TRUE ) > #--------- > # Make var > #--------- > mv <- 1.e30 # missing value > var_temp <- ncvar_def('Temperature','K', list(xdim,ydim,tdim), mv ) > #--------------------- > # Make...