Skip to content

Commit

Permalink
Add scheduler options for rotating boresight in a restricted range (#544
Browse files Browse the repository at this point in the history
)
  • Loading branch information
keskitalo authored Mar 22, 2022
1 parent 0303cdd commit 60bcff2
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/toast/schedule_sim_ground.py
Original file line number Diff line number Diff line change
Expand Up @@ -1834,8 +1834,17 @@ def get_boresight_angle(args, t, t0=0):
if args.boresight_angle_step_deg == 0 or args.boresight_angle_time_min == 0:
return 0

istep = int((t - t0) / 60 / args.boresight_angle_time_min)
return (args.boresight_angle_step_deg * istep) % 360
nstep = int(np.round(
(args.boresight_angle_max_deg - args.boresight_angle_min_deg)
/ args.boresight_angle_step_deg
))
if (args.boresight_angle_min_deg % 360) != (args.boresight_angle_max_deg % 360):
# The range does not wrap around.
# Include both ends of the range as separate steps
nstep += 1
istep = int((t - t0) / 60 / args.boresight_angle_time_min) % nstep
angle = args.boresight_angle_min_deg + istep * args.boresight_angle_step_deg
return angle


@function_timer
Expand Down Expand Up @@ -2304,6 +2313,20 @@ def parse_args(opts=None):
type=np.float,
help="Boresight rotation step size [deg]",
)
parser.add_argument(
"--boresight-angle-min-deg",
required=False,
default=0,
type=np.float,
help="Boresight rotation angle minimum [deg]",
)
parser.add_argument(
"--boresight-angle-max-deg",
required=False,
default=360,
type=np.float,
help="Boresight rotation angle maximum [deg]",
)
parser.add_argument(
"--boresight-angle-time-min",
required=False,
Expand Down

0 comments on commit 60bcff2

Please sign in to comment.