Skip to content

Commit

Permalink
docs(tools): add parameters and returns to docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
rikvl committed Jun 7, 2024
1 parent 7fa8958 commit 73505b9
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ch_util/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 73505b9

Please sign in to comment.