Figs: Figures

Description Usage Arguments Author(s) Examples

Description

Functions plotting the main figures in the paper

Usage

1
2
3
4
Fig1(path = "~/TRMM", pattern = "3B42_Daily", param = "precipitation", nx = 1440, ny = 400, a = 6378, x0 = 1)
Fig2()
Fig3(col=c('black',rgb(0.5,0.5,0.5,0.5),'red',rgb(0.5,0,0,0.5),rgb(0,0,0.5,0.5)))
Fig4()

Arguments

path
pattern
param
nx
ny
a
x0
col

colour scheme for the curves see plot.

Author(s)

Rasmus.Benestad-at-met.no

Examples

 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)
  }

brasmus/preciparea documentation built on May 7, 2019, 11:11 a.m.