Skip to content

Commit

Permalink
Fix some freq_interp_kind issues I missed in #442
Browse files Browse the repository at this point in the history
  • Loading branch information
bhazelton committed Feb 1, 2024
1 parent ea299ad commit 48f999a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion pyuvsim/tests/test_antenna.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def test_jones_set_spline(cst_beam, hera_loc):
# Run get_beam_jones with spline options.
array_location = hera_loc
beam0 = cst_beam.copy()
beam0.freq_interp_kind = 'cubic'
if hasattr(beam0, "_freq_interp_kind"):
# this can go away when we require pyuvdata version >= 2.4.2
beam0.freq_interp_kind = "cubic"
telescope_config_name = os.path.join(SIM_DATA_PATH, 'mwa128_config.yaml')
with open(telescope_config_name, 'r') as yf:
telconfig = yaml.safe_load(yf)
Expand Down
3 changes: 2 additions & 1 deletion pyuvsim/tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ def test_analytic_diffuse(model, tmpdir):
@pytest.mark.filterwarnings("ignore:Fixing auto polarization power beams")
def test_powerbeam_sim(cst_beam):
new_cst = copy.deepcopy(cst_beam)
new_cst.freq_interp_kind = 'nearest' # otherwise we get an error about freq interpolation
if hasattr(new_cst, "_freq_interp_kind"):
new_cst.freq_interp_kind = 'nearest' # otherwise we get an error about freq interpolation
new_cst.efield_to_power()
beams = BeamList([new_cst] * 4)
cfg = os.path.join(SIM_DATA_PATH, 'test_config', 'param_1time_1src_testcat.yaml')
Expand Down
5 changes: 3 additions & 2 deletions pyuvsim/tests/test_telescope.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ def test_convert_loop(beam_objs):
assert beamlist._str_beam_list == []

# Reset UVBeams
beams[0].freq_interp_kind = None
beams[1].freq_interp_kind = None
if hasattr(beams[0], "_freq_interp_kind"):
beams[0].freq_interp_kind = None
beams[1].freq_interp_kind = None


def test_object_mode(beam_objs):
Expand Down
6 changes: 5 additions & 1 deletion pyuvsim/tests/test_uvsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ def multi_beams():
beam0.read_beamfits(herabeam_default)
beam0.use_future_array_shapes()
beam0.extra_keywords['beam_path'] = herabeam_default
beam0.freq_interp_kind = 'cubic'

if hasattr(beam0, "_freq_interp_kind"):
# this can go away when we require pyuvdata version >= 2.4.2
beam0.freq_interp_kind = "cubic"

if hasattr(beam0, "_interpolation_function"):
beam0.interpolation_function = 'az_za_simple'
beam1 = pyuvsim.AnalyticBeam('uniform')
Expand Down

0 comments on commit 48f999a

Please sign in to comment.