Esempio n. 1
0
    def __init__(self, positions, values):

        valid = vectors.validity(np.vstack((positions, values)))

        x, y, z = positions

        self._baseField = np.median(values[:, valid], axis=1).reshape(3, 1)
        deviations = values - self._baseField

        u, v, w = values

        self.imp = NaturalNeighbourInterpolatorC(
            np.ascontiguousarray(x[valid]), np.ascontiguousarray(y[valid]),
            np.ascontiguousarray(z[valid]), np.ascontiguousarray(u[valid]),
            np.ascontiguousarray(v[valid]), np.ascontiguousarray(w[valid]))
Esempio n. 2
0
    def __init__(self, positions, values):

        valid = vectors.validity(np.vstack((positions,values)))

        x,y,z = positions

        self._baseField = np.median(values[:,valid], axis=1).reshape(3,1)
        deviations = values - self._baseField

        u,v,w = values

        self.imp = NaturalNeighbourInterpolatorC(
            np.ascontiguousarray(x[valid]),
            np.ascontiguousarray(y[valid]),
            np.ascontiguousarray(z[valid]),
            np.ascontiguousarray(u[valid]),
            np.ascontiguousarray(v[valid]),
            np.ascontiguousarray(w[valid]))
Esempio n. 3
0
 def _validity(self, y):
     return vectors.validity(y)
Esempio n. 4
0
 def __call__(self, position, t):
     valid = vectors.validity(position)
     result = np.empty_like(position)
     result[:, ~valid] = np.nan
     result[:, valid] = self.imp(*(list(position[:, valid])))
     return self._baseField + result
Esempio n. 5
0
 def __call__(self, position, t):
     valid = vectors.validity(position)
     result = np.empty_like(position)
     result[:,~valid] = np.nan
     result[:,valid] = self.imp(*(list(position[:,valid])))
     return self._baseField + result