stingray icon indicating copy to clipboard operation
stingray copied to clipboard

Error result from CrossCorrelation

Open yuzl00 opened this issue 1 year ago • 1 comments

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)

yuzl00 avatar Apr 16 '24 10:04 yuzl00

@yuzl00 thanks for the Issue, we're investigating it

matteobachetti avatar Apr 16 '24 15:04 matteobachetti