https://github.com/ZC119/persistence-rank-function
Raw File
Tip revision: 305e2edc38a87a41d565d168a8884a8b4829bc0b authored by zc119 on 09 May 2020, 14:56:38 UTC
add figure
Tip revision: 305e2ed
BC_compute.py
import os
from ripser import Rips
import numpy as np
import sys

sourcepath = str(sys.argv[1])
targetpath = str(sys.argv[2])
files = sorted(os.listdir(sourcepath))
rips = Rips()

for file in files:
    filepath = os.path.join(sourcepath,file)
    data = np.loadtxt(filepath)
    dgm = rips.fit_transform(data)
    np.savetxt(targetpath+'/'+file,np.array(dgm[1]),fmt='%s')
back to top