Skip to content

Commit

Permalink
Add --sample_rate and --fsample to toast_sim_satellite.py
Browse files Browse the repository at this point in the history
  • Loading branch information
keskitalo committed Mar 10, 2024
1 parent 12c5f6f commit 93339cd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/toast/instrument.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2023 by the parties listed in the AUTHORS file.
# Copyright (c) 2019-2024 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.

Expand Down
24 changes: 23 additions & 1 deletion workflows/toast_sim_satellite.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ def parse_config(operators, templates, comm):
help="The output directory",
)

parser.add_argument(
"--sample_rate",
required=False,
type=float,
help="Override focalplane sampling rate [Hz]",
)

parser.add_argument(
"--thinfp",
required=False,
type=int,
help="Only sample the provided focalplane pixels",
)

# Build a config dictionary starting from the operator defaults, overriding with any
# config files specified with the '--config' commandline option, followed by any
# individually specified parameter overrides.
Expand Down Expand Up @@ -96,7 +110,15 @@ def load_instrument_and_schedule(args, comm):
timer = toast.timing.Timer()
timer.start()

focalplane = toast.instrument.Focalplane()
if args.sample_rate is not None:
sample_rate = args.sample_rate * u.Hz
else:
sample_rate = None
focalplane = toast.instrument.Focalplane(
sample_rate=sample_rate,
thinfp=args.thinfp,
)

with toast.io.H5File(args.focalplane, "r", comm=comm, force_serial=True) as f:
focalplane.load_hdf5(f.handle, comm=comm)
log.info_rank("Loaded focalplane in", comm=comm, timer=timer)
Expand Down

0 comments on commit 93339cd

Please sign in to comment.