Skip to content

pyfor.metrics

summarize_return_num(return_nums)

Gets the number of returns by return number.

Parameter Type Description
return_nums A numpy.ndarray of the return number of each point.

Returns: A pandas.Series of return number counts by return number.

summarize_percentiles(z, pct = all_pct)
Parameter Type Description
z A numpy.ndarray of z values.

pct_above_heightbreak(grid, r = 0, heightbreak = 'mean')

Calculates the percentage of first returns above the mean. This needs its own function because it summarizes multiple columns of the point cloud, and is therefore more complex than typical summarizations (i.e. percentiles). This returns a pyfor.rasterizer.Raster object.

Parameter Type Description
grid A pyfor.rasterizer.Grid object
r The return number to constrain to. Must be a positive integer. If r=0, all points will be considered (this is the default behavior).
heightbreak The height at which to summarize. If a number is given, this will be interpreted as the height at which points will be considered “above”. If the string “mean” is given (this is the default), will use the mean height of that cell, for example, to construct the “pct_above_mean” metric.

grid_percentile(grid, percentile)

Calculates a percentile raster.

Parameter Type Description
percentile The percentile (a number between 0 and 100) to compute.

z_max(grid)

Calculates maximum z value.

z_min(grid)

Calculates minimum z value.

z_std(grid)

Calculates standard deviation of z value.

z_var(grid)

Calculates variance of z value.

z_mean(grid)

Calculates mean of z value.

z_iqr(grid)

Calculates interquartile range of z value.

vol_cov(grid, r, heightbreak)

Calculates the volume covariate (percentage first returns above two meters times mean z)

z_mean_sq(grid)

Calculates the square of the mean z value.

canopy_relief_ratio(grid, mean_z_arr, min_z_arr, max_z_arr)

return_num(grid, num)

Compute the number of returns that match num for a grid object

all_returns(grid)

total_returns(grid)

standard_metrics_grid(grid, heightbreak)

standard_metrics_cloud(points, heightbreak)