Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add 1D spectrum analysis tool based on gammapy.hspec #359
This PR introduces the GammapySpectrumObservation and GammapySpectrumAnalysis classes that are the basis for the command line tool gammapy-spectrum-pipe. This tool performs a basic 1D spectral analysis using a ring in the FoV to estimated the background contamination
I think your code will simplify quite a bit and be more re-usable from other scripts / algorithms if you introduce separate functions (and maybe even a class) to represent one observation and do the processing per observation.
Maybe something like this?
class GammapySpectrumObservation: event list data member count data member and method to compute it effective area data member and method to compute it energy resolution data member and method to compute it
and then your analysis class only does the batch observation processing / book-keeping:
For the fitting from Sherpa I don't know yet how it works ... I haven't looked at how it's done by hspec.
This looks good!
Can you make