xradio 0.0.56__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 +12 -2
- xradio/_utils/_casacore/tables.py +1 -0
- 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/xds_from_casacore.py +49 -33
- xradio/image/_util/_casacore/xds_to_casacore.py +41 -14
- xradio/image/_util/_fits/xds_from_fits.py +146 -35
- xradio/image/_util/casacore.py +4 -3
- 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 +17 -76
- xradio/measurement_set/_utils/_msv2/_tables/read_main_table.py +2 -685
- xradio/measurement_set/_utils/_msv2/conversion.py +123 -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 +8 -7
- xradio/measurement_set/_utils/_msv2/msv4_sub_xdss.py +27 -72
- xradio/measurement_set/_utils/_msv2/partition_queries.py +1 -261
- 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 +95 -122
- 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.56.dist-info → xradio-0.0.58.dist-info}/METADATA +2 -1
- xradio-0.0.58.dist-info/RECORD +65 -0
- {xradio-0.0.56.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 -66
- xradio/measurement_set/_utils/_msv2/_tables/load_main_table.py +0 -490
- xradio/measurement_set/_utils/_msv2/_tables/read_subtables.py +0 -398
- xradio/measurement_set/_utils/_msv2/_tables/write.py +0 -323
- xradio/measurement_set/_utils/_msv2/_tables/write_exp_api.py +0 -388
- 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.56.dist-info/RECORD +0 -78
- {xradio-0.0.56.dist-info → xradio-0.0.58.dist-info}/licenses/LICENSE.txt +0 -0
- {xradio-0.0.56.dist-info → xradio-0.0.58.dist-info}/top_level.txt +0 -0
xradio/schema/metamodel.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
from
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass, MISSING
|
|
2
4
|
import typing
|
|
3
5
|
|
|
4
6
|
__all__ = [
|
|
7
|
+
"ValueSchema",
|
|
5
8
|
"AttrSchemaRef",
|
|
6
9
|
"ArraySchema",
|
|
7
10
|
"ArraySchemaRef",
|
|
@@ -10,8 +13,44 @@ __all__ = [
|
|
|
10
13
|
]
|
|
11
14
|
|
|
12
15
|
|
|
13
|
-
@dataclass
|
|
14
|
-
class
|
|
16
|
+
@dataclass
|
|
17
|
+
class ValueSchema:
|
|
18
|
+
"""
|
|
19
|
+
Schema information about a value in an attribute or dictionary.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
type: typing.Literal[
|
|
23
|
+
"bool", "str", "int", "float", "list[str]", "dict", "dataarray"
|
|
24
|
+
]
|
|
25
|
+
"""
|
|
26
|
+
Type of value
|
|
27
|
+
|
|
28
|
+
* ``bool``: A boolean
|
|
29
|
+
* ``str``: A UTF-8 string
|
|
30
|
+
* ``int``: A 64-bit signed integer
|
|
31
|
+
* ``float``: A double-precision floating point number
|
|
32
|
+
* ``list[str]``: A list of strings
|
|
33
|
+
* ``dict``: Dictionary
|
|
34
|
+
* ``dataarray``: An xarray dataarray (encoded using ``to_dict``)
|
|
35
|
+
"""
|
|
36
|
+
dict_schema: typing.Optional[DictSchema] = None
|
|
37
|
+
"""
|
|
38
|
+
Dictionary schema, if it is an xarray DataArray
|
|
39
|
+
"""
|
|
40
|
+
array_schema: typing.Optional[ArraySchema] = None
|
|
41
|
+
"""
|
|
42
|
+
Array schema, if it is an xarray DataArray
|
|
43
|
+
"""
|
|
44
|
+
literal: typing.Optional[typing.List[typing.Any]] = None
|
|
45
|
+
"""
|
|
46
|
+
Allowed literal values, if specified.
|
|
47
|
+
"""
|
|
48
|
+
optional: bool = False
|
|
49
|
+
"""Is the value optional?"""
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@dataclass
|
|
53
|
+
class AttrSchemaRef(ValueSchema):
|
|
15
54
|
"""
|
|
16
55
|
Schema information about an attribute as referenced from an array or
|
|
17
56
|
dataset schema.
|
|
@@ -20,18 +59,11 @@ class AttrSchemaRef:
|
|
|
20
59
|
in the array or dataset schema definition.
|
|
21
60
|
"""
|
|
22
61
|
|
|
23
|
-
name: str
|
|
62
|
+
name: str = ""
|
|
24
63
|
"""Name of attribute as given in data array / dataset."""
|
|
25
|
-
|
|
26
|
-
"""
|
|
27
|
-
Python type of attribute. Note that this might again be a data
|
|
28
|
-
array or dataset, but we don't track that explicitly.
|
|
29
|
-
"""
|
|
30
|
-
optional: bool
|
|
31
|
-
"""Is the attribute optional?"""
|
|
32
|
-
default: typing.Optional[typing.Any]
|
|
64
|
+
default: typing.Optional[typing.Any] = None
|
|
33
65
|
"""If optional: What is the default value?"""
|
|
34
|
-
docstring: str
|
|
66
|
+
docstring: str = ""
|
|
35
67
|
"""Documentation string of attribute reference"""
|
|
36
68
|
|
|
37
69
|
|
|
@@ -49,8 +81,11 @@ class ArraySchema:
|
|
|
49
81
|
"""(Class) name of the schema"""
|
|
50
82
|
dimensions: typing.List[typing.List[str]]
|
|
51
83
|
"""List of possible dimensions"""
|
|
52
|
-
dtypes: typing.List[typing.List[
|
|
53
|
-
"""List of possible
|
|
84
|
+
dtypes: typing.List[typing.List[str]]
|
|
85
|
+
"""List of possible dtype options, where each inner list contains
|
|
86
|
+
(numpy) types as array interface protocol descriptors (e.g. `">f4"`).
|
|
87
|
+
Each inner list corresponds to a possible configuration of dtypes
|
|
88
|
+
for the data array."""
|
|
54
89
|
|
|
55
90
|
coordinates: typing.List["ArraySchemaRef"]
|
|
56
91
|
"""Coordinates data arrays giving values to dimensions"""
|
|
@@ -97,7 +132,7 @@ class ArraySchemaRef(ArraySchema):
|
|
|
97
132
|
"""Name of array schema as given in dataset."""
|
|
98
133
|
optional: bool
|
|
99
134
|
"""Is the data array optional?"""
|
|
100
|
-
default: typing.Optional[typing.Any]
|
|
135
|
+
default: typing.Optional[typing.Any] = None
|
|
101
136
|
"""If optional: What is the default value?"""
|
|
102
137
|
docstring: typing.Optional[str] = None
|
|
103
138
|
"""Documentation string of array reference"""
|
xradio/schema/typing.py
CHANGED
|
@@ -312,26 +312,26 @@ def get_dims(tp: Any) -> List[Dims]:
|
|
|
312
312
|
|
|
313
313
|
dims_out = []
|
|
314
314
|
for dim in dims_in:
|
|
315
|
-
args = get_args(dim)
|
|
315
|
+
args = list(get_args(dim))
|
|
316
316
|
origin = get_origin(dim)
|
|
317
317
|
|
|
318
318
|
# One-dimensional dimension
|
|
319
319
|
if origin is Literal:
|
|
320
|
-
dims_out.append(
|
|
320
|
+
dims_out.append([str(args[0])])
|
|
321
321
|
continue
|
|
322
322
|
|
|
323
323
|
if not (origin is tuple or origin is Tuple):
|
|
324
324
|
raise TypeError(f"Could not find any dims in {tp!r}.")
|
|
325
325
|
|
|
326
326
|
# Zero-dimensions
|
|
327
|
-
if args ==
|
|
328
|
-
dims_out.append(
|
|
327
|
+
if args == [] or args == [()]:
|
|
328
|
+
dims_out.append([])
|
|
329
329
|
continue
|
|
330
330
|
|
|
331
331
|
if not all(get_origin(arg) is Literal for arg in args):
|
|
332
332
|
raise TypeError(f"Could not find any dims in {tp!r}.")
|
|
333
333
|
|
|
334
|
-
dims_out.append(
|
|
334
|
+
dims_out.append([str(get_args(arg)[0]) for arg in args])
|
|
335
335
|
|
|
336
336
|
return dims_out
|
|
337
337
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xradio
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.58
|
|
4
4
|
Summary: Xarray Radio Astronomy Data IO
|
|
5
5
|
Author-email: Jan-Willem Steeb <jsteeb@nrao.edu>, Federico Montesino Pouzols <pouzols@eso.edu>, Dave Mehringer <dmehring@nrao.edu>, Peter Wortmann <peter.wortmann@skao.int>
|
|
6
6
|
License: BSD 3-Clause License
|
|
@@ -50,6 +50,7 @@ Requires-Dist: zarr<3,>=2
|
|
|
50
50
|
Requires-Dist: pyarrow
|
|
51
51
|
Requires-Dist: typeguard
|
|
52
52
|
Requires-Dist: numcodecs<0.16
|
|
53
|
+
Requires-Dist: psutil
|
|
53
54
|
Provides-Extra: test
|
|
54
55
|
Requires-Dist: pytest; extra == "test"
|
|
55
56
|
Requires-Dist: pytest-cov; extra == "test"
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
xradio/__init__.py,sha256=YTpM274ZBWK14HmIXyah27yiKPsmR6xCILvlXkQrYG4,387
|
|
2
|
+
xradio/_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
xradio/_utils/coord_math.py,sha256=ZdbgStXqQ_HS7qQ9UBPk8Z3Zse5P_DrYQsgn2UCf22U,3342
|
|
4
|
+
xradio/_utils/dict_helpers.py,sha256=a4veG6Dgwmtb9yO0kV9qvcQ9IZAKKrC9rAJ_m4EukcE,4072
|
|
5
|
+
xradio/_utils/list_and_array.py,sha256=fW0LDSXlPrSQguSUcZM5oy2Zw-KQVqq9vmmLS8jhc70,4340
|
|
6
|
+
xradio/_utils/schema.py,sha256=OYfAljwNU94KyxGSpKuKxSzSdebW6T43RkMA13aTaeU,7615
|
|
7
|
+
xradio/_utils/_casacore/casacore_from_casatools.py,sha256=ugmWEIzJbuXsPDgJbtuzv0qSXx5Vybu8Sp73NAFt5oQ,31207
|
|
8
|
+
xradio/_utils/_casacore/tables.py,sha256=puRidbjtVx6caEG_Z5TebTLdTUbtBUhzvqByKLQTHfo,1389
|
|
9
|
+
xradio/_utils/zarr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
xradio/_utils/zarr/common.py,sha256=rqqGAogp75xCE9ZiUvV-cU2n4aOw2qHycKh0F_EW518,2964
|
|
11
|
+
xradio/image/__init__.py,sha256=HAD0GfopIbhdxOYckyW6S9US_dSWmZrwIl3FHUzZwrE,435
|
|
12
|
+
xradio/image/image.py,sha256=L-6hhAbO6Bm1zbPRzcl_P3REjHyjFd2rjQvnpYO5Q8Q,16726
|
|
13
|
+
xradio/image/_util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
xradio/image/_util/casacore.py,sha256=_o8767_zYGbXMqqN4k4clq2VhfgEls09h2WXInKEFe0,4615
|
|
15
|
+
xradio/image/_util/common.py,sha256=VGJ21x-Uifk9kf_O6o7URwesYInVZeMh1RLCXQOlgq0,8428
|
|
16
|
+
xradio/image/_util/image_factory.py,sha256=TSrbrrcjK5qzPU5MipGMw3W7aHJFCcmVrZ80CiVpprQ,8613
|
|
17
|
+
xradio/image/_util/zarr.py,sha256=lhQqVRC1GEWClG3zRbuDr2IlQBfXeDqaLUJIN-MVMxA,1652
|
|
18
|
+
xradio/image/_util/_casacore/__init__.py,sha256=OlsiRE40o1jSbBI4khgQQzgfDYbAlOMKIhO4UFlbGhg,41
|
|
19
|
+
xradio/image/_util/_casacore/common.py,sha256=2a88YrveQY9x8bcM7SQSn-L5y60W92rLW34OXC5VwSs,1764
|
|
20
|
+
xradio/image/_util/_casacore/xds_from_casacore.py,sha256=egL5pavyYs66sAHuWQGywnZUmaSle1IPtHSPeG25F1M,43731
|
|
21
|
+
xradio/image/_util/_casacore/xds_to_casacore.py,sha256=RO8xOU2DwjNyLfAmAZAz9dCAf_RSlLotRVYRBLhnGOI,17938
|
|
22
|
+
xradio/image/_util/_fits/xds_from_fits.py,sha256=DsuKAer43rWwDjA9gFNs2sCqFrFVdFW6O0i21RVZzzE,34654
|
|
23
|
+
xradio/image/_util/_zarr/common.py,sha256=ltlj3uFa-uv8lXlDtV79QnfNmfm0tyhXN5FDAjZtjzg,308
|
|
24
|
+
xradio/image/_util/_zarr/xds_from_zarr.py,sha256=KMsfaSSm9kyVoztS6pUzGNxMZzQnCxkk0kDv2GxW5Kw,4451
|
|
25
|
+
xradio/image/_util/_zarr/xds_to_zarr.py,sha256=nsDvDD-kuMuMF2dDlj0jTxSW4mdR-jjIsvXHi5uIERU,2373
|
|
26
|
+
xradio/image/_util/_zarr/zarr_low_level.py,sha256=xnYm6EmVbmLxMlOSXH32SABfQBLHfr2H9ch9gYwFNXs,13338
|
|
27
|
+
xradio/measurement_set/__init__.py,sha256=rGhy9tz5d60hln-SSWFLieDrZ2sodli3npKuCEQc8bc,1127
|
|
28
|
+
xradio/measurement_set/convert_msv2_to_processing_set.py,sha256=ffdqpNQE01YHP_rXR74EvNtGVYaxBlY646vzh3Aimeo,9666
|
|
29
|
+
xradio/measurement_set/load_processing_set.py,sha256=r_eO7DTr-3EphujOEh-P_VfcVRpYzx1M-tGBwpxFC-8,8201
|
|
30
|
+
xradio/measurement_set/measurement_set_xdt.py,sha256=xcnxJjgqhozApceSG65kbMfnALWF34bl_Nh7joTvanY,11970
|
|
31
|
+
xradio/measurement_set/open_processing_set.py,sha256=yfXhs1co8UBf4-m7LLAnc7lV2hFvGKV-HwQ_yAcusH8,5243
|
|
32
|
+
xradio/measurement_set/processing_set_xdt.py,sha256=EOOP7vaAU4JnE3eEC-ffVVNvAkyqTIHyFr5i-FL6QqU,33985
|
|
33
|
+
xradio/measurement_set/schema.py,sha256=pW3WGKZcSO-KEQp8XDomXx3dKuBrybdmuzk8tL7w8iQ,89510
|
|
34
|
+
xradio/measurement_set/_utils/__init__.py,sha256=iTbgPiQPw9hyXSdQYPcwGRrP2PFXgF6CZi8A3KNKya0,43
|
|
35
|
+
xradio/measurement_set/_utils/_msv2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
|
+
xradio/measurement_set/_utils/_msv2/conversion.py,sha256=oWzWPAUk9Y7dRd2XxuJkSgPtUYubyAg3yCf1riIs9WI,52895
|
|
37
|
+
xradio/measurement_set/_utils/_msv2/create_antenna_xds.py,sha256=s3HnTbyOl7h6pAocJ4dpd095s7qHSSngeQ34Ygo8Uk0,17650
|
|
38
|
+
xradio/measurement_set/_utils/_msv2/create_field_and_source_xds.py,sha256=FEV2-K1XMkuepWSsiUeCcC-4NSKlOCv_4w3dr3BHwyA,33495
|
|
39
|
+
xradio/measurement_set/_utils/_msv2/msv2_to_msv4_meta.py,sha256=ZpxJJ2yTjjEy6A4XWS9eT-1J92jLwR8CNyoDBfhAVm8,1572
|
|
40
|
+
xradio/measurement_set/_utils/_msv2/msv4_info_dicts.py,sha256=s7K4MUWtrxKG9e6brNSXXJ6EYvsUf30PYEkkb1P13Mc,7320
|
|
41
|
+
xradio/measurement_set/_utils/_msv2/msv4_sub_xdss.py,sha256=HhkDZYh8fWTM89nUzCAAbHV6EKDWsUq-3GpKisSnZas,30462
|
|
42
|
+
xradio/measurement_set/_utils/_msv2/optimised_functions.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
|
+
xradio/measurement_set/_utils/_msv2/partition_queries.py,sha256=1dzwAVraEktkMl8MYn6bzhjlpCCSgy6KTqlTmjeC3nQ,5661
|
|
44
|
+
xradio/measurement_set/_utils/_msv2/subtables.py,sha256=mrf7g7mbC4crtnQ0wFocPcFRNlvq_7e7iDzE5B6ugl4,843
|
|
45
|
+
xradio/measurement_set/_utils/_msv2/_tables/read.py,sha256=tW0ROevR4tXpydIWuj2UyNhWNtvkKU9NkYxMi1ZoVKc,45421
|
|
46
|
+
xradio/measurement_set/_utils/_msv2/_tables/read_main_table.py,sha256=FFoTVpY8JNvcXnTvUiraWNU9gB9-_9GR7he0NbODabg,3168
|
|
47
|
+
xradio/measurement_set/_utils/_msv2/_tables/table_query.py,sha256=Uc1zeiU-rYtCsYXpij8jzFG5NPBYvIh70qW1srn7B98,1498
|
|
48
|
+
xradio/measurement_set/_utils/_utils/interpolate.py,sha256=LlDYi-h7aj_tsuZqAu5Kr-vOi6fVBPpVbew-i-HnmA0,1962
|
|
49
|
+
xradio/measurement_set/_utils/_utils/partition_attrs.py,sha256=JaePHts_A0EbB4K-0a_uC98RZ2EmfjB9pDSEI11oAwk,3401
|
|
50
|
+
xradio/measurement_set/_utils/_utils/stokes_types.py,sha256=DMa8TmmS7BQ99Xm8c7ZjcRapMtLbrKVxrt4f0qUIOvg,561
|
|
51
|
+
xradio/measurement_set/_utils/_zarr/encoding.py,sha256=ze5ncHEBa-sVwJCayJa2irOdaxZEkYfBKObuij7uVRc,371
|
|
52
|
+
xradio/schema/__init__.py,sha256=EzEMnOtN8G_wdjo8QBRKfq5MrYgfr_nt1pfunlI6i6Q,733
|
|
53
|
+
xradio/schema/bases.py,sha256=dk24pFhugCe5RjaR41xxP38FxVVsIC9bdmBdsarwFvk,17162
|
|
54
|
+
xradio/schema/check.py,sha256=TTr7e-kZXOgqf4cih61BVQb9e28HTTuyFJC_OrcLLRg,21938
|
|
55
|
+
xradio/schema/dataclass.py,sha256=gzNqXzkBLV7ETEyddNOd_jRgP8rkivCkfUlURLz8z5c,19300
|
|
56
|
+
xradio/schema/export.py,sha256=_dqUToirb_T6eC_x2b4bzhUtDSB6VmvLTC8kW9z2XOI,2781
|
|
57
|
+
xradio/schema/metamodel.py,sha256=M_df1ffQEzVL_UV9T5ueqG-8Ywg9qf3dPbl0dlynVdk,4872
|
|
58
|
+
xradio/schema/typing.py,sha256=BJactfOKXgnIm4Y7BZE72lLKYhPt-N0xxlMjkTL6ecY,10438
|
|
59
|
+
xradio/sphinx/__init__.py,sha256=VGY-7Ty3q67qpnBee0-znbiJ-Iy0F93UO--IpjEdHXc,380
|
|
60
|
+
xradio/sphinx/schema_table.py,sha256=uq33habbAbReqnEG6ASKSd4UOMZGUzA3qoTX45rq84U,12373
|
|
61
|
+
xradio-0.0.58.dist-info/licenses/LICENSE.txt,sha256=9CYIJt7riOXo9AD0eXBZviLxo_HebD-2JJI8oiWtzfg,1807
|
|
62
|
+
xradio-0.0.58.dist-info/METADATA,sha256=OTKLv6RbyjAVkBphhGsSJ_0KOOMeGP14SYnxAK6g7_M,6827
|
|
63
|
+
xradio-0.0.58.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
64
|
+
xradio-0.0.58.dist-info/top_level.txt,sha256=dQu27fGBZJ2Yk-gW5XeD-dZ76Xa4Xcvk60Vz-dwXp7k,7
|
|
65
|
+
xradio-0.0.58.dist-info/RECORD,,
|
xradio/image/_util/fits.py
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
|
-
import xarray as xr
|
|
4
|
-
|
|
5
|
-
from ._fits.xds_from_fits import _fits_image_to_xds
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def _read_fits_image(
|
|
9
|
-
infile: str, chunks: dict, verbose: bool, do_sky_coords: bool
|
|
10
|
-
) -> xr.Dataset:
|
|
11
|
-
img_full_path = os.path.expanduser(infile)
|
|
12
|
-
xds = _fits_image_to_xds(img_full_path, chunks, verbose, do_sky_coords)
|
|
13
|
-
return xds
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
from typing import Tuple
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
|
|
5
|
-
try:
|
|
6
|
-
from casacore import tables
|
|
7
|
-
except ImportError:
|
|
8
|
-
import xradio._utils._casacore.casacore_from_casatools as tables
|
|
9
|
-
from ....._utils.common import get_pad_value
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def load_col_chunk(
|
|
13
|
-
tb_tool: tables.table,
|
|
14
|
-
col: str,
|
|
15
|
-
cshape: Tuple[int],
|
|
16
|
-
tidxs: np.ndarray,
|
|
17
|
-
bidxs: np.ndarray,
|
|
18
|
-
didxs: np.ndarray,
|
|
19
|
-
d1: Tuple[int, int],
|
|
20
|
-
d2: Tuple[int, int],
|
|
21
|
-
) -> np.ndarray:
|
|
22
|
-
"""
|
|
23
|
-
Loads a slice of a col (using casacore getcol(slice))
|
|
24
|
-
|
|
25
|
-
Parameters
|
|
26
|
-
----------
|
|
27
|
-
tb_tool : tables.table
|
|
28
|
-
a table/TaQL query open and being used to load columns
|
|
29
|
-
col : str
|
|
30
|
-
colum to load
|
|
31
|
-
cshape : Tuple[int]
|
|
32
|
-
shape of the resulting col data chunk
|
|
33
|
-
tidxs : np.ndarray
|
|
34
|
-
time axis indices
|
|
35
|
-
bidxs : np.ndarray
|
|
36
|
-
baseline axis indices
|
|
37
|
-
didxs : np.ndarray
|
|
38
|
-
effective) data indices, excluding missing baselines
|
|
39
|
-
d1 : Tuple[int, int]
|
|
40
|
-
indices to load on dimension 1 (None=all, pols or chans)
|
|
41
|
-
d2 : Tuple[int, int]
|
|
42
|
-
indices to load on dimension 2 (None=all, pols)
|
|
43
|
-
|
|
44
|
-
Returns
|
|
45
|
-
-------
|
|
46
|
-
np.ndarray
|
|
47
|
-
data array loaded directly with casacore getcol/getcolslice
|
|
48
|
-
"""
|
|
49
|
-
|
|
50
|
-
if (len(cshape) == 2) or (col == "UVW"):
|
|
51
|
-
# all the scalars and UVW
|
|
52
|
-
data = np.array(tb_tool.getcol(col, 0, -1))
|
|
53
|
-
elif len(cshape) == 3:
|
|
54
|
-
# WEIGHT, SIGMA
|
|
55
|
-
data = tb_tool.getcolslice(col, d1[0], d1[1], [], 0, -1)
|
|
56
|
-
elif len(cshape) == 4:
|
|
57
|
-
# DATA, FLAG, WEIGHT_SPECTRUM / SIGMA_SPECTRUM
|
|
58
|
-
data = tb_tool.getcolslice(col, (d1[0], d2[0]), (d1[1], d2[1]), [], 0, -1)
|
|
59
|
-
|
|
60
|
-
# full data is the maximum of the data shape and chunk shape dimensions
|
|
61
|
-
fill_value = get_pad_value(data.dtype)
|
|
62
|
-
chunk = np.full(cshape, np.fill_value, dtype=data.dtype)
|
|
63
|
-
if len(didxs) > 0:
|
|
64
|
-
chunk[tidxs[didxs], bidxs[didxs]] = data[didxs]
|
|
65
|
-
|
|
66
|
-
return chunk
|