def test_pansharpen_worker_half_window(test_pansharp_data):
    open_files, pan_window, _, g_args = test_pansharp_data
    pan = open_files[0].read(1, window=pan_window).astype(np.float32)
    g_args.update(half_window=True)
    pan_output = _pansharpen_worker(open_files, pan_window, _, g_args)
    assert pan_output.shape == (4, pan.shape[0], pan.shape[1])
def test_pansharpen_worker_uint8(test_pansharp_data):
    open_files, pan_window, _, g_args = test_pansharp_data
    g_args.update(dst_dtype=np.__dict__['uint8'])
    pan_output = _pansharpen_worker(open_files, pan_window, _, g_args)
    assert pan_output.dtype == np.uint8
    assert np.max(pan_output) <= 2**8
def test_pansharpen_worker_uint16(test_pansharp_data):
    open_files, pan_window, _, g_args = test_pansharp_data
    pan_output = _pansharpen_worker(open_files, pan_window, _, g_args)
    assert pan_output.dtype == np.uint16
    assert np.max(pan_output) <= 2**16
    assert np.max(pan_output) >= 2**8
def test_pansharpen_worker_uint8(test_pansharp_data):
    open_files, pan_window, _, g_args = test_pansharp_data
    g_args.update(dst_dtype=np.__dict__['uint8'])
    pan_output = _pansharpen_worker(open_files, pan_window, _, g_args)
    assert pan_output.dtype == np.uint8
    assert np.max(pan_output) <= 2**8
def test_pansharpen_worker_uint16(test_pansharp_data):
    open_files, pan_window, _, g_args = test_pansharp_data
    pan_output = _pansharpen_worker(open_files, pan_window, _, g_args)
    assert pan_output.dtype == np.uint16
    assert np.max(pan_output) <= 2**16
    assert np.max(pan_output) >= 2**8
def test_pansharpen_worker_half_window(test_pansharp_data):
    open_files, pan_window, _, g_args = test_pansharp_data
    pan = open_files[0].read(1, window=pan_window).astype(np.float32)
    g_args.update(half_window=True)
    pan_output = _pansharpen_worker(open_files, pan_window, _, g_args)
    assert pan_output.shape == (4, pan.shape[0], pan.shape[1])