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 units to gammapy.maps #1374
This is a first commit to add units to map. This contains:
Still need to add unit in
Note that the
EDIT : this PR implements #1206
@registerrier - Thanks!
I left some inline comments.
You're trying to support both
I think that's a bad idea, you can already see in this PR how it increases the code needed for input handling and tests.
Suggest to just pick one and only support that.
This new version has a treatment of units for
@woodmd - Do you have time to review this soon?
My main remaining question here is this: we always store unit as string, but we only expose it as a Unit object? Is that a good idea? Or should we change that somehow?
Note that units can store a scale:
I think we had problems and confusion with that before.
The FITS I/O should probably be changed to call
I'll leave this PR open for a day or two and would like to resolve those points; so @woodmd @joleroi @registerrier - please comment or make changes by attaching commits here.
There's a fail now in test_make_map_exposure_true_energy and test_make_map_fov_background :
I've added one missing requires scipy in a test in dc48302 .
And I've simplified the weights handling in map fill in 609ebfb .
I think it's pretty much equivalent with the old version (at least all tests still pass), but simpler.
@registerrier - It's very well possible that there's a problem I don't understand here yet, and with the new implementation. If so, please open a new PR adding a test case that shows the problem, and then update the implementation again.