xrspatial.perlin.perlin

xrspatial.perlin.perlin(width: int, height: int, freq: tuple = (1, 1), seed: int = 5)xarray.core.dataarray.DataArray[source]

Generate perlin noise aggregate.

width: int

Width of output aggregate array.

height: int

Height of output aggregate array.

freq: tuple (default = (1,1))

(x, y) frequency multipliers.

seed: int (default = 5)

Seed for random number generator.

xarray.DataArray

2D array, of the same type as the input, of calculated perlin

noise values.

Algorithm References: - numba-ized from Paul Panzer example available here: #noqa

Imports >>> import numpy as np >>> import xarray as xr >>> from xrspatial import perlin

Generate Perlin Aggregate >>> print(perlin(5, 5)) <xarray.DataArray (y: 5, x: 5)> array([[0.38502038, 0.3235394 , 0.13230299, 0.02275815, 0.13502038],

[0.69650136, 0.6169794 , 0.34002832, 0.10065245, 0.10962136], [1. , 0.90777853, 0.55206348, 0.16047902, 0.01192 ], [1. , 0.92388163, 0.60956174, 0.21797728, 0. ], [0.69650136, 0.6604194 , 0.50362745, 0.29227467, 0.15306136]])

Dimensions without coordinates: y, x .. attribute:: res

1