Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct FOV when simulating atmosphere for the benchmark. #507

Merged
merged 4 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/toast/instrument_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,10 +568,13 @@ def fake_hexagon_focalplane(

"""
width_deg = width.to_value(u.degree)
# When laying out the hexagonal pixels, the angular "width" is the distance
# between the flat sides.
width_flats = np.cos(np.pi / 6) * width_deg
pol_A = hex_pol_angles_qu(n_pix, offset=0.0)
pol_B = hex_pol_angles_qu(n_pix, offset=90.0)
quat_A = hex_layout(n_pix, width_deg, "D", "A", pol_A)
quat_B = hex_layout(n_pix, width_deg, "D", "B", pol_B)
quat_A = hex_layout(n_pix, width_flats, "D", "A", pol_A)
quat_B = hex_layout(n_pix, width_flats, "D", "B", pol_B)

temp_data = dict(quat_A)
temp_data.update(quat_B)
Expand Down Expand Up @@ -624,7 +627,7 @@ def fake_hexagon_focalplane(
return Focalplane(
detector_data=det_table,
sample_rate=sample_rate,
field_of_view=(width + 2.1 * fwhm),
field_of_view=1.1 * (width + 2 * fwhm),
)


Expand Down
2 changes: 0 additions & 2 deletions src/toast/scripts/toast_benchmark_ground
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ def parse_arguments():
2054 # Hex-packed 1027 pixels (18 rings) times two dets per pixel.
)
args.width = 10.0
args.fov = 1.1 * args.width * u.degree
args.psd_net = 50.0e-6
args.psd_fmin = 1.0e-5

Expand Down Expand Up @@ -460,7 +459,6 @@ def main():

# Simulate atmosphere signal
job_ops.sim_atmosphere.detector_pointing = job_ops.det_pointing_azel
job_ops.sim_atmosphere.field_of_view = args.fov
job_ops.sim_atmosphere.apply(data)
log.info_rank("Simulated and observed atmosphere in", comm=world_comm, timer=timer)

Expand Down
5 changes: 2 additions & 3 deletions src/toast/scripts/toast_benchmark_ground_setup
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ def parse_arguments():
args.dry_run = None

# Focal plane- we will use a dummy focalplane with just 2 detectors.
args.sample_rate = 1.0 # sample_rate is nb sample per second.
args.sample_rate = 100.0 # sample_rate is nb sample per second.
args.width = 10.0
args.fov = 1.1 * args.width * u.degree
args.psd_net = 50.0e-6
args.psd_fmin = 1.0e-5

Expand Down Expand Up @@ -309,7 +308,7 @@ def main():
if world_comm is not None:
world_comm.barrier()
job_ops.sim_atmosphere.detector_pointing = job_ops.det_pointing_azel
job_ops.sim_atmosphere.field_of_view = args.fov
job_ops.sim_atmosphere.field_of_view = telescope.focalplane.field_of_view
job_ops.sim_atmosphere.cache_dir = cache_dir
job_ops.sim_atmosphere.cache_only = True
job_ops.sim_atmosphere.apply(data)
Expand Down