notebooks icon indicating copy to clipboard operation
notebooks copied to clipboard

Issue with Cross Correlation (Another Example) in cross_correlation_notebook

Open kartikmandar opened this issue 1 year ago • 4 comments

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.

kartikmandar avatar Feb 16 '24 21:02 kartikmandar

@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.

matteobachetti avatar Feb 17 '24 08:02 matteobachetti

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

kartikmandar avatar Feb 17 '24 09:02 kartikmandar

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

matteobachetti avatar Feb 17 '24 10:02 matteobachetti

Okay sure.

kartikmandar avatar Feb 17 '24 10:02 kartikmandar