# Path: tests/data.py



import numpy as np
import blimpy as bl
from tests.data import voyager_raw, voyager_block1
    from blimpy.rawhdr import cmd_tool
    _, data_block_x1, data_block_y1 = gr.read_next_data_block_int8()
    _, data_block_x2, data_block_y2 = gr.read_next_data_block_int8()

    assert not np.array_equal(data_block_x1, data_block_x2) \
        and not np.array_equal(data_block_y1, data_block_y2) \
        , "test_guppi: Data read from two blocks should not be equal"

    gr = bl.guppi.GuppiRaw(voyager_raw)
    _, data_block_1 = gr.read_next_data_block()

    data_block_reference_1 = np.load(voyager_block1)

    assert np.array_equal(data_block_1[:, :1000, :], data_block_reference_1) \
        , "test_guppi: Data read should be consistent with previous versions"

    data_block_casted_1 = np.append(data_block_x1,
                                    data_block_y1, axis=2).astype('float32').view('complex64')

    assert np.array_equal(data_block_1, data_block_casted_1) \
        , "test_guppi: Reading as int8 then casting should be equal to reading directly as complex64"

# We have to keep instantiating objects because
# the plotting routines read data in a manner
# destructive to the object.

def test_spectrum():
    gr = bl.guppi.GuppiRaw(voyager_raw)
    gr.plot_spectrum(flag_show=False)

def test_histogram():

# Path: tests/data.py



# Path: tests/test_guppi.py
import numpy as np
import blimpy as bl
from tests.data import voyager_raw, voyager_block1
    from blimpy.rawhdr import cmd_tool

    _, data_block_x1, data_block_y1 = gr.read_next_data_block_int8()
    _, data_block_x2, data_block_y2 = gr.read_next_data_block_int8()

    assert not np.array_equal(data_block_x1, data_block_x2) \
        and not np.array_equal(data_block_y1, data_block_y2) \
        , "test_guppi: Data read from two blocks should not be equal"

    gr = bl.guppi.GuppiRaw(voyager_raw)
    _, data_block_1 = gr.read_next_data_block()

    data_block_reference_1 = np.load(voyager_block1)

    assert np.array_equal(data_block_1[:, :1000, :], data_block_reference_1) \
        , "test_guppi: Data read should be consistent with previous versions"

    data_block_casted_1 = np.append(data_block_x1,
                                    data_block_y1, axis=2).astype('float32').view('complex64')

    assert np.array_equal(data_block_1, data_block_casted_1) \
        , "test_guppi: Reading as int8 then casting should be equal to reading directly as complex64"

# We have to keep instantiating objects because
# the plotting routines read data in a manner
# destructive to the object.

def test_spectrum():
    gr = bl.guppi.GuppiRaw(voyager_raw)
    gr.plot_spectrum(flag_show=False)

def test_histogram():

    gr = bl.guppi.GuppiRaw(voyager_raw)