1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
import pytest
from packaging.version import Version, parse
from .test_spectral_cube import cube_and_raw
@pytest.mark.openfiles_ignore
def test_projvis(data_vda_jybeam_lower, use_dask):
pytest.importorskip('matplotlib')
cube, data = cube_and_raw(data_vda_jybeam_lower, use_dask=use_dask)
mom0 = cube.moment0()
mom0.quicklook(use_aplpy=False)
def test_proj_imshow(data_vda_jybeam_lower, use_dask):
plt = pytest.importorskip('matplotlib.pyplot')
cube, data = cube_and_raw(data_vda_jybeam_lower, use_dask=use_dask)
mom0 = cube.moment0()
if parse(plt.matplotlib.__version__) < Version('2.1'):
# imshow is now only compatible with more recent versions of matplotlib
# (apparently 2.0.2 was still incompatible)
plt.imshow(mom0.value)
else:
plt.imshow(mom0)
@pytest.mark.openfiles_ignore
def test_projvis_aplpy(tmp_path, data_vda_jybeam_lower, use_dask):
pytest.importorskip('aplpy')
cube, data = cube_and_raw(data_vda_jybeam_lower, use_dask=use_dask)
mom0 = cube.moment0()
mom0.quicklook(use_aplpy=True, filename=tmp_path / 'test.png')
def test_mask_quicklook(data_vda_jybeam_lower, use_dask):
pytest.importorskip('aplpy')
cube, data = cube_and_raw(data_vda_jybeam_lower, use_dask=use_dask)
cube.mask.quicklook(view=(0, slice(None), slice(None)), use_aplpy=True)
@pytest.mark.openfiles_ignore
def test_to_glue(data_vda_jybeam_lower, use_dask):
pytest.importorskip('glue')
cube, data = cube_and_raw(data_vda_jybeam_lower, use_dask=use_dask)
cube.to_glue(start_gui=False)
@pytest.mark.openfiles_ignore
def test_to_pvextractor(data_vda_jybeam_lower, use_dask):
pytest.importorskip('pvextractor')
cube, data = cube_and_raw(data_vda_jybeam_lower, use_dask=use_dask)
cube.to_pvextractor()
|