Skip to content

Commit

Permalink
feat(tools): add function to convert beam index
Browse files Browse the repository at this point in the history
  • Loading branch information
rikvl committed Mar 14, 2024
1 parent 2db1fb0 commit 25d6b52
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ch_util/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2478,6 +2478,18 @@ def delay(
return delays


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."""
beam_ew_index = beam_index // 256
beam_ns_index = beam_index % 256
beam_number = 1000 * beam_ew_index + beam_ns_index
return beam_number


def invert_no_zero(*args, **kwargs):
from caput import tools
import warnings
Expand Down

0 comments on commit 25d6b52

Please sign in to comment.