Add background estimation for phase-resolved spectra #1426
cdeil left a comment
@msjacob - Thanks!
I think this is a good addition. We can iterate on this a bit here, but basically I think we should get a working pulsar analysis in Gammapy and have a notebook docs example, and then once we see what we have we can still discuss if it can be structured in a better way.
The main thing that's missing here is a test case.
and use one or two obs from there for the test case.
I also see that you added this:
There's a few options, ranging from preparing a test dataset that works, or changing your code. E.g. you work with
@msjacob - What do you think? Do you see a way to add a test?
The other suggestion I'd make is concerning the phase selection. Users will wonder how it works exactly and what is / isn't possible. Suggest to add some text or example to the docstring. For now, I think only a single interval is supported, and it can't wrap, i.e. be from 0.8 to 0.3. You don't do any wrapping of phases or support intervals that wrap below 0 or beyond 1. Can you state that in the docstring?
@msjacob - Any of those ideas / additions can come later or never. If you stick with the current implementation, please add two lines to the docstring to document what is done exactly and that there's this limitation that with the current scheme only simple interval phase selection isn't possible.