fix: Fix single-backend bin and empty-epoch bugs in makegp_ecorr#100
fix: Fix single-backend bin and empty-epoch bugs in makegp_ecorr#100Wang-weiYu wants to merge 1 commit intonanograv:mainfrom
Conversation
|
@Wang-weiYu Thank you for adding these changes. I'm sorry it's taken a while to get to. The changes all make sense given the issue you opened. I would like to hold off on merging just for the moment -- I want to create a dummy pulsar object that produces these errors with the old code, and checks that your code fixes it. Then I'll use it as a unittest. I will try to do this in the next week -- otherwise please feel free to try it yourself. |
|
Hi @meyers-academic, Thank you so much for looking into this and for planning to add the tests. Yes, please go ahead and merge it after testing, considering the overall Discovery architecture and the related components. Thank you for your time! Best regards, |
|
Hi @Wang-weiYu I'm sorry, I've done the annoying thing of fixing this and pushing to main instead of accepting the pull request. I will try not to do the in the future. I did it because I was worried that if I wanted to push changes to the pull request, it would change the main branch of your fork (which could have also included a bunch of recent commits, and I wasn't sure whether that would bother you). However, I have added a unit test that successfully found the single-backend issue, and now passes with your fix, which I implemented. If it's ok, please have a look at the main discovery branch, let me know if there are issues. If not, I will close this. |
|
Hi @meyers-academic, No worries at all — I'm glad the bug has already been fixed. I've checked the changes, and everything looks good to me. Thanks! Best regards, |
The PR is related to #99
This PR fixes the single-backend bin and empty-epoch bugs in makegp_ecorr.
discovery/src/discovery/signals.py
Lines 168 to 169 in ebd7edb
If we try to analyze the ecorr noise in the pulsar which has only one backend, the first backend will be discarded.
Therefore, we use
and
to make sure that we have the correct bins.
If there is no ToAs observed at the same time and we only consider about the bins that have more than two ToAs. It will arise an error. It has been mentioned ECORR and enterprise=True #96 to modify how many ToAs we need to consider about. But, for now, we can solve it like
to make it aligned with the default setting in
enterprise.Closes #99