Skip to content

Commit

Permalink
fix bug with telescope frame in uvdata._set_app_coords_helper
Browse files Browse the repository at this point in the history
  • Loading branch information
bhazelton committed Mar 19, 2024
1 parent ed5393d commit 63c8373
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions pyuvdata/uvdata/tests/test_ms.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def test_read_nrao_loopback(tmp_path, nrao_uv, telescope_frame):
)
uvobj.antenna_positions = new_full_antpos - uvobj.telescope_location
uvobj.set_lsts_from_time_array()
uvobj.set_uvws_from_antenna_positions()
uvobj._set_app_coords_helper()
uvobj.check()

expected_extra_keywords = ["DATA_COL", "observer"]
Expand Down
2 changes: 2 additions & 0 deletions pyuvdata/uvdata/tests/test_uvfits.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,8 @@ def test_readwriteread(tmp_path, casa_uvfits, future_shapes, telescope_frame, se
)
uv_in.antenna_positions = new_full_antpos - uv_in.telescope_location
uv_in.set_lsts_from_time_array()
uv_in.set_uvws_from_antenna_positions()
uv_in._set_app_coords_helper()
uv_in.check()

uv_out = UVData()
Expand Down
14 changes: 9 additions & 5 deletions pyuvdata/uvdata/uvdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2509,6 +2509,8 @@ def _set_app_coords_helper(self, pa_only=False):
time_array=self.time_array[select_mask],
lst_array=self.lst_array[select_mask],
telescope_loc=self.telescope_location_lat_lon_alt,
telescope_frame=self._telescope_location.frame,
lunar_ellipsoid=self._telescope_location.lunar_ellipsoid,
coord_type=cat_type,
)

Expand All @@ -2524,12 +2526,14 @@ def _set_app_coords_helper(self, pa_only=False):
epoch = temp_dict.get("cat_epoch")
if not frame == "altaz":
frame_pa[select_mask] = uvutils.calc_frame_pos_angle(
self.time_array[select_mask],
app_ra[select_mask],
app_dec[select_mask],
self.telescope_location_lat_lon_alt,
frame,
time_array=self.time_array[select_mask],
app_ra=app_ra[select_mask],
app_dec=app_dec[select_mask],
telescope_loc=self.telescope_location_lat_lon_alt,
ref_frame=frame,
ref_epoch=epoch,
telescope_frame=self._telescope_location.frame,
lunar_ellipsoid=self._telescope_location.lunar_ellipsoid,
)
self.phase_center_app_ra = app_ra
self.phase_center_app_dec = app_dec
Expand Down

0 comments on commit 63c8373

Please sign in to comment.