def test_run():
    df = gpd.read_file(data_path)
    plot = df.plotID.unique()[0]
    prepare_field_data.run(plot=plot,
                           df=df,
                           rgb_pool=rgb_pool,
                           savedir=tempfile.TemporaryDirectory())
示例#2
0
def test_run():
    df = gpd.read_file(data_path)
    counter = prepare_field_data.run(
        df,
        rgb_pool=rgb_pool,
        hyperspectral_pool=hyperspectral_pool,
        extend_box=0,
        hyperspectral_savedir=hyperspectral_savedir,
        RGB_size=height,
        HSI_size=height,
    )

    #all have same length
    assert counter == df.shape[0]
def test_run():
    df = gpd.read_file(data_path)
    plot = df.plotID.unique()[0]
    counter = prepare_field_data.run(
        plot=plot,
        df = df,
        rgb_pool=rgb_pool,
        hyperspectral_pool=hyperspectral_pool,
        extend_HSI_box=0,
        extend_RGB_box=0,
        hyperspectral_savedir=hyperspectral_savedir
    ) 
    
    #all have same length
    assert len(counter) == 8
示例#4
0
def test_run():
    df = gpd.read_file(data_path)

    plot_crops, plot_labels, plot_box_index = prepare_field_data.run(
        plot=df.plotID[0],
        df=df,
        rgb_pool=rgb_pool,
        hyperspectral_pool=hyperspec_pool,
        sensor="rgb",
        extend_box=1,
        hyperspectral_savedir=hyperspectral_savedir)

    assert len(plot_labels) == df.shape[0]
    assert len(plot_crops) == df.shape[0]
    assert len(plot_box_index) == df.shape[0]

    #all indices should be unique
    assert len(np.unique(plot_box_index)) == 3
def test_run():
    df = gpd.read_file(data_path)

    plot_HSI_crops, plot_RGB_crops, plot_labels, plot_sites, plot_elevations, plot_box_index = prepare_field_data.run(
        plot=df.plotID[0],
        df=df,
        rgb_pool=rgb_pool,
        hyperspectral_pool=hyperspectral_pool,
        extend_box=1,
        hyperspectral_savedir=hyperspectral_savedir)

    #all have same length
    lists = [
        plot_HSI_crops, plot_RGB_crops, plot_labels, plot_sites,
        plot_elevations, plot_box_index
    ]
    assert len({len(i) for i in lists}) == 1