Description Usage Arguments Author(s) Examples
Functions plotting the main figures in the paper
1 2 3 4 |
path |
|
pattern |
|
param |
|
nx |
|
ny |
|
a |
|
x0 |
|
col |
colour scheme for the curves see |
Rasmus.Benestad-at-met.no
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (path = "~/TRMM", pattern = "3B42_Daily", varid = "precipitation",
nx = 1440, ny = 400, a = 6378, x0 = 0.1)
{
require(ncdf4)
fname <- list.files(path = path, pattern = pattern, full.names = TRUE)[1]
print(fname)
ncid <- nc_open(fname)
x <- ncvar_get(ncid, varid)
x <- t(x)
x[x < x0] <- NA
x[x >= x0] <- 1
dim(x) <- c(1, nx * ny)
tim <- ncatt_get(ncid, varid = 0, attname = "EndDate")
time <- tim$value
lon <- ncvar_get(ncid, "lon")
lat <- ncvar_get(ncid, "lat")
nc_close(ncid)
attr(x, "longitude") <- lon
attr(x, "latitude") <- lat
x <- as.field(zoo(x, order.by = time), lon = lon, lat = lat,
param = "precip", unit = "NA", src = "TRMM")
map(x, type = "fill", colbar = FALSE)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.