gammapy/ringtophat — Issue #4: Add unit tests
Author: cdeil
Created: 2012-02-24 14:44:16+00:00
State: open

We should write unit tests to test correctness of output.

Of course correctness has to be defined, I see two major points:

1) Define exactly the circle / ring kernel that is generated for a given radius / ring radius and thickness.
This is basically up to us, I would suggest to only implement kernels with an odd number of pixels, so that there are no shifts.

2) Image boundary conditions.
There are many and it can take a long time to implement and them all with all the corner cases.
To get started I would suggest to implement exactly the same as [1] and test against it.

Unit tests are most easily implemented in python I believe via unittest [1], plus possibly a test runner like pytest [3] or nose [4].
We can look at numpy, scipy or astropy how to set it up properly.

[1] http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.filters.convolve.html
[2] http://docs.python.org/library/unittest.html
[3] http://pytest.org/
[4] http://nose.readthedocs.org/