Skip to content

Commit

Permalink
added some TODOs/test
Browse files Browse the repository at this point in the history
  • Loading branch information
tgalvin committed Feb 9, 2024
1 parent dcd83fe commit a1b68ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions flint/bptools/smoother.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def smooth_bandpass_complex_gains(
"Consider whether you really want to be smoothing when using continuum data. "
)
for ant in range(ants):
# TODO: This will be smoothing the X_y and Y_x. Should this actually be done?
for pol in range(pols):
smoothed_complex_gains[ant, :, pol].real = smooth_data(
data=complex_gains[ant, :, pol].real,
Expand Down
1 change: 1 addition & 0 deletions flint/calibrate/aocalibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def plot_solutions(
logger.info(f"Overwriting reference antenna selection, using {ref_ant=}")

if ref_ant is not None:
# TODO: This is going to change the amplitudes as well. This is likely not wanted!
data = data / ao_sols.bandpass[plot_sol, ref_ant, :, :]

amplitudes = np.abs(data)
Expand Down
16 changes: 16 additions & 0 deletions tests/test_aocalibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@ def test_known_bad_sols(ao_sols_known_bad):
flag_aosolutions(solutions_path=ao_sols_known_bad, plot_solutions_throughout=False)


def test_sols_same_with_plots(ao_sols_known_bad):
# Had a thought at one point the plktting was updating th mutable numpy array before
# it was writen back to file. Wrote the test, and it passed. Test stays
a = flag_aosolutions(
solutions_path=ao_sols_known_bad, plot_solutions_throughout=False
)
a_loaded = AOSolutions.load(a.path)

b = flag_aosolutions(
solutions_path=ao_sols_known_bad, plot_solutions_throughout=True
)
b_loaded = AOSolutions.load(b.path)

assert np.allclose(a_loaded.bandpass, b_loaded.bandpass, equal_nan=True)


def test_flagged_aosols(ao_sols_known_bad):
flagged_sols = flag_aosolutions(
solutions_path=ao_sols_known_bad,
Expand Down

0 comments on commit a1b68ed

Please sign in to comment.