Exemplo n.º 1
0
def test_spectral_cube_io_4d():
    # As above, when original data was 4D with a 1-element Stokes axis
    from glue_astronomy.io.spectral_cube.spectral_cube import read_spectral_cube
    data = read_spectral_cube(
        os.path.join(os.path.dirname(__file__), '..', '..', 'io',
                     'spectral_cube', 'tests', 'data', 'cube_4d.fits'))
    assert isinstance(data.get_object(), SpectralCube)
Exemplo n.º 2
0
def test_reader_fits_4d_fullstokes():
    data = read_spectral_cube(
        get_pkg_data_filename('data/cube_4d_fullstokes.fits'))
    assert isinstance(data['STOKES I'], np.ndarray)
    assert isinstance(data['STOKES Q'], np.ndarray)
    assert isinstance(data['STOKES U'], np.ndarray)
    assert isinstance(data['STOKES V'], np.ndarray)
    assert data.shape == (2, 3, 4)
Exemplo n.º 3
0
def test_spectral_cube_io():
    # Make sure that when we use the spectral cube I/O from glue-astronomy,
    # glue knows to automatically give a SpectralCube
    from glue_astronomy.io.spectral_cube.spectral_cube import read_spectral_cube
    data = read_spectral_cube(
        os.path.join(os.path.dirname(__file__), '..', '..', 'io',
                     'spectral_cube', 'tests', 'data', 'cube_3d.image'))
    assert isinstance(data.get_object(), SpectralCube)
Exemplo n.º 4
0
def test_reader_casa():
    from dask import array as dask_array
    data = read_spectral_cube(get_pkg_data_path('data/cube_3d.image'))
    assert isinstance(data['STOKES I'], dask_array.Array)
    assert data.shape == (2, 3, 4)