Skip to content

Commit

Permalink
Proper combining of nsamples for psuedo-Stokes to preserve proper noi…
Browse files Browse the repository at this point in the history
…se variance

See issue #391
  • Loading branch information
jsdillon committed Feb 5, 2024
1 parent fc06cf7 commit aca25da
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 aca25da

Please sign in to comment.