changeset 5:672621ab4db4

trim points we check to a circle per radius
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Tue, 25 May 2021 17:19:00 -0400
parents 56508a6033a9
children a01ff74f9fd7
files python/cluster.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/python/cluster.py	Tue May 25 14:01:26 2021 -0400
+++ b/python/cluster.py	Tue May 25 17:19:00 2021 -0400
@@ -29,15 +29,20 @@
     print(l,file=outfile)
     ff=PPAT.split(l)
     (nr,ox,oy,oz)=intsMaybe(ff)
+    home=(float(ox),float(oy),float(oz))
     et=ff[9]
     l=infile.readline().rstrip()
     print(l,file=outfile)
     (orad,ymin,ymax)=intsMaybe(PPAT.split(l))
-    print(nr,ox,oy,oz,et,orad,ymin,ymax)
     _=infile.readline()
     for l in infile:
       found=False
-      q=[float(i) for i in l.split('\t')[2].split(',')]
+      (_,td,qd)=l.rstrip().split('\t')
+      q=[float(i) for i in qd.split(',')]
+      td=float(td)
+      if td>orad:
+        # Enforce a circular region, not square
+        break
       for c in cc:
         for p in c:
           if d(p,q)<=n: