Exemplo n.º 1
0
def test_kymograph_collection(tmp_path):
    """test making kymographs for field collections"""
    # create some storage
    field = FieldCollection([
        ScalarField(UnitGrid(8), label="a"),
        ScalarField(UnitGrid(8), label="b")
    ])
    with get_memory_storage(field) as storage:
        for i in range(8):
            field.data = i
            storage.append(field, i)

    # create single kymograph
    path = tmp_path / "test1.png"
    plotting.plot_kymograph(storage,
                            field_index=1,
                            colorbar=True,
                            transpose=True,
                            filename=path)
    assert path.stat().st_size > 0

    # create multiple kymographs
    path = tmp_path / "test2.png"
    plotting.plot_kymographs(storage, filename=path)
    assert path.stat().st_size > 0
Exemplo n.º 2
0
def test_kymograph_single(tmp_path):
    """ test making kymographs for single fields """
    # create some storage
    field = ScalarField(UnitGrid(8))
    with get_memory_storage(field) as storage:
        for i in range(8):
            storage.append(field.copy(data=i), i)

    # create single kymograph
    path = tmp_path / "test1.png"
    plotting.plot_kymograph(storage,
                            colorbar=True,
                            transpose=True,
                            filename=path)
    assert path.stat().st_size > 0

    # create multiple kymographs
    path = tmp_path / "test2.png"
    plotting.plot_kymographs(storage, filename=path)
    assert path.stat().st_size > 0