Пример #1
0
def test_smoke(lt_ctx):
    """
    just check if the analysis runs without throwing exceptions:
    """
    data = np.zeros([3 * 3, 8, 8]).astype(np.float32)
    dataset = MemoryDataSet(data=data,
                            tileshape=(1, 8, 8),
                            num_partitions=2,
                            sig_dims=2)
    result = FEM.run_fem(ctx=lt_ctx,
                         dataset=dataset,
                         center=(1, 1),
                         rad_in=0,
                         rad_out=1)
    assert np.allclose(result['intensity'].data, np.zeros(data.shape[0]))
Пример #2
0
def test_different_size(lt_ctx):
    """
    just check if the analysis runs without throwing exceptions:
    """
    data = np.zeros([3 * 3, 3, 3]).astype(np.float32) + [[0, 1, 0], [3, 0, 3],
                                                         [0, 1, 0]]
    data[8] = data[8] + [[0, 0, 0], [0, 0, 0], [0, 0, 9]]
    dataset = MemoryDataSet(data=data,
                            tileshape=(1, 3, 3),
                            num_partitions=2,
                            sig_dims=2)
    result = FEM.run_fem(ctx=lt_ctx,
                         dataset=dataset,
                         center=(1, 1),
                         rad_in=0,
                         rad_out=1)
    assert np.allclose(result['intensity'].data, np.ones(data.shape[0]))
Пример #3
0
 def get_udf(self):
     center = (self.parameters["cy"], self.parameters["cx"])
     rad_in = self.parameters["ri"]
     rad_out = self.parameters["ro"]
     return FEM.FEMUDF(center=center, rad_in=rad_in, rad_out=rad_out)