Skip to content

Commit

Permalink
Remove extensive doctest example from hillas function
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Jul 1, 2022
1 parent d6e2f31 commit 2dd70a6
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions ctapipe/image/hillas.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,37 +67,18 @@ def hillas_parameters(geom, image):
from
https://github.com/fact-project/fact-tools
The image passed to this function can be in three forms:
>>> from ctapipe.image.hillas import hillas_parameters
>>> from ctapipe.image.tests.test_hillas import create_sample_image, compare_hillas
>>> geom, image, clean_mask = create_sample_image(psi='0d')
>>>
>>> # Fastest
>>> geom_selected = geom[clean_mask]
>>> image_selected = image[clean_mask]
>>> hillas_selected = hillas_parameters(geom_selected, image_selected)
>>>
>>> # Mid (1.45 times longer than fastest)
>>> image_zeros = image.copy()
>>> image_zeros[~clean_mask] = 0
>>> hillas_zeros = hillas_parameters(geom, image_zeros)
>>>
>>> # Slowest (1.51 times longer than fastest)
>>> image_masked = np.ma.masked_array(image, mask=~clean_mask)
>>> hillas_masked = hillas_parameters(geom, image_masked)
>>>
>>> compare_hillas(hillas_selected, hillas_zeros)
>>> compare_hillas(hillas_selected, hillas_masked)
The recommended form is to pass only the sliced geometry and image
for the pixels to be considered.
Each method gives the same result, but vary in efficiency
Parameters
----------
geom: ctapipe.instrument.CameraGeometry
Camera geometry
Camera geometry, the cleaning mask should be applied to improve performance
image : array_like
Charge in each pixel
Charge in each pixel, the cleaning mask should already be applied to
improve performance.
Returns
-------
Expand Down

0 comments on commit 2dd70a6

Please sign in to comment.