pyfor.metrics
Functions
Section titled “Functions”summarize_return_num
Section titled “summarize_return_num”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
Section titled “summarize_percentiles”summarize_percentiles(z, pct = all_pct)| Parameter | Type | Description |
|---|---|---|
z |
A numpy.ndarray of z values. |
pct_above_heightbreak
Section titled “pct_above_heightbreak”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
Section titled “grid_percentile”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
Section titled “z_mean”z_mean(grid)Calculates mean of z value.
z_iqr(grid)Calculates interquartile range of z value.
vol_cov
Section titled “vol_cov”vol_cov(grid, r, heightbreak)Calculates the volume covariate (percentage first returns above two meters times mean z)
z_mean_sq
Section titled “z_mean_sq”z_mean_sq(grid)Calculates the square of the mean z value.
canopy_relief_ratio
Section titled “canopy_relief_ratio”canopy_relief_ratio(grid, mean_z_arr, min_z_arr, max_z_arr)return_num
Section titled “return_num”return_num(grid, num)Compute the number of returns that match num for a grid object
all_returns
Section titled “all_returns”all_returns(grid)total_returns
Section titled “total_returns”total_returns(grid)standard_metrics_grid
Section titled “standard_metrics_grid”standard_metrics_grid(grid, heightbreak)standard_metrics_cloud
Section titled “standard_metrics_cloud”standard_metrics_cloud(points, heightbreak)