stripy
stripy copied to clipboard
Repeated call of sTriangulation freezes
Running this code seems to randomly hang after ~3000 iterations, and I have been unable to deduce why. Using quadrature points from here.
import time
import numpy as np
import stripy
def get_lebedev_quadrature(order=29):
phi, theta, weights = [], [], []
with open("lebedev_{:03d}.txt".format(order), "r") as f:
lines = f.readlines()
for line in lines:
ph, th, w = line.split()
phi.append(float(ph) * np.pi / 180 + np.pi)
theta.append(float(th) * np.pi / 180)
weights.append(float(w))
return np.asarray(phi), np.asarray(theta), np.asarray(weights)
if __name__ == "__main__":
phi, theta, weights = get_lebedev_quadrature(29)
for i in range(10000):
a = time.time()
tri = stripy.sTriangulation(lons=phi - np.pi, lats=-theta + np.pi / 2, permute=True)
b = time.time() - a
print(i, b)