Learn R Programming

calcWOI (version 1.0.3)

flatten: Reduces the boundary gradients

Description

This function smoothes the boundaries with a linear filter.

Usage

flatten(x, filter)

Arguments

x

2D array, which boundaries should be smoothed.

filter

The smoothing vector with increasing elements from 0...1. The length of the vector corresponds to the number of smoothed points at each side.

Value

Returns the incoming field with smoothed boundaries.

Examples

Run this code
# NOT RUN {
# Smooth outer 25 grid points
x <- array(10, dim = c(100, 200))
xflat <- flatten(x = x, filter = seq(0, 1, , 25))
par(mfrow = c(1, 2))
image(x, main = "Original")
image(xflat, main = "Smoothed Bound")
# }

Run the code above in your browser using DataLab