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

Fix error in get_ps_freq_axis(), with outdate frame key #300

Merged
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/xradio/measurement_set/processing_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ def _get_ps_freq_axis(self):

spw_ids = []
freq_axis_list = []
frame = self.get(0).frequency.attrs["frame"]
frame = self.get(0).frequency.attrs["observer"]
for ms_xds in self.values():
assert (
frame == ms_xds.frequency.attrs["frame"]
frame == ms_xds.frequency.attrs["observer"]
), "Frequency reference frame not consistent in Processing Set."
if ms_xds.frequency.attrs["spectral_window_id"] not in spw_ids:
spw_ids.append(ms_xds.frequency.attrs["spectral_window_id"])
Expand Down
17 changes: 14 additions & 3 deletions tests/stakeholder/test_measure_set_stakeholder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import pytest
import time

import xarray as xr

from toolviper.utils.data import download
from toolviper.utils.logger import setup_logger
from xradio.measurement_set import (
Expand Down Expand Up @@ -109,10 +111,19 @@ def base_test(
os.system("rm -rf " + str(ps_copy_name)) # Remove ps copy folder.

ps_lazy_df = ps_lazy.summary()
assert "name" in ps_lazy_df
ps_df = ps.summary()

ps.get_combined_field_and_source_xds()
ps.get_combined_antenna_xds()
assert "name" in ps_df

max_dims = ps.get_ps_max_dims()
assert type(max_dims) == dict
if not is_s3 and not preconverted:
freq_axis = ps.get_ps_freq_axis()
assert type(freq_axis) == xr.DataArray
combined_field_xds = ps.get_combined_field_and_source_xds()
assert type(combined_field_xds) == tuple
combined_antenna = ps.get_combined_antenna_xds()
assert type(combined_antenna) == xr.Dataset
ps.get_combined_field_and_source_xds()

sum = 0.0
Expand Down
Loading