Exemplo n.º 1
0
def test_pick_analysis_via_api_3_3d_ds_fail_4(lt_ctx, TYPE):
    data = _mk_random(size=(16, 16, 16, 16, 16, 16))
    dataset = MemoryDataSet(data=data,
                            tileshape=(1, 16, 16),
                            num_partitions=2,
                            sig_dims=2)

    analysis = PickFrameAnalysis(dataset=dataset, parameters={})
    analysis.TYPE = TYPE
    with pytest.raises(ValueError):
        lt_ctx.run(analysis)

    analysis = PickFrameAnalysis(dataset=dataset, parameters={"x": 7})
    analysis.TYPE = TYPE
    with pytest.raises(ValueError):
        lt_ctx.run(analysis)

    analysis = PickFrameAnalysis(dataset=dataset, parameters={"x": 7, "y": 8})
    analysis.TYPE = TYPE
    with pytest.raises(ValueError):
        lt_ctx.run(analysis)

    analysis = PickFrameAnalysis(dataset=dataset,
                                 parameters={
                                     "x": 7,
                                     "y": 8,
                                     "z": 11
                                 })
    analysis.TYPE = TYPE
    with pytest.raises(ValueError):
        lt_ctx.run(analysis)
Exemplo n.º 2
0
def test_pick_analysis(default_k2is, lt_ctx, TYPE):
    analysis = PickFrameAnalysis(dataset=default_k2is,
                                 parameters={
                                     "x": 16,
                                     "y": 16
                                 })
    analysis.TYPE = TYPE
    results = lt_ctx.run(analysis)
    assert results[0].raw_data.shape == (1860, 2048)
Exemplo n.º 3
0
def test_pick_analysis(default_empad, lt_ctx, TYPE):
    analysis = PickFrameAnalysis(dataset=default_empad,
                                 parameters={
                                     "x": 2,
                                     "y": 2
                                 })
    analysis.TYPE = TYPE
    results = lt_ctx.run(analysis)
    assert results[0].raw_data.shape == (128, 128)
    assert np.count_nonzero(results[0].raw_data) > 0
Exemplo n.º 4
0
def test_pick_from_3d_ds(lt_ctx, TYPE):
    data = _mk_random(size=(16 * 16, 16, 16))
    dataset = MemoryDataSet(data=data,
                            tileshape=(1, 16, 16),
                            num_partitions=2,
                            sig_dims=2)

    analysis = PickFrameAnalysis(dataset=dataset, parameters={"x": 5})
    analysis.TYPE = TYPE
    result = lt_ctx.run(analysis)

    assert result.intensity.raw_data.shape == (16, 16)
    assert np.allclose(result.intensity.raw_data, data[5])
Exemplo n.º 5
0
def test_pick_analysis(lt_ctx, TYPE):
    """
    the other tests cover the pick job, this one uses the analysis
    """
    data = _mk_random(size=(16, 16, 16, 16))
    dataset = MemoryDataSet(data=data,
                            tileshape=(1, 16, 16),
                            num_partitions=2,
                            sig_dims=2)

    analysis = PickFrameAnalysis(dataset=dataset, parameters={"x": 5, "y": 5})
    analysis.TYPE = TYPE
    result = lt_ctx.run(analysis)

    assert result.intensity.raw_data.shape == (16, 16)
    assert np.allclose(result.intensity.raw_data, data[5, 5])