Skip to content

Commit

Permalink
Removed unproject_near_field function since unproject_phase automatic…
Browse files Browse the repository at this point in the history
…ally unprojects the near field corrections.
  • Loading branch information
jade_ducharme@brown.edu committed Jan 10, 2025
1 parent c0a13d0 commit 8819458
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
4 changes: 3 additions & 1 deletion src/pyuvdata/utils/phasing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2652,7 +2652,9 @@ def _get_delay(uvd, focus_x, focus_y, focus_z, flipconj):
ind1, ind2 = _nants_to_nblts(uvd)

Check warning on line 2652 in src/pyuvdata/utils/phasing.py

View check run for this annotation

Codecov / codecov/patch

src/pyuvdata/utils/phasing.py#L2652

Added line #L2652 was not covered by tests

# Antenna positions in ENU frame
antpos = uvd.telescope.get_enu_antpos()
antpos = uvd.telescope.get_enu_antpos() - np.median(

Check warning on line 2655 in src/pyuvdata/utils/phasing.py

View check run for this annotation

Codecov / codecov/patch

src/pyuvdata/utils/phasing.py#L2655

Added line #L2655 was not covered by tests
uvd.telescope.get_enu_antpos(), axis=0
)

# Get tile positions for each baseline
tile1 = antpos[ind1] # Shape (Nblts, 3)
Expand Down
27 changes: 1 addition & 26 deletions src/pyuvdata/uvdata/uvdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4354,24 +4354,6 @@ def _apply_w_proj(self, *, new_w_vals, old_w_vals, select_mask=None):
(-1j * 2 * np.pi) * delta_w_lambda[:, :, None]
)

def unproject_near_field(self, flipconj=False):
"""
Undo near-field phasing.

TODO: How to implement this/Is it needed?

Parameters
----------
flipconj : bool
Is the conjugation scheme "flipped" compared to
what pyuvdata expects? (Default False)

Returns
-------
None (performs operations inplace)
"""
pass

def unproject_phase(
self, *, use_ant_pos=True, select_mask=None, cat_name="unprojected"
):
Expand All @@ -4396,9 +4378,6 @@ def unproject_phase(
ValueError
If the object is alread unprojected.
"""
# Start by undoing the near-field phasing
# self.unproject_near_field()

# select_mask_use is length Nblts, True means should be unprojected
# only select blts that are actually phased.
if select_mask is not None:
Expand Down Expand Up @@ -4813,10 +4792,6 @@ def phase(
If the `cat_name` is None.

"""
# key = list(self.phase_center_catalog.keys())[-1]
# if self.phase_center_catalog[key]["cat_name"] != "":
# self.unproject_near_field()

if cat_type != "unprojected":
if lon is None:
if ra is None:
Expand All @@ -4841,7 +4816,7 @@ def phase(
dist_qt = copy.deepcopy(dist)

Check warning on line 4816 in src/pyuvdata/uvdata/uvdata.py

View check run for this annotation

Codecov / codecov/patch

src/pyuvdata/uvdata/uvdata.py#L4815-L4816

Added lines #L4815 - L4816 were not covered by tests
else:
if cat_type == "near_field":
dist_qt = dist * units.meters
dist_qt = dist * units.m

Check warning on line 4819 in src/pyuvdata/uvdata/uvdata.py

View check run for this annotation

Codecov / codecov/patch

src/pyuvdata/uvdata/uvdata.py#L4818-L4819

Added lines #L4818 - L4819 were not covered by tests
else:
dist_qt = dist * units.parsec

Check warning on line 4821 in src/pyuvdata/uvdata/uvdata.py

View check run for this annotation

Codecov / codecov/patch

src/pyuvdata/uvdata/uvdata.py#L4821

Added line #L4821 was not covered by tests

Expand Down

1 comment on commit 8819458

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 8819458 Previous: bca6cf0 Ratio
tests/utils/test_bls.py::test_ants_to_bls[min=65536-len=1] 526941.2103819263 iter/sec (stddev: 0.00003776292233900853) 1118098.7998865496 iter/sec (stddev: 0.000004509898635463271) 2.12

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.