pointpats.PointPattern

class pointpats.PointPattern(points, window=None, names=None, coord_names=None)[source]

Planar Point Pattern Class 2-D.

Parameters
points: array

(n,p), n points with p >= 2 attributes on each point. Two attributes must comprise the spatial coordinate pair. Default is that the first two attributes are the x and y spatial coordinates.

window: :class:`.Window`

Bounding geometric object for the point pattern. If not specified, window will be set to the minimum bounding rectangle of the point pattern.

names: list

The names of the attributes.

coord_names: list

The names of the attributes defining the two spatial coordinates.

Examples

>>> from pointpats import PointPattern
>>> points = [[66.22, 32.54], [22.52, 22.39], [31.01, 81.21],
...           [9.47, 31.02], [30.78, 60.10], [75.21, 58.93],
...           [79.26,  7.68], [8.23, 39.93], [98.73, 77.17],
...           [89.78, 42.53], [65.19, 92.08], [54.46, 8.48]]
>>> pp = PointPattern(points)
>>> pp.n
12
>>> pp.mean_nnd
21.612139802089246
>>> pp.lambda_mbb
0.0015710507711240867
>>> pp.lambda_hull
0.0022667153468973137
>>> pp.hull_area
5294.00395
>>> pp.mbb_area
7638.200000000001
Attributes
hull

Points defining convex hull in counterclockwise order

hull_area

Area of convex hull

lambda_hull

Intensity based on convex hull

lambda_mbb

Intensity based on minimum bounding box

lambda_window

Intensity estimate based on area of window

max_nnd

Max nearest neighbor distance

mbb

Minimum bounding box

mbb_area

Area of minimum bounding box

mean_nnd

Mean nearest neighbor distance

min_nnd

Min nearest neighbor distance

n

Number of points

nnd

Nearest neighbor distances

tree
window

Bounding geometry for the point pattern

Methods

explode(self, mark)

Explode a marked point pattern into a sequence of individual point patterns.

find_pairs(self, r)

Find all pairs of points in the pattern that are within r units of each other

flip_coordinates(self)

Flips the coordinates of a point pattern.

get_window(self)

Bounding geometry for the point pattern

knn(self[, k])

Find k nearest neighbors for each point in the pattern

knn_other(self, other[, k])

Find k nearest neighbors in the pattern for each point in other

plot(self[, window, title, hull, get_ax])

Plot function for a point pattern.

summary(self)

Description of the point pattern.

superimpose(self, point_pattern)

Returns a superimposed point pattern.

unique(self)

Remove duplicate points in the point pattern.

add_marks

set_window

__init__(self, points, window=None, names=None, coord_names=None)[source]

Initialize self. See help(type(self)) for accurate signature.