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

Fix error where zero sources are up over the horizon #13

Merged
merged 1 commit into from
Apr 18, 2024
Merged
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
8 changes: 7 additions & 1 deletion fftvis/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def simulate(
baselines: list[tuple] = None,
precision: int = 2,
polarized: bool = False,
eps: float = 1e-13,
eps: float = None,
beam_spline_opts: dict = None,
):
"""
Expand Down Expand Up @@ -179,6 +179,9 @@ def simulate(
real_dtype = np.float64
complex_dtype = np.complex128

if eps is None:
eps = default_accuracy_dict[precision]

# Get the redundant groups - TODO handle this better
if not baselines:
reds = utils.get_pos_reds(ants, include_autos=True)
Expand Down Expand Up @@ -229,6 +232,9 @@ def simulate(
# Number of above horizon points
nsim_sources = above_horizon.sum()

if nsim_sources == 0:
continue

# Form the visibility array
_vis = np.zeros((nfeeds, nfeeds, nbls, nfreqs), dtype=complex_dtype)

Expand Down
Loading