# HG changeset patch # User Stephen Skory # Date 1247003734 25200 # Branch hopwrap # Node ID 54205d1f072044c4b05d94adf8038a6a803b6573 # Parent f98006715223e4c372b49cc3743b6998fdc746cc Too much time in Fortran... diff -r f98006715223e4c372b49cc3743b6998fdc746cc -r 54205d1f072044c4b05d94adf8038a6a803b6573 yt/lagos/chainHOP/chainHOP.py --- a/yt/lagos/chainHOP/chainHOP.py Tue Jul 07 14:47:33 2009 -0700 +++ b/yt/lagos/chainHOP/chainHOP.py Tue Jul 07 14:55:34 2009 -0700 @@ -153,6 +153,8 @@ # if our neighbor is in the same chain, move on if part.chainID == self.NN[thisNN].chainID: continue # no introspection, nor our connected NN + # this is probably the same as above, but it's OK. Can be removed + # later. if thisNN==part.order_index or thisNN==part.densestNN: continue # if our neighbor is not part of a group, move on if self.NN[thisNN].chainID < 0: continue @@ -162,8 +164,9 @@ # themselves groups (dens>peakdens), link the chains. Chains # with both dens > peakdens are *only* linked if their boundary # dens > saddle. Otherwise they remain separate for all time. - if ((self.NN[thisNN].density + part.density) / 2.) >= (self.threshold * 2.5) and - part_dens >= (3*self.threshold) and thisNN_dens >= (3*self.threshold): + if ((self.NN[thisNN].density + part.density) / 2.) >= (self.threshold * 2.5) and \ + part_dens >= (3*self.threshold) and \ + thisNN_dens >= (3*self.threshold): # find out if either particle chainID has already been mapped group1 = self.reverse_map[part.chainID] group2 = self.reverse_map[self.NN[thisNN].chainID] @@ -209,6 +212,7 @@ # need to find the densest nearest neighbors, but here we're # finding the densest nearest neighbor chains. + # chains that haven't been linked to another chain increase the count # by themselves and change label. Also add to chain_connections for i in range(chain_count):