Negative correlation at zero lag from stingray.crosscorrelation
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
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.

- Dominant language
- Python
- Stars
- 229
- Forks
- 196
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from StingraySoftware/stingray
-
create_gti_mask drops valid points after empty GTIs and crashes with min_length > 0 and dtPossibly taken @Rohan-Dedhia claimed this 5 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
StingraySoftware/stingray#1044 ·
Maintainers usually reply within 3 days
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
StingraySoftware/stingray#1042 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
StingraySoftware/stingray#1039 · 1 comment ·
Maintainers usually reply within 3 days
-
stingray: arbitrary code execution reading a pickle-format data product (read fmt=pickle) (CWE-502)May be free again @yash-8923 claimed this 11 days ago, and no pull request is open. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
StingraySoftware/stingray#1037 · 3 comments ·
Maintainers usually reply within 3 days
-
AveragedCrossspectrum returns zeros when using simulated light curves with input_counts=False.Possibly taken @VrtxOmega claimed this 176 days ago. Openbug help wanted
Difficulty 4/5 3-5 days Newbie friendliness 52/100
StingraySoftware/stingray#977 · 1 comment ·
Maintainers usually reply within 3 days
All issues in StingraySoftware/stingray
Similar issues
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
future-agi/future-agi#6392 ·
Maintainers usually reply within 1 day
-
memmapped_arange ignores the start value and drops the last point above the memmap thresholdPossibly taken @prathameshfuke claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
StingraySoftware/HENDRICS#213 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
bot-triaged module: decompositions module: edge cases module: int overflow module: primTorch oncall: pt2 triage review
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day