-
Notifications
You must be signed in to change notification settings - Fork 145
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
Fixes to dynamical power spectrum + Dynamical Cross spectrum #779
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #779 +/- ##
==========================================
+ Coverage 96.17% 96.18% +0.01%
==========================================
Files 43 43
Lines 7999 8020 +21
==========================================
+ Hits 7693 7714 +21
Misses 306 306 ☔ View full report in Codecov by Sentry. |
dfe6527
to
d5205b0
Compare
d5205b0
to
f2ad54c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @matteobachetti,
it's great that you updated this tool for the spectral-timing analysis.
I was wondering if it's worth adding dt as a parameter in the docstring of DynamicalCrossspectrum, specifying that dt needs to be an input in the case data1 and data2 are two EventList objects
Before calling _make_mastrix should init call the cross_gtis function? Or are we assuming that the gtis of data1 and data2 are the same?
Maybe AveragedCrossspectrum calls cross_gtis already, right?
The rebin_time function is a bit confusing.
If I had to think of rebinning in time the dynamical cross-spectrum I would think of changing the segment_size and not the dt, but maybe it's just me. However, it needs to be clearer in the docstring that the rebin_time function changes the Nyquist frequency and not the time axis of the dynamical cross-spectrum.
Actually, looking at the code, I'm not sure the rebin_data does the correct job, right?
The tests look good, but I'll check them more carefully next round.
ec89d97
to
d32be51
Compare
@mgullik yes, there is a confusion between two different meanings of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @matteobachetti,
the review is completed, I suggested one last change to the docstring of the rebin_time. Sorry, probably too picky there
One thing, since you were so thorough in implementing the DynamicalCrossspectrum I'm wondering why don't you implement an option to output a complex matrix with real and imaginary parts instead of the normalized squared absolute values of Fourier amplitudes? In this way, it's even possible to create a dynamic lag frequency spectrum (boom!) However, not something to hold this PR longer.
Another very small thing about the tests, I noticed is that you always run the tests on DynamicalCrossspectrum with the same lightcurves for data1 and data2. Does it make sense to test it with two different light curves?
As far as I can see, I'm not using the squared amplitudes anywhere, and indeed, the Dynamical Cross spectrum has complex values when you feed it with different light curves in the two channels. I added a test to show explicitly that |
AveragePowerspectrum
to create light curves dynamically for each segment, rather than allocating the full light curve on the spot)BONUS: added Dynamical Cross spectrum, because why not