Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: SDSS-V (astra) model spectra default loader #1203

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b6851a6
fix: mwmVisit BOSS HDU default loader fail
rileythai Oct 11, 2024
51e8a2e
fix: SDSS-V SpectrumList loader ambiguity + add: BOSS-only mwm test c…
rileythai Oct 12, 2024
4bee136
add: changelog -> CHANGES.rst
rileythai Oct 12, 2024
b70c393
fix: HDU unspecified print message
rileythai Oct 16, 2024
62747c4
feat: condense loaders into only SpectrumList of 1D flux
rileythai Oct 16, 2024
8df1f77
Merge branch 'mwmvisit-boss-fix' of github.com:rileythai/specutils-sd…
rileythai Oct 16, 2024
bafede9
chore: changelog update
rileythai Oct 16, 2024
122b368
revert: readd all Spectrum1D loaders and tests
rileythai Oct 18, 2024
0c5fe8f
feat: visit specification on mwmVisit load
rileythai Oct 18, 2024
32534a2
Merge branch 'mwmvisit-boss-fix' of github.com:rileythai/specutils-sd…
rileythai Oct 18, 2024
ca4d8c3
revert: completely rollback to initial case
rileythai Oct 19, 2024
62152c0
Merge branch 'main' into mwmvisit-boss-fix
rileythai Oct 26, 2024
65b5709
Merge branch 'mwmvisit-boss-fix' of github.com:rileythai/specutils-sd…
rileythai Oct 26, 2024
9960f98
fix: test cases
rileythai Oct 26, 2024
87fa13f
fix: split test cases for user warning + remove useless warning
rileythai Oct 26, 2024
a92868e
Merge branch 'mwmvisit-boss-fix' of github.com:rileythai/specutils-sd…
rileythai Oct 30, 2024
15dd4a2
add: astraStar/Visit model spectrum default loaders
rileythai Oct 30, 2024
7d78ccd
Merge branch 'mwmvisit-boss-fix' into add-astra-loader
rileythai Oct 30, 2024
c57544c
add: tests for astra default loaders
rileythai Oct 30, 2024
a570edd
Merge branch 'main' into add-astra-loader
rileythai Dec 6, 2024
3975f50
add: changelog
rileythai Dec 6, 2024
275daf0
amend: changelog
rileythai Dec 6, 2024
cc86b70
merge: 'main' into add-astra-loader
rileythai Feb 11, 2025
21a5baa
fix: formatting
rileythai Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: test cases
- fixed flux array length check so that the 2D mwm visits are checked properly
rileythai committed Oct 26, 2024
commit 9960f980022a308237a91b4b3a129d4d8655df1f
16 changes: 11 additions & 5 deletions specutils/io/default_loaders/tests/test_sdss_v.py
Original file line number Diff line number Diff line change
@@ -438,7 +438,7 @@ def spec_HDUList(n_spectra):
[
("mwm-temp", None, None, False, [0, 0, 1, 0], 1), # visit
("mwm-temp", 3, None, False, [0, 0, 1, 0], 1),
("mwm-temp", None, 2, False, [0, 1, 1, 0], 3), # multi-ext visits
("mwm-temp", None, 2, False, [0, 1, 1, 0], 2), # multi-ext visits
("mwm-temp", 2, 2, False, [0, 1, 1, 0], 3),
("mwm-temp", None, None, True, [0, 0, 1, 0], 1), # star
("mwm-temp", 3, None, True, [0, 0, 1, 0], 1),
@@ -463,7 +463,10 @@ def test_mwm_1d(file_obj, hdu, visit, with_wl, hduflags, nvisits):
raise ValueError(
"INSTRMNT tag in test HDU header is not set properly.")
assert len(data.spectral_axis.value) == length
assert len(data.flux.value) == length
assert data.flux.value.shape[-1] == length
if nvisits > 1:
assert data.flux.value.shape[0] == nvisits

assert data.spectral_axis.unit == Angstrom
assert data.flux.unit == Unit("1e-17 erg / (s cm2 Angstrom)")
os.remove(tmpfile)
@@ -485,8 +488,9 @@ def test_mwm_1d(file_obj, hdu, visit, with_wl, hduflags, nvisits):
def test_mwm_list(file_obj, with_wl, hduflags):
"""Test mwm SpectrumList loader"""
tmpfile = str(file_obj) + ".fits"
mwm_HDUList(hduflags, with_wl,
nvisits=1 if with_wl else 3).writeto(tmpfile, overwrite=True)
nvisits = 1 if with_wl else 3
mwm_HDUList(hduflags, with_wl, nvisits=nvisits).writeto(tmpfile,
overwrite=True)

data = SpectrumList.read(tmpfile)
assert isinstance(data, SpectrumList)
@@ -505,7 +509,9 @@ def test_mwm_list(file_obj, with_wl, hduflags):
else:
assert data[i].meta['datatype'].lower() == 'mwmvisit'
assert len(data[i].spectral_axis.value) == length
assert len(data[i].flux.value) == length
assert data[i].flux.value.shape[-1] == length
if nvisits > 1:
assert data[i].flux.value.shape[0] == nvisits
assert data[i].spectral_axis.unit == Angstrom
assert data[i].flux.unit == Unit("1e-17 erg / (s cm2 Angstrom)")
os.remove(tmpfile)