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

Proper combining of nsamples for psuedo-Stokes to preserve proper noise variance #392

Merged
merged 1 commit into from
Feb 7, 2024
Merged
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
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
Loading