Commit 25fe2a0e authored by Franssen, Wietse's avatar Franssen, Wietse
Browse files

remain array dimensions in ncLoad

parent ddf47d3e
......@@ -15,7 +15,7 @@ plotje <-function(data, title = NULL) {
title=paste0(data$Variable$longName, " [",data$Variable$units,"]")
}
}
if (length(dim(data$Data)) > 2) {
dataTmp<-aperm(data$Data[1,,],c(2,1))
cat("Plotting first timestep\n")
......@@ -386,12 +386,12 @@ ncLoad <-function(file, varName = NULL, lonlatbox = NULL, timesteps = NULL, z =
## Fill data
if(is.null(z)) {
if(!is.null(ncFile$dim$time)) {
data$Data <- ncvar_get( ncFile, varName, start=c(LonIdx[1],LatIdx[1],timeIdx[1]),count=c(length(LonIdx),length(LatIdx),length(timeIdx)))
data$Data <- ncvar_get( ncFile, varName, start=c(LonIdx[1],LatIdx[1],timeIdx[1]),count=c(length(LonIdx),length(LatIdx),length(timeIdx)), collapse_degen = F)
} else {
data$Data <- ncvar_get( ncFile, varName, start=c(LonIdx[1],LatIdx[1]),count=c(length(LonIdx),length(LatIdx)))
data$Data <- ncvar_get( ncFile, varName, start=c(LonIdx[1],LatIdx[1]),count=c(length(LonIdx),length(LatIdx)), collapse_degen = F)
}
} else {
data$Data <- ncvar_get( ncFile, varName, start=c(LonIdx[1],LatIdx[1],z,timeIdx[1]),count=c(length(LonIdx),length(LatIdx),1,length(timeIdx)))
data$Data <- ncvar_get( ncFile, varName, start=c(LonIdx[1],LatIdx[1],z,timeIdx[1]),count=c(length(LonIdx),length(LatIdx),1,length(timeIdx)), collapse_degen = F)
}
##WFF
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment