Add map geom pixel solid angle computation #1357
cdeil left a comment
@registerrier - Please add at least one test (e.g. with 3x2 pix) case that exercises the new code, to show that it's working. Ideally there would even be a second test case where you have an energy or some extra axis, to show if the code still works and if it then returns a 2D or 3D array in that case (add an assert on shape of return value).
Probably http://docs.gammapy.org/dev/_modules/gammapy/image/core.html#SkyImage.solid_angle already has such a test case that you could copy and adapt here.
I'm not sure if it's useful to have the stub in the base class, I think you could also remove it there, as you like.
For all docstrings, you should give a one-line description so that it shows up nicely in the API summary lists. For cases like this one I'd suggestion to put a single line instead of a Returns section as explained here:
I see that the current
@registerrier - Presumably you don't want to improve the functionality to generate coordinate grids in this PR? If so, please change the comments in your implementation a bit to make it clearer that there's a TODO and what should be done. I'd suggest this:
Efficiency is not really a concern, because coordinate and solid angle arrays are only computed rarely. But IMO we should avoid re-implementing things, so I'm -1 on your proposal in the current code to call