Skip to content

Commit

Permalink
Fix receptor summary (#310)
Browse files Browse the repository at this point in the history
* Fix version drift.

* Bump to 0.2.0

* Fix incorrect assumption that FEED substable will always have 2 receptors.

* Fix similar problem affecting parallactic angle construction.

* Update missing column selection for compatibility with upsteam changes.
  • Loading branch information
JSKenyon committed Jan 26, 2024
1 parent 5478340 commit 9a3be80
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion quartical/apps/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def feed_info(path):
for i, arrs in enumerate(zipper):
for vals in zip(*arrs):
msg += f" {i:<4} {vals[0]:<8} {' '.join(vals[1]):<8} " \
f"{'{:.4f} {:.4f}'.format(*vals[2]):<16}\n"
f"{' '.join([f'{x:.4f}' for x in vals[2]]):<16}\n"

logger.info(msg)

Expand Down
2 changes: 1 addition & 1 deletion quartical/data_handling/angles.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def make_parangle_xds_list(ms_path, data_xds_list):
coords={
"utime": np.arange(sum(xds.UTIME_CHUNKS)),
"ant": xds.ant,
"receptor": np.arange(2)
"receptor": np.arange(feedtab.dims['receptors'])
},
attrs={
"FEED_TYPE": feed_type,
Expand Down
28 changes: 16 additions & 12 deletions quartical/data_handling/ms_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,23 @@ def read_xds_list(model_columns, ms_opts):
if ms_opts.data_column not in known_data_cols:
schema[ms_opts.data_column] = {'dims': ('chan', 'corr')}

try:
data_xds_list = xds_from_storage_ms(
ms_opts.path,
columns=columns,
index_cols=("TIME",),
group_cols=ms_opts.group_by,
chunks=chunking_per_data_xds,
table_schema=["MS", {**schema}]
data_xds_list = xds_from_storage_ms(
ms_opts.path,
columns=columns,
index_cols=("TIME",),
group_cols=ms_opts.group_by,
chunks=chunking_per_data_xds,
table_schema=["MS", {**schema}]
)

missing_columns = set().union(
*[set(columns) - set(xds.data_vars.keys()) for xds in data_xds_list]
)

if missing_columns:
raise ValueError(
f"Invalid/missing column specified as input: {missing_columns}."
)
except RuntimeError as e:
raise RuntimeError(
f"Invalid/missing column specified. Underlying error: {e}."
) from e

spw_xds_list = xds_from_storage_table(
ms_opts.path + "::SPECTRAL_WINDOW",
Expand Down

0 comments on commit 9a3be80

Please sign in to comment.