Skip to content

Commit

Permalink
Now correctly references the Telescope object
Browse files Browse the repository at this point in the history
  • Loading branch information
jade_ducharme@brown.edu authored and bhazelton committed Sep 25, 2024
1 parent 624b925 commit 7c6fd4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/pyuvdata/utils/phasing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2594,7 +2594,8 @@ def _get_focus_xyz(uvd, focus, ra, dec):
obj = SkyCoord(ra * units.deg, dec * units.deg)

# The centre of the ENU frame should be located at the MEDIAN position of the array
antpos = uvd.antenna_positions + uvd.telescope_location
loc = uvd.telescope.location.itrs.cartesian.xyz.value
antpos = uvd.telescope.antenna_positions + loc
x, y, z = np.median(antpos, axis=0)

# Initialize EarthLocation object centred on MWA
Expand Down Expand Up @@ -2639,9 +2640,7 @@ def _get_delay(uvd, focus_x, focus_y, focus_z, flipconj):
ind1, ind2 = _nants_to_nblts(uvd)

# Antenna positions in ENU frame
antpos, ants = uvd.get_ENU_antpos(
center=True
) # Centred on the MEDIAN of the array; antpos has shape (Nants, 3)
antpos = uvd.telescope.get_enu_antpos()

# Get tile positions for each baseline
tile1 = antpos[ind1] # Shape (Nblts, 3)
Expand Down
5 changes: 2 additions & 3 deletions src/pyuvdata/utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def _nants_to_nblts(uvd):
index pairs to compose (Nblts,) shaped arrays for each
baseline from an (Nants,) shaped array
"""
antpos, ants = uvd.get_ENU_antpos()
ants = uvd.telescope.antenna_numbers

ant1 = uvd.ant_1_array
ant2 = uvd.ant_2_array
Expand Down Expand Up @@ -442,8 +442,7 @@ def _get_autocorrelations_mask(uvd):
"""
# Get indices along the Nblts axis corresponding to autocorrelations
autos = []
for i in uvd.antenna_numbers:

for i in uvd.telescope.antenna_numbers:
num = uvd.antpair2ind(i, ant2=i)

if isinstance(num, slice):
Expand Down

0 comments on commit 7c6fd4e

Please sign in to comment.