Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative correlation at zero lag from stingray.crosscorrelation #704

Open
hjsreehari opened this issue Mar 12, 2023 · 2 comments
Open

Negative correlation at zero lag from stingray.crosscorrelation #704

hjsreehari opened this issue Mar 12, 2023 · 2 comments

Comments

@hjsreehari
Copy link

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

@matteobachetti
Copy link
Member

Hi @hjsreehari, I don't know why this happens, it might be something related to the data themselves. Have you ever used crosscorrelation before?

@hjsreehari
Copy link
Author

Hi @matteobachetti ,
Thanks for the reply. I tried correlation of the same light curves (MAXI J1535-571) with heasoft tool crosscorr and it still gives negative correlation at zero lag. So, it must be issue with the data. The figure is attached.

Surprisingly, I have seen such negative correlation with some simulated data as well.
What might be the reason? Thank you.
corr_heasoft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants