Negative correlation at zero lag from stingray.crosscorrelation

Open
#704 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start with the CrossCorrelation entry point and the Lightcurve construction shown in the report, checking how TIME, RATE, use_counts=False, and dt=1 are interpreted. Reproduce the zero-lag result with the supplied 1 ms inputs and determine whether the behavior comes from the imported data or correlation handling; done means a confirmed cause and documented correction.

Written by the indexing model from the issue text.

Description

I have fits light curves of 1ms binning.
I imported these light curves into stingray as follows and computed cross correlation.

from astropy.io import fits
from stingray import Lightcurve
from stingray.crosscorrelation import CrossCorrelation
hdu36=fits.open('Light_1ms_3.0_6.0keV.lc')
hdu620=fits.open('Light_1ms_6.0_20.0keV.lc')

lc36=Lightcurve(hdu36[1].data['TIME'],hdu36[1].data['RATE'],use_counts=False,dt=1)
lc620=Lightcurve(hdu620[1].data['TIME'],hdu620[1].data['RATE'],use_counts=False,dt=1)

cc = CrossCorrelation(lc36, lc620)

But, there is a negative correlation at zero lag. I have attached the figure.
Please let me know why this happens and how to correct it.

I want to generate cross correlation with light curves of 1 ms resolution instead of the 1s binning used here.
There also I see the same issue of negative correlation at zero lag. How can I address this issue?
Am I importing the light curves incorrectly to stingray? Please let me know.

correlation_v2

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.