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

Add normalization bool parameter to visibility calculations #43

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions docs/changes/43.optimization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added optional `normalize` parameter to `pyvisgen.visibility.vis_loop` to decide whether to apply a normalization multiplier of `0.5` (default: True)
4 changes: 3 additions & 1 deletion pyvisgen/simulation/visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def vis_loop(
mode="full",
batch_size=100,
show_progress=False,
normalize=True,
):
torch.set_num_threads(num_threads)
torch._dynamo.config.suppress_errors = True
Expand Down Expand Up @@ -74,7 +75,8 @@ def vis_loop(

# normalize visibilities to factor 0.5,
# so that the Stokes I image is normalized to 1
B *= 0.5
if normalize:
B *= 0.5

# calculate vis
visibilities = Visibilities(
Expand Down
Loading