xradio 0.0.55__py3-none-any.whl → 0.0.58__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xradio/__init__.py +2 -2
- xradio/_utils/_casacore/casacore_from_casatools.py +1001 -0
- xradio/_utils/_casacore/tables.py +6 -1
- xradio/_utils/coord_math.py +22 -23
- xradio/_utils/dict_helpers.py +76 -11
- xradio/_utils/schema.py +5 -2
- xradio/_utils/zarr/common.py +1 -73
- xradio/image/_util/_casacore/common.py +11 -3
- xradio/image/_util/_casacore/xds_from_casacore.py +59 -35
- xradio/image/_util/_casacore/xds_to_casacore.py +47 -16
- xradio/image/_util/_fits/xds_from_fits.py +172 -77
- xradio/image/_util/casacore.py +9 -4
- xradio/image/_util/common.py +4 -4
- xradio/image/_util/image_factory.py +8 -8
- xradio/image/image.py +45 -5
- xradio/measurement_set/__init__.py +19 -9
- xradio/measurement_set/_utils/__init__.py +1 -3
- xradio/measurement_set/_utils/_msv2/__init__.py +0 -0
- xradio/measurement_set/_utils/_msv2/_tables/read.py +35 -90
- xradio/measurement_set/_utils/_msv2/_tables/read_main_table.py +6 -686
- xradio/measurement_set/_utils/_msv2/_tables/table_query.py +13 -3
- xradio/measurement_set/_utils/_msv2/conversion.py +129 -145
- xradio/measurement_set/_utils/_msv2/create_antenna_xds.py +9 -16
- xradio/measurement_set/_utils/_msv2/create_field_and_source_xds.py +125 -221
- xradio/measurement_set/_utils/_msv2/msv2_to_msv4_meta.py +1 -2
- xradio/measurement_set/_utils/_msv2/msv4_info_dicts.py +13 -8
- xradio/measurement_set/_utils/_msv2/msv4_sub_xdss.py +27 -72
- xradio/measurement_set/_utils/_msv2/partition_queries.py +5 -262
- xradio/measurement_set/_utils/_msv2/subtables.py +0 -107
- xradio/measurement_set/_utils/_utils/interpolate.py +60 -0
- xradio/measurement_set/_utils/_zarr/encoding.py +2 -7
- xradio/measurement_set/convert_msv2_to_processing_set.py +0 -2
- xradio/measurement_set/load_processing_set.py +2 -2
- xradio/measurement_set/measurement_set_xdt.py +14 -14
- xradio/measurement_set/open_processing_set.py +1 -3
- xradio/measurement_set/processing_set_xdt.py +41 -835
- xradio/measurement_set/schema.py +96 -123
- xradio/schema/check.py +91 -97
- xradio/schema/dataclass.py +159 -22
- xradio/schema/export.py +99 -0
- xradio/schema/metamodel.py +51 -16
- xradio/schema/typing.py +5 -5
- {xradio-0.0.55.dist-info → xradio-0.0.58.dist-info}/METADATA +43 -11
- xradio-0.0.58.dist-info/RECORD +65 -0
- {xradio-0.0.55.dist-info → xradio-0.0.58.dist-info}/WHEEL +1 -1
- xradio/image/_util/fits.py +0 -13
- xradio/measurement_set/_utils/_msv2/_tables/load.py +0 -63
- xradio/measurement_set/_utils/_msv2/_tables/load_main_table.py +0 -487
- xradio/measurement_set/_utils/_msv2/_tables/read_subtables.py +0 -395
- xradio/measurement_set/_utils/_msv2/_tables/write.py +0 -320
- xradio/measurement_set/_utils/_msv2/_tables/write_exp_api.py +0 -385
- xradio/measurement_set/_utils/_msv2/chunks.py +0 -115
- xradio/measurement_set/_utils/_msv2/descr.py +0 -165
- xradio/measurement_set/_utils/_msv2/msv2_msv3.py +0 -7
- xradio/measurement_set/_utils/_msv2/partitions.py +0 -392
- xradio/measurement_set/_utils/_utils/cds.py +0 -40
- xradio/measurement_set/_utils/_utils/xds_helper.py +0 -404
- xradio/measurement_set/_utils/_zarr/read.py +0 -263
- xradio/measurement_set/_utils/_zarr/write.py +0 -329
- xradio/measurement_set/_utils/msv2.py +0 -106
- xradio/measurement_set/_utils/zarr.py +0 -133
- xradio-0.0.55.dist-info/RECORD +0 -77
- {xradio-0.0.55.dist-info → xradio-0.0.58.dist-info}/licenses/LICENSE.txt +0 -0
- {xradio-0.0.55.dist-info → xradio-0.0.58.dist-info}/top_level.txt +0 -0
|
@@ -168,7 +168,7 @@ class ProcessingSetIterator:
|
|
|
168
168
|
def __next__(self):
|
|
169
169
|
try:
|
|
170
170
|
sub_xds_name = next(self.xds_name_iter)
|
|
171
|
-
except Exception
|
|
171
|
+
except Exception:
|
|
172
172
|
raise StopIteration
|
|
173
173
|
|
|
174
174
|
if self.input_data is None:
|
|
@@ -181,7 +181,7 @@ class ProcessingSetIterator:
|
|
|
181
181
|
drop_variables=self.drop_variables,
|
|
182
182
|
load_sub_datasets=self.load_sub_datasets,
|
|
183
183
|
)
|
|
184
|
-
sub_xdt = ps_xdt
|
|
184
|
+
sub_xdt = ps_xdt[sub_xds_name] # Access by name instead of index
|
|
185
185
|
else:
|
|
186
186
|
sub_xdt = self.input_data[sub_xds_name] # In memory
|
|
187
187
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import pandas as pd
|
|
2
|
-
from xradio._utils.list_and_array import to_list
|
|
3
|
-
import xarray as xr
|
|
4
|
-
import numpy as np
|
|
5
|
-
import numbers
|
|
6
|
-
import os
|
|
7
1
|
from collections.abc import Mapping, Iterable
|
|
2
|
+
import datetime
|
|
8
3
|
from typing import Any, Union
|
|
9
4
|
|
|
5
|
+
import numpy as np
|
|
6
|
+
import xarray as xr
|
|
7
|
+
|
|
8
|
+
from xradio._utils.list_and_array import to_list
|
|
9
|
+
|
|
10
10
|
MS_DATASET_TYPES = {"visibility", "spectrum", "radiometer"}
|
|
11
11
|
|
|
12
12
|
|
|
@@ -102,7 +102,7 @@ class MeasurementSetXdt:
|
|
|
102
102
|
data_variables_to_drop = []
|
|
103
103
|
field_and_source_to_drop = []
|
|
104
104
|
for dg_name, dg in self._xdt.attrs["data_groups"].items():
|
|
105
|
-
print(f"Data group: {dg_name}", dg)
|
|
105
|
+
# print(f"Data group: {dg_name}", dg)
|
|
106
106
|
f_and_s = dg["field_and_source"]
|
|
107
107
|
dg_copy = dg.copy()
|
|
108
108
|
dg_copy.pop("date", None)
|
|
@@ -118,8 +118,8 @@ class MeasurementSetXdt:
|
|
|
118
118
|
|
|
119
119
|
sel_ms_xdt = self._xdt
|
|
120
120
|
|
|
121
|
-
print("Data variables to drop: ", data_variables_to_drop)
|
|
122
|
-
print("Field and source to drop: ", field_and_source_to_drop)
|
|
121
|
+
# print("Data variables to drop: ", data_variables_to_drop)
|
|
122
|
+
# print("Field and source to drop: ", field_and_source_to_drop)
|
|
123
123
|
|
|
124
124
|
sel_corr_xds = self._xdt.ds.sel(
|
|
125
125
|
indexers, method, tolerance, drop, **indexers_kwargs
|
|
@@ -152,7 +152,7 @@ class MeasurementSetXdt:
|
|
|
152
152
|
raise InvalidAccessorLocation(f"{self._xdt.path} is not a MSv4 node.")
|
|
153
153
|
|
|
154
154
|
if data_group_name is None:
|
|
155
|
-
if "base" in self._xdt.attrs["data_groups"]
|
|
155
|
+
if "base" in self._xdt.attrs["data_groups"]:
|
|
156
156
|
data_group_name = "base"
|
|
157
157
|
else:
|
|
158
158
|
data_group_name = list(self._xdt.attrs["data_groups"].keys())[0]
|
|
@@ -189,7 +189,7 @@ class MeasurementSetXdt:
|
|
|
189
189
|
)
|
|
190
190
|
|
|
191
191
|
if data_group_name is None:
|
|
192
|
-
if "base" in self._xdt.attrs["data_groups"]
|
|
192
|
+
if "base" in self._xdt.attrs["data_groups"]:
|
|
193
193
|
data_group_name = "base"
|
|
194
194
|
else:
|
|
195
195
|
data_group_name = list(self._xdt.attrs["data_groups"].keys())[0]
|
|
@@ -293,14 +293,14 @@ class MeasurementSetXdt:
|
|
|
293
293
|
), f"Data variable {uvw} not found in dataset."
|
|
294
294
|
|
|
295
295
|
if field_and_source_xds is None:
|
|
296
|
-
field_and_source_xds = default_data_group["
|
|
296
|
+
field_and_source_xds = default_data_group["field_and_source"]
|
|
297
297
|
new_data_group["field_and_source"] = field_and_source_xds
|
|
298
298
|
assert (
|
|
299
299
|
field_and_source_xds in self._xdt.children
|
|
300
300
|
), f"Data variable {field_and_source_xds} not found in dataset."
|
|
301
301
|
|
|
302
302
|
if date_time is None:
|
|
303
|
-
date_time = datetime.now().isoformat()
|
|
303
|
+
date_time = datetime.datetime.now(datetime.timezone.utc).isoformat()
|
|
304
304
|
new_data_group["date"] = date_time
|
|
305
305
|
|
|
306
306
|
if description is None:
|
|
@@ -312,7 +312,7 @@ class MeasurementSetXdt:
|
|
|
312
312
|
return self._xdt
|
|
313
313
|
|
|
314
314
|
def _get_default_data_group_name(self):
|
|
315
|
-
if "base" in self._xdt.attrs["data_groups"]
|
|
315
|
+
if "base" in self._xdt.attrs["data_groups"]:
|
|
316
316
|
data_group_name = "base"
|
|
317
317
|
else:
|
|
318
318
|
data_group_name = list(self._xdt.attrs["data_groups"].keys())[0]
|