-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test metadata loading in all the viz
- Loading branch information
Showing
9 changed files
with
151 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import pytest | ||
from asdf.asdf import AsdfWarning | ||
from astropy.utils.data import download_file | ||
|
||
from jdaviz.utils import PRIHDR_KEY | ||
|
||
|
||
@pytest.mark.remote_data | ||
def test_2d_parser(specviz2d_helper): | ||
fn = download_file('https://stsci.box.com/shared/static/exnkul627fcuhy5akf2gswytud5tazmw.fits', cache=True) # noqa | ||
|
||
with pytest.warns(AsdfWarning, match='jwextension'): | ||
specviz2d_helper.load_data(spectrum_2d=fn) | ||
assert len(specviz2d_helper.app.data_collection) == 2 | ||
|
||
dc_0 = specviz2d_helper.app.data_collection[0] | ||
assert dc_0.label == 'Spectrum 2D' | ||
assert PRIHDR_KEY not in dc_0.meta | ||
assert 'header' not in dc_0.meta | ||
assert dc_0.meta['DETECTOR'] == 'MIRIMAGE' | ||
|
||
dc_1 = specviz2d_helper.app.data_collection[1] | ||
assert dc_1.label == 'Spectrum 1D' | ||
assert 'header' not in dc_1.meta | ||
assert dc_1.meta['NAXIS'] == 2 | ||
|
||
|
||
def test_1d_parser(specviz2d_helper, spectrum1d): | ||
specviz2d_helper.load_data(spectrum_1d=spectrum1d) | ||
assert len(specviz2d_helper.app.data_collection) == 1 | ||
dc_0 = specviz2d_helper.app.data_collection[0] | ||
assert dc_0.label == 'Spectrum 1D' | ||
assert dc_0.meta['uncertainty_type'] == 'std' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.