Skip to content

Commit

Permalink
force dtypes to match on uvcal inits, otherwise you get floats
Browse files Browse the repository at this point in the history
  • Loading branch information
mkolopanis committed Nov 27, 2023
1 parent 098c791 commit 489075e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pyuvdata/uvcal/initializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,19 @@ def new_uvcal_from_uvdata(
"ant_array", np.union1d(uvdata.ant_1_array, uvdata.ant_2_array)
)

# Just in case a user inputs their own ant_array kwarg
# make sure this is a numpy array for the following interactions
if not isinstance(ant_array, np.ndarray):
ant_array = np.asarray(ant_array)

Check warning on line 484 in pyuvdata/uvcal/initializers.py

View check run for this annotation

Codecov / codecov/patch

pyuvdata/uvcal/initializers.py#L484

Added line #L484 was not covered by tests

if antenna_numbers is not None:
ant_array = np.intersect1d(ant_array, antenna_numbers)
ant_array = np.intersect1d(
ant_array, np.asarray(antenna_numbers, dtype=ant_array.dtype)
)
elif isinstance(antenna_positions, dict):
ant_array = np.intersect1d(ant_array, list(antenna_positions.keys()))
ant_array = np.intersect1d(
ant_array, np.asarray(list(antenna_positions.keys()), dtype=ant_array.dtype)
)

if jones_array is None:
if np.all(uvdata.polarization_array < -4):
Expand Down

0 comments on commit 489075e

Please sign in to comment.