resamp.bath:

Usage Arguments Examples

Usage

1
resamp.bath(sstL, bathy)

Arguments

sstL
bathy

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
##---- 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 (sstL, bathy) 
{
    require(raster)
    xmin = min(sstL$lon)
    xmax = max(sstL$lon)
    ymin = min(sstL$lat)
    ymax = max(sstL$lat)
    b2 = crop.grid(xmin, xmax, ymin, ymax, bathy)
    s = raster(nrow = nrow(sstL$sstL), ncol = ncol(sstL$sstL))
    bath2 = raster(ncol = ncol(b2[[3]]), nrow = nrow(b2[[3]]))
    bath2 = setValues(bath2, as.vector(t(b2[[3]])))
    s <- resample(bath2, s, method = "bilinear")
    extent(s) = extent(c(min(sstL$lon) - 360, max(sstL$lon) - 
        360, min(sstL$lat), max(sstL$lat)))
    bath2 = list(lon = sstL$lon - 360, lat = sstL$lat, data = matrix(s@data@values, 
        nrow = nrow(sstL$sstL), ncol = ncol(sstL$sstL), byrow = T))
    bath2
  }

galuardi/hmmwoa documentation built on May 16, 2019, 5:37 p.m.