Skip to content

Commit

Permalink
Use the same factor of 4 for "sum" and "avg" pol_convention
Browse files Browse the repository at this point in the history
This follows from @JianrongTan's work, as documented in #406
  • Loading branch information
jsdillon committed Sep 25, 2024
1 parent 4151d80 commit de61dc3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hera_pspec/pstokes.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def _combine_pol_arrays(
nsamples_list : any length 2 iterable of numpy arrays
Iterable of nsamples arrays to be combined to form their pseudo-Stokes equivalent.
nsamples are combined to preserve proper variance, see hera_pspec issue #391.
nsamples are combined to preserve proper variance, see hera_pspec issue #391 and #406
If only one is given, it is duplicated.
Default is None.
Expand Down Expand Up @@ -264,9 +264,9 @@ def _combine_pol_arrays(

# constructing nsamples
if nsamples_list is not None:
combined_nsamples = (nsamples_list[0]**-1 + nsamples_list[1]**-1)**-1
if pol_convention == 'avg':
combined_nsamples *= 4.
combined_nsamples = 4 * (nsamples_list[0]**-1 + nsamples_list[1]**-1)**-1
# for an explanation of the factor of 4, and why it doesn't depend on pol_convention,
# see https://github.com/HERA-Team/hera_pspec/issues/406
else:
combined_nsamples = None

Expand Down

0 comments on commit de61dc3

Please sign in to comment.