Fix AveragedCrossspectrum for input_counts=False light curves#978
Open
VrtxOmega wants to merge 1 commit into
Open
Fix AveragedCrossspectrum for input_counts=False light curves#978VrtxOmega wants to merge 1 commit into
VrtxOmega wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relevant Issue(s)/PR(s)
Fixes #977.
Provide an overview of the implemented solution or the fix and elaborate on the modifications.
AveragedCrossspectrumwas passing the private light-curve storage fields (_countsand_counts_err) into the shared time-series cross-spectrum helper. For light curves created withinput_counts=False, those private counts arrays can be unset until the publiccounts/counts_errproperties are accessed, so the helper can treat the data like event input and return zero powers.This updates the light-curve path to pass the public
countsandcounts_errattributes, matching the existingAveragedPowerspectrumbehavior, and adds a regression test for an identical countrate light curve where the averaged cross spectrum should match the averaged power spectrum.Is there a new dependency introduced by your contribution? If so, please specify.
No.
Any other comments?
Validation run locally:
.venv/bin/python -m pytest stingray/tests/test_crossspectrum.py::TestAveragedCrossspectrum::test_input_countrate_matches_pds_for_identical_lightcurves -qinput_counts=Falsechanged from all-zero cross-spectrum powers to matchingAveragedPowerspectrum, whileinput_counts=Trueremained matching.