Error result from CrossCorrelation

Open
#817 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

  • #893 by @Sauravroy34 — closed without merging

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start with CrossCorrelation and inspect crosscorrelation.py around lines 200-201, then reproduce the reported case using one light curve with norm='variance'. Verify the variance normalization at time_lags = 0 and add or update regression coverage so the corrected result is no greater than 1 for this case.

Written by the indexing model from the issue text.

Description

I perform cross-correlation from one light curve like this:

corr = CrossCorrelation(lc, lc, norm='variance')

corr is much greater than 1 at time_lags = 0.
The code in crosscorrelation.py (lines 200-201) may have a bug:

variance1 = np.var(lc1.counts) - np.mean(lc1.counts_err) ** 2
variance2 = np.var(lc2.counts) - np.mean(lc2.counts_err) ** 2

Should it be like this:

variance1 = np.var(lc1.counts) - np.var(lc1.counts_err) 
variance2 = np.var(lc2.counts) - np.var(lc2.counts_err)
Dominant language
Python
Stars
229
Forks
196
Avg merge
4d 12h
Merged PRs (30d)
20

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from StingraySoftware/stingray

All issues in StingraySoftware/stingray

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.