Skip to content

Commit

Permalink
Revert "Revert "Proper combining of nsamples for psuedo-Stokes to pre…
Browse files Browse the repository at this point in the history
…serve proper noise variance""

This reverts commit 36b1e7d.
  • Loading branch information
jsdillon committed Feb 7, 2024
1 parent 36b1e7d commit 7f101f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hera_pspec/pstokes.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ def _combine_pol(uvd1, uvd2, pol1, pol2, pstokes='pI', x_orientation=None):
uvdS.data_array = stdata # pseudo-stokes data
uvdS.flag_array = flag # flag array
uvdS.polarization_array = np.array([pstokes], dtype=int) # polarization number
uvdS.nsample_array = uvd1.nsample_array + uvd2.nsample_array # nsamples
# nsamples combined to preserve proper variance, see hera_pspec issue #391
uvdS.nsample_array = 4 * (uvd1.nsample_array**-1 + uvd2.nsample_array**-1)**-1

uvdS.history = "Merged into pseudo-stokes vis with hera_pspec version {}\n{}" \
"{}{}{}{}\n".format(__version__, "-"*20+'\n',
Expand Down

0 comments on commit 7f101f1

Please sign in to comment.