cmp_spatial#

cmp_spatial(sids1, sids2, flatten=True)#

Performs an n by m containment test between two sets of sids.

A containment test is performed between each sid of sids1 and each sid of sids2. For each pair {-1,0,1} is returned depending on which, if either, element contains the other.

Parameters:
sids1: 1D array-like

first set of SIDs

sids2: 1D array-like

second set of SIDs

flatten: bool

if true, flatten the results. If false, return an array of size [len(sids1), len(sids2)]

Returns:
cmp: numpy array. If flatten is True, 1D, otherwise 2D.

Spatial containment. -1 if sid1 is contained in sid2, 1 if sid2 is contained in sid1 and 0 otherwise.