From bb6b9304b37f303d51de30046fbd7fedcf767f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Gro=C3=9F?= Date: Wed, 13 Nov 2024 10:08:59 +0100 Subject: [PATCH 1/3] Add normalization parameter to visibility calculations --- pyvisgen/simulation/visibility.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyvisgen/simulation/visibility.py b/pyvisgen/simulation/visibility.py index 2a36ffb..6444fc0 100644 --- a/pyvisgen/simulation/visibility.py +++ b/pyvisgen/simulation/visibility.py @@ -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 @@ -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( From e6ec7f7dc4f295883518da2489f3a77f96073a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Gro=C3=9F?= Date: Wed, 13 Nov 2024 10:21:00 +0100 Subject: [PATCH 2/3] Add changelog --- docs/changes/43.optimization.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/changes/43.optimization.rst diff --git a/docs/changes/43.optimization.rst b/docs/changes/43.optimization.rst new file mode 100644 index 0000000..dbcc635 --- /dev/null +++ b/docs/changes/43.optimization.rst @@ -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) From 85645d5d1c1ea5f7d16546bd0c64b844b3c92c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Gro=C3=9F?= Date: Wed, 13 Nov 2024 15:42:47 +0100 Subject: [PATCH 3/3] Update changelog --- docs/changes/43.optimization.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changes/43.optimization.rst b/docs/changes/43.optimization.rst index dbcc635..3db1a66 100644 --- a/docs/changes/43.optimization.rst +++ b/docs/changes/43.optimization.rst @@ -1 +1 @@ -Added optional `normalize` parameter to `pyvisgen.visibility#vis_loop` to decide whether to apply a normalization multiplier of `0.5` (default: True) +Added optional `normalize` parameter to `pyvisgen.visibility.vis_loop` to decide whether to apply a normalization multiplier of `0.5` (default: True)