Skip to content
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

Phase dispersion minimization in stingray! #716

Merged
merged 15 commits into from
Apr 25, 2023

Conversation

dhuppenkothen
Copy link
Member

Phase dispersion minimisation is a close cousin to Epoch Folding, so I piggy-backed off the existing infrastructure and implemented it in stingray. Mostly used for asteroids and binary stars rather than pulsars, but since all the other methodology is in the pulse sub-package, that's where it might live for the moment.

@dhuppenkothen dhuppenkothen added the feature Additional functionality. label Apr 6, 2023
Copy link
Member

@matteobachetti matteobachetti left a comment

Choose a reason for hiding this comment

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

Hey @dhuppenkothen, great to have another tool for periodicities!

I see from the new docs that you created a notebook to show off the method's performance, but it's currently missing. Would you mind adding it to the notebooks repository as a separate PR?

Also, there must have been some issue with black and a lot of the diff is white space and unrelated changes. Would you mind rebasing and/or re-opening based on the most recent main?

Thanks!

@dhuppenkothen dhuppenkothen force-pushed the phase_dispersion_minimization branch from bd38497 to 4d7ddcf Compare April 20, 2023 12:59
@dhuppenkothen
Copy link
Member Author

@matteobachetti

We'd need to merge the notebook PR first, so that we can update the submodule before merging this PR.
Also, it's complaining about a lack of changelog entry, but there's no instructions for how to actually make a changelog entry, so I also opened an issue that our documentation for contributing really needs an update! :D

@matteobachetti
Copy link
Member

See #721!

Copy link
Member

@matteobachetti matteobachetti left a comment

Choose a reason for hiding this comment

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

A few comments here and there!

Parameters
----------
times : array of floats
Photon arrival times, or, if `weights` is set,
Copy link
Member

Choose a reason for hiding this comment

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

What happens if weights is set? Don't leave us hanging!

Copy link
Member Author

Choose a reason for hiding this comment

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

I do like a good cliffhanger! :D

I think I introduced some bugs while I fixed merge conflicts when I merged the current main branch. Should be fixed now.

@@ -33,6 +33,19 @@ def test_fold_detection_level():
)


def test_fold_detection_level():
Copy link
Member

Choose a reason for hiding this comment

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

Duplicate name?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, should be test_pdm_detection_level

# dummy array for the error, which we don't have for the variance
raw_profile_err = np.zeros_like(raw_profile)

else:
Copy link
Member

Choose a reason for hiding this comment

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

I think these lines are not tested

Copy link
Member Author

Choose a reason for hiding this comment

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

Added tests to test_pulse.py

expocorr : bool, default False
Correct each bin for exposure (use when the period of the pulsar is
comparable to that of GTIs)

mode : str, ["ef", "pdm"], default "pdm"
Copy link
Member

Choose a reason for hiding this comment

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

Why is pdm the default?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not in the code, but apparently I hallucinated while writing the doctoring. :D

@dhuppenkothen
Copy link
Member Author

Accidentally deleted the new PDM stats functions from __all__ in stats.py when I merged the main branch and applied black. Sigh. Hopefully that's all fixed now.

@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Merging #716 (d2654a6) into main (a417cc1) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #716      +/-   ##
==========================================
+ Coverage   97.20%   97.22%   +0.01%     
==========================================
  Files          42       42              
  Lines        7805     7848      +43     
==========================================
+ Hits         7587     7630      +43     
  Misses        218      218              
Impacted Files Coverage Δ
stingray/pulse/pulsar.py 98.67% <100.00%> (+0.07%) ⬆️
stingray/pulse/search.py 96.79% <100.00%> (+0.17%) ⬆️
stingray/stats.py 99.51% <100.00%> (+0.04%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@matteobachetti matteobachetti added this pull request to the merge queue Apr 25, 2023
Merged via the queue into main with commit 91feeec Apr 25, 2023
@matteobachetti matteobachetti deleted the phase_dispersion_minimization branch September 22, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Additional functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants