Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changes/893.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix for variance normalisation for cross correlation method
4 changes: 2 additions & 2 deletions stingray/crosscorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def _make_corr(self, lc1, lc2):
# Note that self.corr is normalized so that the maximum is
# proportional to the number of bins in the first input
# light curve. Hence, the division by the lc size
variance1 = np.var(lc1.counts) - np.mean(lc1.counts_err) ** 2
variance2 = np.var(lc2.counts) - np.mean(lc2.counts_err) ** 2
variance1 = np.var(lc1.counts) - np.var(lc1.counts_err)
variance2 = np.var(lc2.counts) - np.var(lc2.counts_err)
self.corr = self.corr / np.sqrt(variance1 * variance2) / lc1_counts.size

def cal_timeshift(self, dt=1.0):
Expand Down