Apply a function to each pixel of (2,3)D array, passing fit parameters as reference

apply_dist_to_array(dist, obs, fn, when.dist.undefined = NA)

Arguments

dist

a (2,3)D array of distribution fit parameters

obs

a (2,3)D array of observation parameters

fn

A function to apply the distribution to the observations, when the distribution is defined. Should have signature function(values, dist_params). The function should return a vector of the same length for all pixels.

when.dist.undefined

A value to use when the distribution is undefined. Length must match the return value of fn.

Value

a (2,3)D array of values returned by fn