Пример #1
0
def test_detect():
    params = K2ISDataSet.detect_params(K2IS_TESTDATA_PATH,
                                       InlineJobExecutor())["parameters"]
    assert params == {
        "path": K2IS_TESTDATA_PATH,
        "nav_shape": (34, 35),
        "sig_shape": (1860, 2048),
        "sync_offset": 250
    }
Пример #2
0
def test_k2is_dist(dist_ctx):
    ds = K2ISDataSet(path=K2IS_TESTDATA_PATH)
    import glob
    print(dist_ctx.executor.run_function(lambda: os.listdir("/data/Capture52/")))
    print(dist_ctx.executor.run_function(lambda: list(sorted(glob.glob("/data/Capture52/*")))))
    ds = ds.initialize(dist_ctx.executor)
    roi = np.zeros(ds.shape.nav, dtype=bool)
    roi[0, 5] = 1
    roi[0, 17] = 1
    analysis = dist_ctx.create_sum_analysis(dataset=ds)
    results = dist_ctx.run(analysis, roi=roi)
    assert results[0].raw_data.shape == (1860, 2048)
Пример #3
0
def main(input_filename, output_filename, dtype):
    ds = K2ISDataSet(path=input_filename)
    ds.initialize()

    out_ds = np.memmap(output_filename, dtype=dtype, mode="w+",
                       shape=tuple(ds.raw_shape))

    num_parts = len(list(ds.get_partitions()))

    for p_idx, p in enumerate(ds.get_partitions()):
        for tile in p.get_tiles():
            out_ds[tile.tile_slice.get()] = tile.data.astype(dtype)
        print("partition %d/%d done" % (p_idx + 1, num_parts))
    print("done")
Пример #4
0
def test_detect():
    params = K2ISDataSet.detect_params(K2IS_TESTDATA_PATH)
    assert params == {
        "path": K2IS_TESTDATA_PATH,
    }
Пример #5
0
def default_k2is():
    ds = K2ISDataSet(path=K2IS_TESTDATA_PATH)
    ds.initialize()
    return ds
Пример #6
0
def test_detect():
    params = K2ISDataSet.detect_params(K2IS_TESTDATA_PATH,
                                       InlineJobExecutor())["parameters"]
    assert params == {
        "path": K2IS_TESTDATA_PATH,
    }
Пример #7
0
def default_k2is():
    ds = K2ISDataSet(path=K2IS_TESTDATA_PATH)
    ds.initialize(InlineJobExecutor())
    return ds