Ejemplo n.º 1
0
def sums_length(dname,type='64'):
        for root, dirs, files in os.walk(dname):
            if root.endswith(type):                    
                for file in files:
                    if file.endswith('_warp.dpy'):       
                        fname=os.path.join(root,file)                    
                        dpr=Dpy(fname,'r')
                        sum=0
                        for i in range(dpr.track_no):
                            sum+=length(dpr.read_track())
                        dpr.close()
                        print fname, sum               
Ejemplo n.º 2
0
def generate_lengths():
    for root, dirs, files in os.walk(dname):          
                for file in files:
                    if file.endswith('_warp.dpy'):       
                        fname=os.path.join(root,file)                    
                        dpr=Dpy(fname,'r')
                        lengths=np.zeros((dpr.track_no,))
                        for i in range(dpr.track_no):
                            lengths[i]=length(dpr.read_track())
                        dpr.close()
                        fname2=fname.split('_warp.dpy')[0]+'_warp_lengths.npy'
                        print fname2
                        np.save(fname2,lengths)