flatten: Reduces the boundary gradients

Description Usage Arguments Value Author(s) Examples

View source: R/flatten.R

Description

This function smoothes the boundaries with a linear filter.

Usage

1

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.

Author(s)

Florian Kapp

Examples

1
2
3
4
5
6
# 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")

calcWOI documentation built on March 31, 2020, 5:21 p.m.