-
Notifications
You must be signed in to change notification settings - Fork 144
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
Introduce power colors #780
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #780 +/- ##
==========================================
+ Coverage 96.31% 96.40% +0.08%
==========================================
Files 43 43
Lines 8495 8697 +202
==========================================
+ Hits 8182 8384 +202
Misses 313 313 ☔ View full report in Codecov by Sentry. |
08d31f9
to
2006984
Compare
2006984
to
a68beb8
Compare
a68beb8
to
7882e65
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.
Yay! Looks great! I only have minor comments, so I'll pre-emptively approve it so that it can get merged once everything is fixed.
return pc0, pc0_err, pc1, pc1_err | ||
|
||
|
||
def hue_from_power_color(pc0, pc1, center=[4.51920, 0.453724]): |
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.
Given that there is an uncertainty on the power colours, should there also be an uncertainty on the hue?
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.
It's just tricky to compute, because both error bars matter here (x and y), and I don't think people use the error bars on hues much anyway? Anyways, open to figure this out
…ted and evenly sampled
Hello @matteobachetti! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-01-11 16:51:45 UTC |
This PR introduces Power colors à la Heil et al. 2015. Now we can calculate power colors (both linear and logarithmic) and the hue, also defined according to the same paper by Heil+. I added the relevant functions in
fourier.py
, and tested them intest_fourier.py
Moreover, Power colors can be directly calculated from the spectra in a
DynamicalCrossspectrum
orDynamicalPowerspectrum
, with the new methodspower_colors
.In order to make power colors more usable, we also needed a simple way to combine contiguous power spectra to improve the S/N. I added a function to
DynamicalCrossspectrum
to combine n contiguous spectra together, regardless of their distance in time (e.g. two intervals on the opposite side of an occultation in NICER).Demonstration here: StingraySoftware/notebooks#76