Skip to content

Commit

Permalink
also reverse convention in lst_cal
Browse files Browse the repository at this point in the history
  • Loading branch information
jsdillon committed Aug 30, 2024
1 parent 57a52aa commit 0529798
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions hera_cal/lst_stack/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _expand_degeneracies_to_ant_gains(
# Map antenna-polarizations to visibility indices
antpol_to_idx = {
utils.split_pol(pol)[0]: polidx
for polidx, pol in enumerate(stack.pols)
for polidx, pol in enumerate(stack.pols)
if utils.split_pol(pol)[0] == utils.split_pol(pol)[1]
}

Expand Down Expand Up @@ -157,8 +157,6 @@ def _expand_degeneracies_to_ant_gains(
per_day_flags, 1.0 + 0.0j, smooth_ant_gain * rephasor.conj()
)



return gains


Expand Down Expand Up @@ -580,7 +578,7 @@ def lstbin_absolute_calibration(
)

if run_cross_pol_phase_cal and not all_nights_flagged:
cross_pols_in_data = any(utils.split_pol(pol)[0] != utils.split_pol(pol)[1] for pol in stack.pols)
cross_pols_in_data = any(utils.split_pol(pol)[0] != utils.split_pol(pol)[1] for pol in stack.pols)

if cross_pols_in_data:
delta = _lstbin_cross_pol_phase_calibration(stack=stack, model=model)
Expand All @@ -595,7 +593,7 @@ def lstbin_absolute_calibration(

for ant in gain_ants:
for pol in unique_pols:
if pol != refpol:
if pol == refpol:
phase_gains[(ant, pol)] = phase_gains.get(
(ant, pol), np.ones_like(delta)
)
Expand Down
2 changes: 1 addition & 1 deletion hera_cal/lst_stack/tests/test_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ def test_relative_phase_calibration(self):
[
np.ones((20, 10, 100)),
np.ones((20, 10, 100)),
np.exp(1j * delta),
np.exp(-1j * delta),
np.exp(1j * delta),
]
)
gains = np.transpose(gains, (1, 2, 3, 0))
Expand Down

0 comments on commit 0529798

Please sign in to comment.