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

return the correct number of rows in exp_fibermap when specifying targetids to read_spectra #2126

Merged
merged 2 commits into from Oct 9, 2023

Conversation

moustakas
Copy link
Member

Fixes #2125. No unit tests added yet, because my solution is a bit of a hack, if someone passes the rows argument.

@sbailey @dirkscholte

@moustakas moustakas requested a review from sbailey October 9, 2023 11:33
@moustakas
Copy link
Member Author

Unit tests are failing because my code changes assume that EXP_FIBERMAP always exists, which it does not in these tests. I can make the necessary changes, but some feedback regarding what behavior we want would be helpful first.

@sbailey
Copy link
Contributor

sbailey commented Oct 9, 2023

Argh, good catch and thanks for the fix. Apologies for bug. As my penance, I have added a test that would have caught it in the first place, and re-added support for read_spectra on non-coadded files that don't have EXP_FIBERMAP.

i.e. uncoadded spectra do not have an EXP_FIBERMAP HDU (it is optional), while coadded spectra do have it, and read_spectra should work with both.

@moustakas if tests pass and you are satisfied with my updates to this PR, we can merge.

@moustakas
Copy link
Member Author

Excellent, @sbailey, thank you. I tested it on my specific case (which were custom coadds) and it works as expected. Thanks especially for the unit test---I struggle to write good tests but always learn from reading yours!

@moustakas moustakas merged commit 0a968c9 into main Oct 9, 2023
24 checks passed
@moustakas moustakas deleted the fix-2125 branch October 9, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

read_spectra with subset of targetids returns an incomplete exp_fibermap
2 participants