xradio 0.0.28__tar.gz → 0.0.30__tar.gz
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-0.0.28 → xradio-0.0.30}/LICENSE.txt +6 -1
- {xradio-0.0.28/src/xradio.egg-info → xradio-0.0.30}/PKG-INFO +11 -6
- {xradio-0.0.28 → xradio-0.0.30}/pyproject.toml +23 -6
- xradio-0.0.30/src/xradio/__init__.py +13 -0
- xradio-0.0.30/src/xradio/_utils/array.py +90 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/_utils/zarr/common.py +48 -3
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/zarr.py +4 -1
- xradio-0.0.30/src/xradio/schema/__init__.py +35 -0
- xradio-0.0.30/src/xradio/schema/bases.py +444 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/schema/check.py +96 -55
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/schema/dataclass.py +123 -27
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/schema/metamodel.py +21 -4
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/schema/typing.py +33 -18
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/__init__.py +5 -2
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_processing_set.py +71 -32
- xradio-0.0.30/src/xradio/vis/_vis_utils/_ms/_tables/create_field_and_source_xds.py +710 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/_tables/load.py +23 -10
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/_tables/load_main_table.py +145 -64
- xradio-0.0.30/src/xradio/vis/_vis_utils/_ms/_tables/read.py +1254 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/_tables/read_main_table.py +173 -44
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/_tables/read_subtables.py +79 -28
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/_tables/write.py +102 -45
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/_tables/write_exp_api.py +127 -65
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/chunks.py +58 -21
- xradio-0.0.30/src/xradio/vis/_vis_utils/_ms/conversion.py +923 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/descr.py +52 -20
- xradio-0.0.30/src/xradio/vis/_vis_utils/_ms/msv2_to_msv4_meta.py +148 -0
- xradio-0.0.30/src/xradio/vis/_vis_utils/_ms/msv4_infos.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/msv4_sub_xdss.py +76 -9
- xradio-0.0.30/src/xradio/vis/_vis_utils/_ms/optimised_functions.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/partition_queries.py +308 -119
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/partitions.py +82 -25
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/subtables.py +32 -14
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_utils/partition_attrs.py +30 -11
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_utils/xds_helper.py +136 -45
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_zarr/read.py +60 -22
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_zarr/write.py +83 -9
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/ms.py +48 -29
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/zarr.py +44 -20
- xradio-0.0.30/src/xradio/vis/convert_msv2_to_processing_set.py +109 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/load_processing_set.py +38 -61
- xradio-0.0.30/src/xradio/vis/read_processing_set.py +118 -0
- xradio-0.0.30/src/xradio/vis/schema.py +687 -0
- xradio-0.0.30/src/xradio/vis/vis_io.py +146 -0
- {xradio-0.0.28 → xradio-0.0.30/src/xradio.egg-info}/PKG-INFO +11 -6
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio.egg-info/SOURCES.txt +3 -1
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio.egg-info/requires.txt +3 -3
- xradio-0.0.28/src/xradio/__init__.py +0 -12
- xradio-0.0.28/src/xradio/schema/__init__.py +0 -17
- xradio-0.0.28/src/xradio/schema/bases.py +0 -6
- xradio-0.0.28/src/xradio/vis/_vis_utils/_ms/_tables/read.py +0 -679
- xradio-0.0.28/src/xradio/vis/_vis_utils/_ms/conversion.py +0 -443
- xradio-0.0.28/src/xradio/vis/_vis_utils/_ms/msv2_to_msv4_meta.py +0 -111
- xradio-0.0.28/src/xradio/vis/_vis_utils/_ms/msv4_infos.py +0 -59
- xradio-0.0.28/src/xradio/vis/_vis_utils/_ms/optimised_functions.py +0 -46
- xradio-0.0.28/src/xradio/vis/convert_msv2_to_processing_set.py +0 -98
- xradio-0.0.28/src/xradio/vis/model.py +0 -497
- xradio-0.0.28/src/xradio/vis/read_processing_set.py +0 -150
- xradio-0.0.28/src/xradio/vis/vis_io.py +0 -114
- {xradio-0.0.28 → xradio-0.0.30}/MANIFEST.in +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/README.md +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/setup.cfg +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/_utils/__init__.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/_utils/_casacore/tables.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/_utils/common.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/_utils/zarr/__init__.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/__init__.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/__init__.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/_casacore/__init__.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/_casacore/common.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/_casacore/xds_from_casacore.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/_casacore/xds_to_casacore.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/_fits/xds_from_fits.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/_zarr/common.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/_zarr/xds_from_zarr.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/_zarr/xds_to_zarr.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/_zarr/zarr_low_level.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/casacore.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/common.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/fits.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/_util/image_factory.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/image/image.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/__init__.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/_tables/table_query.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_ms/msv2_msv3.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_utils/cds.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_utils/stokes_types.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/_zarr/encoding.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio/vis/_vis_utils/ms_column_descriptions_dicts.py +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio.egg-info/dependency_links.txt +0 -0
- {xradio-0.0.28 → xradio-0.0.30}/src/xradio.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
BSD 3-Clause License
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All works in this repository are copyrighted 2024.
|
|
4
|
+
For inquiries contact Associated Universities, Inc., 2650 Park Tower Drive Vienna, VA 22180, USA.
|
|
5
|
+
|
|
6
|
+
Portions of this repository are copyrighted by the following entities:
|
|
7
|
+
1. AUI/NRAO, ESO, NAOJ, in the framework of the ALMA partnership.
|
|
8
|
+
2. AUI/NRAO in the framework of the ngVLA project.
|
|
4
9
|
|
|
5
10
|
Redistribution and use in source and binary forms, with or without
|
|
6
11
|
modification, are permitted provided that the following conditions are met:
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xradio
|
|
3
|
-
Version: 0.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.0.30
|
|
4
|
+
Summary: Xarray Radio Astronomy Data IO
|
|
5
5
|
Author-email: Jan-Willem Steeb <jsteeb@nrao.edu>
|
|
6
6
|
License: BSD 3-Clause License
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
All works in this repository are copyrighted 2024.
|
|
9
|
+
For inquiries contact Associated Universities, Inc., 2650 Park Tower Drive Vienna, VA 22180, USA.
|
|
10
|
+
|
|
11
|
+
Portions of this repository are copyrighted by the following entities:
|
|
12
|
+
1. AUI/NRAO, ESO, NAOJ, in the framework of the ALMA partnership.
|
|
13
|
+
2. AUI/NRAO in the framework of the ngVLA project.
|
|
9
14
|
|
|
10
15
|
Redistribution and use in source and binary forms, with or without
|
|
11
16
|
modification, are permitted provided that the following conditions are met:
|
|
@@ -42,7 +47,7 @@ Requires-Dist: distributed
|
|
|
42
47
|
Requires-Dist: graphviper
|
|
43
48
|
Requires-Dist: matplotlib
|
|
44
49
|
Requires-Dist: numba>=0.57.0
|
|
45
|
-
Requires-Dist: numpy
|
|
50
|
+
Requires-Dist: numpy<2.0.0
|
|
46
51
|
Requires-Dist: prettytable
|
|
47
52
|
Requires-Dist: pytest
|
|
48
53
|
Requires-Dist: pytest-cov
|
|
@@ -52,12 +57,12 @@ Requires-Dist: scipy
|
|
|
52
57
|
Requires-Dist: tqdm
|
|
53
58
|
Requires-Dist: xarray
|
|
54
59
|
Requires-Dist: zarr
|
|
55
|
-
Requires-Dist: bokeh
|
|
56
|
-
Requires-Dist: jupyterlab
|
|
57
60
|
Requires-Dist: pyarrow
|
|
58
61
|
Requires-Dist: python_casacore>=3.5.2; sys_platform != "darwin"
|
|
59
62
|
Requires-Dist: typing_extensions; python_version < "3.10"
|
|
63
|
+
Requires-Dist: typeguard
|
|
60
64
|
Provides-Extra: docs
|
|
65
|
+
Requires-Dist: jupyterlab; extra == "docs"
|
|
61
66
|
Requires-Dist: ipykernel; extra == "docs"
|
|
62
67
|
Requires-Dist: ipympl; extra == "docs"
|
|
63
68
|
Requires-Dist: ipython; extra == "docs"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "xradio"
|
|
3
|
-
version = "0.0.
|
|
4
|
-
description = "Xarray Radio Astronomy Data IO"
|
|
3
|
+
version = "0.0.30"
|
|
4
|
+
description = " Xarray Radio Astronomy Data IO"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Jan-Willem Steeb", email="jsteeb@nrao.edu"},
|
|
7
7
|
]
|
|
@@ -17,7 +17,7 @@ dependencies = [
|
|
|
17
17
|
'graphviper',
|
|
18
18
|
'matplotlib',
|
|
19
19
|
'numba>=0.57.0',
|
|
20
|
-
'numpy',
|
|
20
|
+
'numpy<2.0.0',
|
|
21
21
|
'prettytable',
|
|
22
22
|
'pytest',
|
|
23
23
|
'pytest-cov',
|
|
@@ -27,15 +27,15 @@ dependencies = [
|
|
|
27
27
|
'tqdm',
|
|
28
28
|
'xarray',
|
|
29
29
|
'zarr',
|
|
30
|
-
'bokeh',
|
|
31
|
-
'jupyterlab',
|
|
32
30
|
'pyarrow',
|
|
33
31
|
'python_casacore>=3.5.2; sys_platform != "darwin" ',
|
|
34
|
-
'typing_extensions; python_version < "3.10"'
|
|
32
|
+
'typing_extensions; python_version < "3.10"',
|
|
33
|
+
'typeguard'
|
|
35
34
|
]
|
|
36
35
|
|
|
37
36
|
[project.optional-dependencies]
|
|
38
37
|
docs = [
|
|
38
|
+
'jupyterlab',
|
|
39
39
|
'ipykernel',
|
|
40
40
|
'ipympl',
|
|
41
41
|
'ipython',
|
|
@@ -49,3 +49,20 @@ docs = [
|
|
|
49
49
|
'twine',
|
|
50
50
|
'pandoc'
|
|
51
51
|
]
|
|
52
|
+
|
|
53
|
+
[tool.pytest.ini_options]
|
|
54
|
+
addopts = [
|
|
55
|
+
"--import-mode=importlib",
|
|
56
|
+
"--strict-markers"
|
|
57
|
+
]
|
|
58
|
+
testpaths = [
|
|
59
|
+
"tests"
|
|
60
|
+
]
|
|
61
|
+
pythonpath = [
|
|
62
|
+
"."
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[tool.black]
|
|
66
|
+
line-length = 88
|
|
67
|
+
target-version = ['py39']
|
|
68
|
+
include = '\.py$'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from graphviper.utils.logger import setup_logger
|
|
3
|
+
|
|
4
|
+
_logger_name = "xradio"
|
|
5
|
+
if os.getenv("VIPER_LOGGER_NAME") != _logger_name:
|
|
6
|
+
os.environ["VIPER_LOGGER_NAME"] = _logger_name
|
|
7
|
+
setup_logger(
|
|
8
|
+
logger_name="xradio",
|
|
9
|
+
log_to_term=True,
|
|
10
|
+
log_to_file=False, # True
|
|
11
|
+
log_file="xradio-logfile",
|
|
12
|
+
log_level="DEBUG",
|
|
13
|
+
)
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""Contains optimised functions to be used within other modules."""
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def check_if_consistent(array: np.ndarray, array_name: str) -> np.ndarray:
|
|
7
|
+
"""_summary_
|
|
8
|
+
|
|
9
|
+
Parameters
|
|
10
|
+
----------
|
|
11
|
+
col : _type_
|
|
12
|
+
_description_
|
|
13
|
+
col_name : _type_
|
|
14
|
+
_description_
|
|
15
|
+
|
|
16
|
+
Returns
|
|
17
|
+
-------
|
|
18
|
+
_type_
|
|
19
|
+
_description_
|
|
20
|
+
"""
|
|
21
|
+
if array.ndim == 0:
|
|
22
|
+
return array.item()
|
|
23
|
+
|
|
24
|
+
array_unique = unique_1d(array)
|
|
25
|
+
assert len(array_unique) == 1, array_name + " is not consistent."
|
|
26
|
+
return array_unique[0]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
import numpy as np
|
|
30
|
+
import pandas as pd
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def unique_1d(array: np.ndarray) -> np.ndarray:
|
|
34
|
+
"""
|
|
35
|
+
Optimised version of np.unique for 1D arrays.
|
|
36
|
+
|
|
37
|
+
Parameters
|
|
38
|
+
----------
|
|
39
|
+
array : np.ndarray
|
|
40
|
+
a 1D array of values.
|
|
41
|
+
|
|
42
|
+
Returns
|
|
43
|
+
-------
|
|
44
|
+
np.ndarray
|
|
45
|
+
a sorted array of unique values.
|
|
46
|
+
|
|
47
|
+
"""
|
|
48
|
+
return np.sort(pd.unique(array))
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def pairing_function(antenna_pairs: np.ndarray) -> np.ndarray:
|
|
52
|
+
"""
|
|
53
|
+
Pairing function to convert each array pair to a single value.
|
|
54
|
+
|
|
55
|
+
This custom pairing function will only work if the maximum value is less
|
|
56
|
+
than 2**20 and less than 2,048 if using signed 32-bit integers.
|
|
57
|
+
|
|
58
|
+
Parameters
|
|
59
|
+
----------
|
|
60
|
+
antenna_pairs : np.ndarray
|
|
61
|
+
a 2D array containing antenna 1 and antenna
|
|
62
|
+
2 ids, which forms a baseline.
|
|
63
|
+
|
|
64
|
+
Returns
|
|
65
|
+
-------
|
|
66
|
+
np.ndarray
|
|
67
|
+
a 1D array of the paired values.
|
|
68
|
+
|
|
69
|
+
"""
|
|
70
|
+
return antenna_pairs[:, 0] * 2**20 + antenna_pairs[:, 1]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def inverse_pairing_function(paired_array: np.ndarray) -> np.ndarray:
|
|
74
|
+
"""
|
|
75
|
+
Inverse pairing function to convert each paired value to an antenna pair.
|
|
76
|
+
|
|
77
|
+
This inverse pairing function is the inverse of the custom pairing function.
|
|
78
|
+
|
|
79
|
+
Parameters
|
|
80
|
+
----------
|
|
81
|
+
paired_array : np.ndarray
|
|
82
|
+
a 1D array of the paired values.
|
|
83
|
+
|
|
84
|
+
Returns
|
|
85
|
+
-------
|
|
86
|
+
np.ndarray
|
|
87
|
+
a 2D array containing antenna 1 and antenna 2 ids.
|
|
88
|
+
|
|
89
|
+
"""
|
|
90
|
+
return np.column_stack(np.divmod(paired_array, 2**20))
|
|
@@ -2,9 +2,54 @@ import copy
|
|
|
2
2
|
import xarray as xr
|
|
3
3
|
import zarr
|
|
4
4
|
import s3fs
|
|
5
|
+
import os
|
|
6
|
+
from botocore.exceptions import NoCredentialsError
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _get_ms_stores_and_file_system(ps_store: str):
|
|
10
|
+
|
|
11
|
+
if os.path.isdir(ps_store):
|
|
12
|
+
# default to assuming the data are accessible on local file system
|
|
13
|
+
items = os.listdir(ps_store)
|
|
14
|
+
file_system = os
|
|
15
|
+
|
|
16
|
+
elif ps_store.startswith("s3"):
|
|
17
|
+
# only if not found locally, check if dealing with an S3 bucket URL
|
|
18
|
+
# if not ps_store.endswith("/"):
|
|
19
|
+
# # just for consistency, as there is no os.path equivalent in s3fs
|
|
20
|
+
# ps_store = ps_store + "/"
|
|
21
|
+
|
|
22
|
+
try:
|
|
23
|
+
# initialize the S3 "file system", first attempting to use pre-configured credentials
|
|
24
|
+
file_system = s3fs.S3FileSystem(anon=False, requester_pays=False)
|
|
25
|
+
items = [
|
|
26
|
+
bd.split(sep="/")[-1]
|
|
27
|
+
for bd in file_system.listdir(ps_store, detail=False)
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
except (NoCredentialsError, PermissionError) as e:
|
|
31
|
+
# only public, read-only buckets will be accessible
|
|
32
|
+
# we will want to add messaging and error handling here
|
|
33
|
+
file_system = s3fs.S3FileSystem(anon=True)
|
|
34
|
+
items = [
|
|
35
|
+
bd.split(sep="/")[-1]
|
|
36
|
+
for bd in file_system.listdir(ps_store, detail=False)
|
|
37
|
+
]
|
|
38
|
+
else:
|
|
39
|
+
raise (
|
|
40
|
+
FileNotFoundError,
|
|
41
|
+
f"Could not find {ps_store} either locally or in the cloud.",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
items = [
|
|
45
|
+
item for item in items if not item.startswith(".")
|
|
46
|
+
] # Mac OS likes to place hidden files in the directory (.DStore).
|
|
47
|
+
return file_system, items
|
|
5
48
|
|
|
6
49
|
|
|
7
|
-
def _open_dataset(
|
|
50
|
+
def _open_dataset(
|
|
51
|
+
store, file_system=os, xds_isel=None, data_variables=None, load=False
|
|
52
|
+
):
|
|
8
53
|
"""
|
|
9
54
|
|
|
10
55
|
Parameters
|
|
@@ -26,8 +71,8 @@ def _open_dataset(store, xds_isel=None, data_variables=None, load=False, **kwarg
|
|
|
26
71
|
|
|
27
72
|
import dask
|
|
28
73
|
|
|
29
|
-
if
|
|
30
|
-
mapping = s3fs.S3Map(root=store, s3=
|
|
74
|
+
if isinstance(file_system, s3fs.core.S3FileSystem):
|
|
75
|
+
mapping = s3fs.S3Map(root=store, s3=file_system, check=False)
|
|
31
76
|
xds = xr.open_zarr(store=mapping)
|
|
32
77
|
else:
|
|
33
78
|
xds = xr.open_zarr(store)
|
|
@@ -25,7 +25,10 @@ def _xds_from_zarr(
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def _load_image_from_zarr_no_dask(zarr_file: str, selection: dict) -> xr.Dataset:
|
|
28
|
-
|
|
28
|
+
# At the moment image module does not support S3 file system. file_system=os is hardcoded.
|
|
29
|
+
image_xds = _open_dataset(
|
|
30
|
+
store=zarr_file, file_system=os, xds_isel=selection, load=True
|
|
31
|
+
)
|
|
29
32
|
for h in ["HISTORY", "_attrs_xds_history"]:
|
|
30
33
|
history = os.sep.join([zarr_file, h])
|
|
31
34
|
if os.path.isdir(history):
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from .dataclass import (
|
|
2
|
+
xarray_dataclass_to_array_schema,
|
|
3
|
+
xarray_dataclass_to_dataset_schema,
|
|
4
|
+
xarray_dataclass_to_dict_schema,
|
|
5
|
+
)
|
|
6
|
+
from .bases import (
|
|
7
|
+
xarray_dataarray_schema,
|
|
8
|
+
xarray_dataset_schema,
|
|
9
|
+
dict_schema,
|
|
10
|
+
)
|
|
11
|
+
from .check import (
|
|
12
|
+
SchemaIssue,
|
|
13
|
+
SchemaIssues,
|
|
14
|
+
check_array,
|
|
15
|
+
check_dataset,
|
|
16
|
+
check_dict,
|
|
17
|
+
schema_checked,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"xarray_dataclass_to_array_schema",
|
|
22
|
+
"xarray_dataclass_to_dataset_schema",
|
|
23
|
+
"xarray_dataclass_to_dict_schema",
|
|
24
|
+
"AsDataArray",
|
|
25
|
+
"AsDataset",
|
|
26
|
+
"AsDict",
|
|
27
|
+
"xarray_dataarray_schema",
|
|
28
|
+
"xarray_dataset_schema",
|
|
29
|
+
"SchemaIssue",
|
|
30
|
+
"SchemaIssues",
|
|
31
|
+
"check_array",
|
|
32
|
+
"check_dataset",
|
|
33
|
+
"check_dict",
|
|
34
|
+
"schema_checked",
|
|
35
|
+
]
|