StingraySoftware / notebooks

Tutorial notebooks for Stingray
MIT License
21 stars 32 forks source link

Issue with Cross Correlation (Another Example) in cross_correlation_notebook #83

Open kartikmandar opened 6 months ago

kartikmandar commented 6 months ago

The cross_correlation_notebook has some error in the code that I am having difficulty understanding. In the Another Example section of the notebook. The cs = CrossCorrelation() has no input lightcurves. As a result when the cs.cal_timeshift(dt=0.5) method is invoked it gives the error: AttributeError: 'NoneType' object has no attribute 'counts' This maybe because Lightcurve objects are not defined within the cs CrossCorrelation object, resulting in NoneType objects. I tried using the previously defined lc1 and lc2 lightcurves as input for the CrossCorrelations object. That worked fine but it gave a timeshift of -4.8125 which is way different than what the notebook shows presently. It created doubts on whether I should do that or not? Also afterwards when plotting cs, it output an error saying that the dimensions of the self.time_lags and self.corr arrays are not compatible for plotting. They should have the same first dimension, but in this case, they have different shapes: (320) for self.time_lags and (10) for self.corr.

matteobachetti commented 6 months ago

@kartikmandar ok, there must be some change in the most recent API that produces the nonetype problem. For the rest, putting in random light curves just to make it work will produce a different lag, this is expected.

I will work on the issue.

kartikmandar commented 6 months ago

So for now shall I just put some lightcurves to make it working?

matteobachetti commented 6 months ago

No, this is a bug that needs to be solved properly.

kartikmandar commented 6 months ago

Okay sure.