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
Add a function to delete a time interval from GTI #4822
Conversation
Signed-off-by: cgalelli <claudio.galelli@obspm.fr>
The CI issue is corrected. You can rebase to make it run. |
Codecov Report
@@ Coverage Diff @@
## main #4822 +/- ##
==========================================
+ Coverage 75.52% 75.54% +0.02%
==========================================
Files 224 224
Lines 32771 32804 +33
==========================================
+ Hits 24750 24783 +33
Misses 8021 8021
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Thanks @cgalelli . This looks good!
I think there is one issue because you don't copy the parent Table. You are probably modifying the GTI.
Otherwise you might add a test when the bad interval is partly outside or fully outside the range of your GTI?
gammapy/data/gti.py
Outdated
interval_start.format = self.time_start.format | ||
interval_stop.format = self.time_stop.format | ||
|
||
trim_table = self.table |
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.
Here you are modifying the parent table. You should make a copy to avoid changing the parent GTI.
…touched. Added test for out of scope intervals Signed-off-by: cgalelli <claudio.galelli@obspm.fr>
Signed-off-by: cgalelli <claudio.galelli@obspm.fr>
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.
Thanks @cgalelli ! Looks good to me.
As requested by the issue #4784 I added a function that removes a "bad time interval" from the GTIs with correlated test. A future addition will be a more complex handling of lists of "bad periods"