Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for minor release #353

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions quartical/data_handling/angles.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@
def assign_parangle_data(ms_path, data_xds_list):

anttab = xds_from_storage_table(ms_path + "::ANTENNA")[0]
feedtab = xds_from_storage_table(ms_path + "::FEED")[0]
feedtab_xdsl = xds_from_storage_table(
ms_path + "::FEED",
group_cols="__row__"
)
fieldtab = xds_from_storage_table(ms_path + "::FIELD")[0]

# We do the following eagerly to reduce graph complexity.
feeds = feedtab.POLARIZATION_TYPE.values
unique_feeds = np.unique(feeds)
unique_feeds = {
pt
for xds in feedtab_xdsl
for pt in xds.POLARIZATION_TYPE.values.ravel()
}

if np.all([feed in "XxYy" for feed in unique_feeds]):
feed_type = "linear"
Expand All @@ -38,12 +44,17 @@ def assign_parangle_data(ms_path, data_xds_list):

phase_dirs = fieldtab.PHASE_DIR.values

receptor_angles = da.concatenate(
[xds.RECEPTOR_ANGLE.data for xds in feedtab_xdsl],
)
receptor_angles = receptor_angles.rechunk((-1, -1))

updated_data_xds_list = []
for xds in data_xds_list:
xds = xds.assign(
{
"RECEPTOR_ANGLE": (
("ant", "feed"), clone(feedtab.RECEPTOR_ANGLE.data)
("ant", "feed"), clone(receptor_angles)
),
"POSITION": (
("ant", "xyz"),
Expand Down