Skip to content

Repeated call of sTriangulation freezes #85

@kitchenknif

Description

@kitchenknif

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)

lebedev_029.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions