From 73505b9f063b5ac22a80cd91674fea0fd794fbf9 Mon Sep 17 00:00:00 2001 From: Rik van Lieshout Date: Fri, 7 Jun 2024 08:45:33 -0700 Subject: [PATCH] docs(tools): add parameters and returns to docstring --- ch_util/tools.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ch_util/tools.py b/ch_util/tools.py index abbe3561..996a33d9 100644 --- a/ch_util/tools.py +++ b/ch_util/tools.py @@ -2481,9 +2481,20 @@ def delay( def beam_index2number(beam_index): """Convert beam "index" (0-1023) to beam "number" (0-255, 1000-1255, etc.) - The latter, with 1000s indicating the beam's East-West index and the remainder - going from 0 through 255 indicating the beam's North-South index, is used in - the CHIME/FRB beam_model package.""" + The beam "number", with 1000s indicating the beam's East-West index and the + remainder going from 0 through 255 indicating the beam's North-South index, + is used in the CHIME/FRB beam_model package. + + Parameters + ---------- + beam_index : int or np.ndarray of int + The beam index or indices to be converted. + + Returns + ------- + beam_number : same as beam_index + The corresponding beam number or numbers. + """ beam_ew_index = beam_index // 256 beam_ns_index = beam_index % 256 beam_number = 1000 * beam_ew_index + beam_ns_index