Skip to content

Shift and add #849

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

Merged
merged 12 commits into from
Oct 9, 2024
Merged

Shift and add #849

merged 12 commits into from
Oct 9, 2024

Conversation

matteobachetti
Copy link
Member

@matteobachetti matteobachetti commented Oct 4, 2024

Basic implementation of the shift-and-add technique from Mendez+1998
Guide for review: the basic mechanism is in fourier.py, the examples in the doctests should be self-explanatory. InDynamicalCrossspectrum and DynamicalPowerspectrum, I just wrap the same functionality in convenient methods that unpack the relevant information from the dynamical spectra and use the function in fourier.py.

Example: if a QPO is changing its frequency during our observation
Screenshot 2024-10-04 at 14 01 18

we can think of tracing its maximum (e.g. with dcs.trace_maximum(), here I did it by hand):
Screenshot 2024-10-04 at 14 03 31

and then applying shift_and_add to improve signal-to-noise and, maybe, detect a second QPO:
Screenshot 2024-10-04 at 14 03 49

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.11%. Comparing base (39431fc) to head (69bf6c5).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #849      +/-   ##
==========================================
+ Coverage   96.08%   96.11%   +0.03%     
==========================================
  Files          48       48              
  Lines        9292     9371      +79     
==========================================
+ Hits         8928     9007      +79     
  Misses        364      364              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matteolucchini1
Copy link
Collaborator

Other than the minor docstring comment, it is not immediately obvious to me (even from reading Mariano's paper) how exactly the new frequency axis is defined - e.g. in your example the new Frequency bins end up being [0.05 0.15 0.25 0.35 0.45] and I don't quite understand why. Maybe clarify that in the docstring (e.g. from "Array of output frequencies" to "array of output frequencies defined so and so").

Other than that, I think this is the kind of feature that should be documented explicitely in the dynamical powerspectrum section of the readthedocs.

@matteobachetti
Copy link
Member Author

@matteolucchini1 I fixed the docstrings are requested. I also opened an Issue in the notebooks repository in order to add the tutorial in the the dynamical power spectrum notebook: StingraySoftware/notebooks#104

@matteolucchini1
Copy link
Collaborator

I have no further comments (other than the obvious fix of the broken link in the automatic doc checks). Before merging I would prefer if we could update the docs though. Can we think of a "standard" NICER/NuSTAR observation to get started?

@matteobachetti
Copy link
Member Author

@matteolucchini1 there you go: StingraySoftware/notebooks#105
It was a good opportunity to refresh those tutorials!
I used an RXTE dataset, because this technique was used a lot in RXTE times and it was easier to find a good observation.

Copy link
Collaborator

@matteolucchini1 matteolucchini1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM no further comments

@matteobachetti matteobachetti added this pull request to the merge queue Oct 9, 2024
Merged via the queue into main with commit aee67bb Oct 9, 2024
17 checks passed
@matteobachetti matteobachetti deleted the shift_and_add branch October 9, 2024 12:34
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

Successfully merging this pull request may close these issues.

2 participants