-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Truncate in template_comparison by default rather than nan_fill #1121
Conversation
… need diff strategy than None fill
…return None instead of blank Spectrum1D
Codecov ReportAttention:
Additional details and impacted files@@ 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 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested now. I see it uses only the region of overlap between the template and the observed spectrum to calculate the chi^2, but it also returns the template only in the overlapping region, while it would be useful to get out the full original template properly redshifted and normalized. Here are two screenshots: one shows the observed spectrum and one of the template in its full range; the other shows the observed spectrum and the selected template after template_comparison.
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality looks good to me!
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.