예제 #1
0
def test_time_series():
    image = gen_test.generate_test_image(hspy=True)
    image2 = gen_test.generate_test_image(hspy=True)
    images = [image, image2]
    mask = gen_test.generate_test_image(hspy=False)
    mask2 = gen_test.generate_test_image(hspy=False)
    masks = [mask, mask2]

    params = PAnalysis.parameters()
    params.generate(store_im=True)

    p_list = PAnalysis.ParticleAnalysisSeries(images, params)

    t = PAnalysis.timeseriesanalysis(p_list)

    nptest.assert_almost_equal(t['area'][:1][0], 20069.0)
예제 #2
0
def test_series():
    image = gen_test.generate_test_image(hspy=True)
    image2 = gen_test.generate_test_image(hspy=True)
    images = [image, image2]
    mask = gen_test.generate_test_image(hspy=False)
    mask2 = gen_test.generate_test_image(hspy=False)
    masks = [mask, mask2]

    params = PAnalysis.parameters()
    params.generate(store_im=True)

    p_list = PAnalysis.ParticleAnalysisSeries(images, params)

    p = p_list.list[0]

    nptest.assert_almost_equal(p.properties['area']['value'], 20069.0)
    assert p.properties['area']['units'] == 'nm^2'
    nptest.assert_almost_equal(p.properties['circularity']['value'],
                               0.9095832157785668)
    nptest.assert_allclose(p.mask, mask)
    nptest.assert_allclose(p.image.data, image.data[16:184, 16:184])
    nptest.assert_allclose(p.properties['x']['value'], 100.)
    nptest.assert_allclose(p.properties['y']['value'], 100.)
    assert p.properties['frame']['value'] == 0