def comm_sep(self, plot_locs, criteria, loc_unit=None):
<EOL>sad_dict = {}<EOL>for plot in list(plot_locs.keys()):<EOL><INDENT>for crit_key in list(criteria.keys()):<EOL><INDENT>if criteria[crit_key] == '<STR_LIT:count>':<EOL><INDENT>criteria.pop(crit_key, None)<EOL><DEDENT><DEDENT>criteria[plot] = '<STR_LIT:count>'<EOL>sad_return = self.sad(criteria, clean=True)<EOL>if len(sad_return) > <NUM_LIT:1>:<EOL><INDENT>raise NotImplementedError('<STR_LIT>')<EOL><DEDENT>sad_dict[plot] = sad_return[<NUM_LIT:0>][<NUM_LIT:2>]<EOL><DEDENT>n_pairs = np.sum(np.arange(len(list(plot_locs.keys()))))<EOL>result = np.recarray((n_pairs,), dtype=[('<STR_LIT>','<STR_LIT>'),<EOL>('<STR_LIT>', '<STR_LIT>'),<EOL>('<STR_LIT>', int),<EOL>('<STR_LIT>', int),<EOL>('<STR_LIT>', float),<EOL>('<STR_LIT>', float),<EOL>('<STR_LIT>', float)])<EOL>row = <NUM_LIT:0><EOL>for pair in itertools.combinations(list(plot_locs.keys()), <NUM_LIT:2>):<EOL><INDENT>plota = pair[<NUM_LIT:0>]<EOL>plotb = pair[<NUM_LIT:1>]<EOL>result[row]['<STR_LIT>'] = plota<EOL>result[row]['<STR_LIT>'] = plotb<EOL>if loc_unit == '<STR_LIT>':<EOL><INDENT>result[row]['<STR_LIT>'] = _decdeg_distance(plot_locs[plota],<EOL>plot_locs[plotb])<EOL><DEDENT>else:<EOL><INDENT>result[row]['<STR_LIT>'] = _distance(plot_locs[plota],<EOL>plot_locs[plotb])<EOL><DEDENT>spp_a = len(sad_dict[plota])<EOL>spp_b = len(sad_dict[plotb])<EOL>result[row]['<STR_LIT>'] = spp_a<EOL>result[row]['<STR_LIT>'] = spp_b<EOL>intersect = set(sad_dict[plota]).intersection(sad_dict[plotb])<EOL>union = set(sad_dict[plota]).union(sad_dict[plotb])<EOL>if spp_a + spp_b == <NUM_LIT:0>:<EOL><INDENT>result[row]['<STR_LIT>'] = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>result[row]['<STR_LIT>'] = (<NUM_LIT:2>*len(intersect)) / (spp_a+spp_b)<EOL><DEDENT>if len(union) == <NUM_LIT:0>:<EOL><INDENT>result[row]['<STR_LIT>'] = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>result[row]['<STR_LIT>'] = len(intersect) / len(union)<EOL><DEDENT>row += <NUM_LIT:1><EOL><DEDENT>return result<EOL>
Calculates commonality (Sorensen and Jaccard) between pairs of plots.

Parameters
----------
plot_locs : dict
    Dictionary with keys equal to each plot name, which must be
    represented by a column in the data table, and values equal to a
    tuple of the x and y coordinate of each plot
criteria : dict
    See docstring for Patch.sad.
loc_unit : str
    Unit of plot locations. Special cases include 'decdeg' (decimal
    degrees), returns result in km. Otherwise ignored.

Returns
-------
result: structured array
    Returns a structured array with fields plot-a and plot-b (names of
    two plots), dist (distance between plots), and sorensen and jaccard
    (similarity indices). Has row for each unique pair of plots.