Skip to content

Commit

Permalink
Remove references to deprecated low_hi option for get_reds
Browse files Browse the repository at this point in the history
This follows HERA-Team/hera_cal#370 and shouldn't be merged in until that PR is done.
  • Loading branch information
jsdillon committed Oct 10, 2018
1 parent b129d47 commit a45831f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion examples/Bootstrap_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"# Get list of redundant baseline groups\n",
"antpos, ants = ds.dsets[0].get_ENU_antpos(pick_data_ants=True)\n",
"antpos = dict(zip(ants, antpos))\n",
"red_bls = redcal.get_pos_reds(antpos, bl_error_tol=1.0, low_hi=True)\n",
"red_bls = redcal.get_pos_reds(antpos, bl_error_tol=1.0)\n",
"\n",
"# Print members of each redundant baseline group\n",
"for i, redgrp in enumerate(red_bls):\n",
Expand Down
4 changes: 2 additions & 2 deletions hera_pspec/tests/test_grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_bootstrap_resampled_error():
uvd = UVData()
uvd.read_miriad(visfile)
ap, a = uvd.get_ENU_antpos(pick_data_ants=True)
reds = redcal.get_pos_reds(dict(zip(a, ap)), low_hi=True, bl_error_tol=1.0)[:3]
reds = redcal.get_pos_reds(dict(zip(a, ap)), bl_error_tol=1.0)[:3]
uvp = testing.uvpspec_from_data(uvd, reds, spw_ranges=[(50, 100)], beam=beam, cosmo=cosmo)

# Lots of this function is already tested by bootstrap_run
Expand Down Expand Up @@ -190,7 +190,7 @@ def test_bootstrap_run():
uvd = UVData()
uvd.read_miriad(visfile)
ap, a = uvd.get_ENU_antpos(pick_data_ants=True)
reds = redcal.get_pos_reds(dict(zip(a, ap)), low_hi=True, bl_error_tol=1.0)[:3]
reds = redcal.get_pos_reds(dict(zip(a, ap)), bl_error_tol=1.0)[:3]
uvp = testing.uvpspec_from_data(uvd, reds, spw_ranges=[(50, 100)], beam=beam, cosmo=cosmo)
if os.path.exists("ex.h5"):
os.remove("ex.h5")
Expand Down
2 changes: 1 addition & 1 deletion hera_pspec/tests/test_pspecdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ def test_pspec(self):
# check with redundant baseline group list
antpos, ants = uvd.get_ENU_antpos(pick_data_ants=True)
antpos = dict(zip(ants, antpos))
red_bls = map(lambda blg: sorted(blg), redcal.get_pos_reds(antpos, low_hi=True))[2]
red_bls = map(lambda blg: sorted(blg), redcal.get_pos_reds(antpos))[2]
bls1, bls2, blps = utils.construct_blpairs(red_bls, exclude_permutations=True)
uvp = ds.pspec(bls1, bls2, (0, 1), ('xx','xx'), input_data_weight='identity', norm='I', taper='none',
little_h=True, verbose=False)
Expand Down
2 changes: 1 addition & 1 deletion hera_pspec/tests/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_uvpspec_from_data():

# test multiple bl groups
antpos, ants = uvd.get_ENU_antpos(pick_data_ants=True)
reds = redcal.get_pos_reds(dict(zip(ants, antpos)), low_hi=True)
reds = redcal.get_pos_reds(dict(zip(ants, antpos)))
uvp = testing.uvpspec_from_data(fname, reds[:3], beam=beam, spw_ranges=[(50, 100)])
nt.assert_equal(len(set(uvp.bl_array) - set([137138, 137151, 137152, 138139, 138152, 138153, 139153, 139154,
151152, 151167, 152153, 152167, 152168, 153154, 153168, 153169,
Expand Down
2 changes: 1 addition & 1 deletion hera_pspec/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def test_get_blvec_reds():
uvd = UVData()
uvd.read_miriad(fname)
antpos, ants = uvd.get_ENU_antpos(pick_data_ants=True)
reds = redcal.get_pos_reds(dict(zip(ants, antpos)), low_hi=True)
reds = redcal.get_pos_reds(dict(zip(ants, antpos)))
uvp = testing.uvpspec_from_data(fname, reds[:2], spw_ranges=[(10, 40)])

# test execution w/ dictionary
Expand Down
15 changes: 2 additions & 13 deletions hera_pspec/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ def get_bl_lens_angs(blvecs, bl_error_tol=1.0):


def get_reds(uvd, bl_error_tol=1.0, pick_data_ants=False, bl_len_range=(0, 1e4),
bl_deg_range=(0, 180), xants=None, add_autos=False, low_hi=True):
bl_deg_range=(0, 180), xants=None, add_autos=False):
"""
Given a UVData object, a Miriad filepath or antenna position dictionary,
calculate redundant baseline groups using hera_cal.redcal and optionally
Expand Down Expand Up @@ -936,10 +936,6 @@ def get_reds(uvd, bl_error_tol=1.0, pick_data_ants=False, bl_len_range=(0, 1e4),
add_autos : bool
If True, add into autocorrelation group to the redundant group list.
low_hi : bool
If True, if the first bl in a redundant blgroup has ant1 > ant2,
then conjugate all baselines in the group.
Returns (reds, lens, angs)
-------
reds : list
Expand Down Expand Up @@ -967,14 +963,7 @@ def get_reds(uvd, bl_error_tol=1.0, pick_data_ants=False, bl_len_range=(0, 1e4),
antpos_dict = uvd

# get redundant baselines
reds = redcal.get_pos_reds(antpos_dict, bl_error_tol=bl_error_tol, low_hi=False)
if low_hi:
_reds = []
for r in reds:
if r[0][0] > r[0][1]:
r = [_r[::-1] for _r in r]
_reds.append(r)
reds = _reds
reds = redcal.get_pos_reds(antpos_dict, bl_error_tol=bl_error_tol)

# get vectors, len and ang for each baseline group
vecs = np.array([antpos_dict[r[0][0]] - antpos_dict[r[0][1]] for r in reds])
Expand Down
2 changes: 1 addition & 1 deletion scripts/pspec_red.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
# Set-up which baselines to cross-correlate
antpos, ants = dsets[0].get_ENU_antpos(pick_data_ants=True)
antpos = dict(zip(ants, antpos))
red_bls = redcal.get_pos_reds(antpos, bl_error_tol=1.0, low_hi=True)
red_bls = redcal.get_pos_reds(antpos, bl_error_tol=1.0)

# FIXME: Use only the first redundant baseline group for now
bls = red_bls[0]
Expand Down

0 comments on commit a45831f

Please sign in to comment.