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

Changed default behaviour of exclude_auto_bls #164

Merged
merged 1 commit into from
Jul 18, 2018
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
17 changes: 15 additions & 2 deletions hera_pspec/pspecdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,7 @@ def trim_dset_lsts(self, lst_tol=6):
def pspec_run(dsets, filename, dsets_std=None, groupname=None, dset_labels=None, dset_pairs=None,
psname_ext=None, spw_ranges=None, n_dlys=None, pol_pairs=None, blpairs=None,
input_data_weight='identity', norm='I', taper='none',
exclude_auto_bls=True, exclude_permutations=True,
exclude_auto_bls=False, exclude_permutations=True,
Nblps_per_group=None, bl_len_range=(0, 1e10), bl_deg_range=(0, 180), bl_error_tol=1.0,
beam=None, cosmo=None, rephase_to_dset=None, trim_dset_lsts=False, broadcast_dset_flags=True,
time_thresh=0.2, Jy2mK=False, overwrite=True, verbose=True, store_cov=False, history=''):
Expand Down Expand Up @@ -2520,7 +2520,7 @@ def pspec_run(dsets, filename, dsets_std=None, groupname=None, dset_labels=None,
If blpairs is None, redundant baseline groups will be formed and
all cross-multiplies will be constructed. In doing so, if
exclude_auto_bls is True, eliminate all instances of a bl crossed
with itself. Default: True
with itself. Default: False

exclude_permutations : boolean
If blpairs is None, redundant baseline groups will be formed and
Expand Down Expand Up @@ -2704,6 +2704,19 @@ def pspec_run(dsets, filename, dsets_std=None, groupname=None, dset_labels=None,
if Jy2mK:
ds.Jy_to_mK()

# Print warning if auto_bls is set to exclude correlations of the
# same baseline with itself, because this may cause a bias if one
# is already cross-correlating different times to avoid noise bias.
# See issue #160 on hera_pspec repo
if exclude_auto_bls:
raise_warning("Skipping the cross-multiplications of a baseline "
"with itself may cause a bias if one is already "
"cross-correlating different times to avoid the "
"noise bias. Please see hera_pspec github issue 160 "
"to make sure you know what you are doing! "
"https://github.com/HERA-Team/hera_pspec/issues/160",
verbose=verbose)

# check dset pair type
err_msg = "dset_pairs must be fed as a list of len-2 integer tuples"
assert isinstance(dset_pairs, list), err_msg
Expand Down