astropy / specutils

An Astropy coordinated package for astronomical spectroscopy. Maintainers: @nmearl @rosteen @keflavich @eteq
http://specutils.readthedocs.io/en/latest/
161 stars 124 forks source link

Truncate in template_comparison by default rather than nan_fill #1121

Closed rosteen closed 4 months ago

rosteen commented 5 months ago

Implements the suggestion given in #653. One thing I changed here, which I'm not sure of, is that the returned template is now resampled onto the observed spectrum's spectral axis, in addition to being normalized as previous. Opening as draft since I still need to update the docs, and I'll probably need to add a bit more test coverage.

codecov[bot] commented 4 months ago

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (17a6f6b) 70.93% compared to head (727b4b7) 71.07%.

Files Patch % Lines
specutils/analysis/template_comparison.py 88.46% 3 Missing :warning:
specutils/manipulation/resample.py 92.30% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1121 +/- ## ========================================== + Coverage 70.93% 71.07% +0.14% ========================================== Files 61 61 Lines 4221 4249 +28 ========================================== + Hits 2994 3020 +26 - Misses 1227 1229 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rosteen commented 4 months ago

@camipacifici Thanks for the comment, I reverted back to returning the full template. I also fixed an existing bug in the redshifting so that it will now work on any unit of spectral axis (e.g., frequency), not just wavelengths.