pyfor.metrics module

pyfor.metrics.all_returns(grid)
pyfor.metrics.canopy_relief_ratio(grid, mean_z_arr, min_z_arr, max_z_arr)
pyfor.metrics.grid_percentile(grid, percentile)

Calculates a percentile raster. :param percentile: The percentile (a number between 0 and 100) to compute.

pyfor.metrics.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.

Parameters
  • 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). :param 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.

pyfor.metrics.return_num(grid, num)

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

pyfor.metrics.standard_metrics_cloud(points, heightbreak)
pyfor.metrics.standard_metrics_grid(grid, heightbreak)
pyfor.metrics.summarize_percentiles(z, pct=(1, 5, 10, 20, 25, 30, 40, 50, 60, 70, 75, 80, 90, 95, 99))
Parameters

z – A pandas.Series of z values.

pyfor.metrics.summarize_return_num(return_nums)

Gets the number of returns by return number.

Parameters

return_nums – A pandas.Series of return number that describes the return number of each point.

Returns

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

pyfor.metrics.total_returns(grid)
pyfor.metrics.vol_cov(grid, r, heightbreak)

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

pyfor.metrics.z_iqr(grid)

Calculates interquartile range of z value.

pyfor.metrics.z_max(grid)

Calculates maximum z value.

pyfor.metrics.z_mean(grid)

Calculates mean of z value.

pyfor.metrics.z_mean_sq(grid)

Calculates the square of the mean z value.

pyfor.metrics.z_min(grid)

Calculates minimum z value.

pyfor.metrics.z_std(grid)

Calculates standard deviation of z value.

pyfor.metrics.z_var(grid)

Calculates variance of z value.