Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Implement `MapDataset.to_spectrum_dataset()` method #2292
In the discussion on data reduction, we have proposed to perform a succession of distinct tasks on a per observation basis.
For spectral data reduction the approach is to perform :
This PR proposes a prototype for the first step described here.
To compute the background per energy bin in the spatial region, a spatial integration is necessary. it is performed by creating the background map in a small cutout of the reference tangent map and integrating over pixels inside the region.
Additionally the capability to perform averaging of the effective area over the region is introduced to better handle the case of extended regions.
Thanks @registerrier! I have thought about a bit what to do about this PR. I agree 100% with the functionality. It's an important use-case, where I know some users are already waiting for it. So it would be nice to get this in even for v0.14.
What I'm not happy yet with is the API and implementation. I think introducing a separate
dataset = MapDataset(...) # e.g. fit background norm and tilt fit = Fit(dataset) fit.run() maker = SpectrumDatasetMaker(region, spatial_averaging, containment_correction) spectrum_dataset = maker.run(dataset)
My hope is that we'll find some time to finish the data reduction PIG and define an API soon, so that we arrive at a flexible maker and pipeline system, where this
This PR is heavily modified since the initial commit. It now only consists in an addition to