further cleanup

This commit is contained in:
2018-10-17 15:42:23 +02:00
parent de93205e64
commit 18521d9191
3 changed files with 296 additions and 240 deletions

View File

@@ -314,14 +314,19 @@ class ShapePath(MotionBase):
if fnRec:
np.savez_compressed(fnRec, rec=rec, pts=pts, meta=self.meta)
def sort_points(self,xy=False):
def sort_points(self,xy=False,grp_sz=None):
pts=self.points
verb=self.verbose
cnt=pts.shape[0]
idx=np.ndarray(cnt,dtype=np.int32)
grp_cnt=int(np.sqrt(cnt))
grp_sz=int(np.ceil(float(cnt)/grp_cnt))
if grp_sz is None:
grp_cnt=int(np.sqrt(cnt))
grp_sz=int(np.ceil(float(cnt)/grp_cnt))
else:
grp_sz=int(grp_sz)
grp_cnt=int(np.ceil(float(cnt)/grp_sz))
if xy==True:
idxA=1;idxB=0
else:
@@ -418,9 +423,14 @@ if __name__=='__main__':
comm = PPComm(host=args.host)
gather = Gather(comm)
sp = ShapePath(comm, gather, args.verbose)
sp.setup_coord_trf()
#sp.setup_coord_trf()
fn='/tmp/shapepath'
#sp.points=np.zeros((2,2))
#sp.meta={'timebase':.2}
#sp.gather_upload(fnRec=fn+'.npz')
#sp.plot_gather()
#return
xy=False
# fn='/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/data/'+time.strftime('%y-%m-%d-%H_%M_%S')