xradio 0.0.24__py3-none-any.whl → 0.0.25__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/image/_util/_zarr/zarr_low_level.py +39 -3
- xradio/vis/_processing_set.py +9 -0
- {xradio-0.0.24.dist-info → xradio-0.0.25.dist-info}/METADATA +3 -3
- {xradio-0.0.24.dist-info → xradio-0.0.25.dist-info}/RECORD +7 -7
- {xradio-0.0.24.dist-info → xradio-0.0.25.dist-info}/LICENSE.txt +0 -0
- {xradio-0.0.24.dist-info → xradio-0.0.25.dist-info}/WHEEL +0 -0
- {xradio-0.0.24.dist-info → xradio-0.0.25.dist-info}/top_level.txt +0 -0
|
@@ -109,19 +109,55 @@ def write_binary_blob_to_disk(arr, file_path, compressor):
|
|
|
109
109
|
Returns:
|
|
110
110
|
- None
|
|
111
111
|
"""
|
|
112
|
+
import graphviper.utils.logger as logger
|
|
112
113
|
# Encode the NumPy array using the codec
|
|
114
|
+
logger.debug('1. Before compressor ' + file_path)
|
|
113
115
|
compressed_arr = compressor.encode(np.ascontiguousarray(arr))
|
|
114
116
|
|
|
117
|
+
logger.debug('2. Before makedir')
|
|
115
118
|
# Ensure the directory exists before saving the file
|
|
116
119
|
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
|
117
120
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
arr_len = len(compressed_arr)
|
|
122
|
+
logger.debug('3. Before write the len is: ' + str(arr_len))
|
|
123
|
+
#Save the compressed array to disk
|
|
124
|
+
# with open(file_path, "wb") as file:
|
|
125
|
+
# file.write(compressed_arr)
|
|
126
|
+
|
|
127
|
+
logger.debug('4. Using new writer: ' + str(arr_len))
|
|
128
|
+
write_to_lustre_chunked(file_path, compressed_arr)
|
|
129
|
+
|
|
130
|
+
# /.lustre/aoc/sciops/pford/CHILES/cube_image/uid___A002_Xee7674_X2844_Cube_3.img.zarr/SKY/0.0.110.0.0
|
|
131
|
+
# 348192501 bytes
|
|
132
|
+
# 332.0622453689575 M
|
|
133
|
+
|
|
134
|
+
# from io import BufferedWriter
|
|
135
|
+
# # Calculate buffer size based on compressed_arr size (adjust multiplier)
|
|
136
|
+
# buffer_size = min(len(compressed_arr), 1024 * 1024 * 4) # Max 4 MB buffer
|
|
137
|
+
# with BufferedWriter(open(file_path, "wb"), buffer_size) as f:
|
|
138
|
+
# f.write(compressed_arr)
|
|
139
|
+
# f.flush() # Ensure data gets written to disk
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
logger.debug('4. Write completed')
|
|
121
143
|
|
|
122
144
|
# print(f"Compressed array saved to {file_path}")
|
|
123
145
|
|
|
124
146
|
|
|
147
|
+
def write_to_lustre_chunked(file_path, compressed_arr, chunk_size=1024 * 1024 * 128): # 128 MiB chunks
|
|
148
|
+
"""
|
|
149
|
+
Writes compressed data to a Lustre file path with chunking.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
file_path: Path to the file for writing.
|
|
153
|
+
compressed_arr: Compressed data array to write.
|
|
154
|
+
chunk_size: Size of each data chunk in bytes (default: 128 MiB).
|
|
155
|
+
"""
|
|
156
|
+
with open(file_path, "wb") as f:
|
|
157
|
+
for i in range(0, len(compressed_arr), chunk_size):
|
|
158
|
+
chunk = compressed_arr[i:i + chunk_size]
|
|
159
|
+
f.write(chunk)
|
|
160
|
+
|
|
125
161
|
def read_binary_blob_from_disk(file_path, compressor, dtype=np.float64):
|
|
126
162
|
"""
|
|
127
163
|
Read a compressed binary blob from disk and decode it using Blosc.
|
xradio/vis/_processing_set.py
CHANGED
|
@@ -43,7 +43,10 @@ class processing_set(dict):
|
|
|
43
43
|
"start_frequency": [],
|
|
44
44
|
"end_frequency": [],
|
|
45
45
|
"shape": [],
|
|
46
|
+
"field_coords": []
|
|
46
47
|
}
|
|
48
|
+
from astropy.coordinates import SkyCoord
|
|
49
|
+
import astropy.units as u
|
|
47
50
|
for key, value in self.items():
|
|
48
51
|
summary_data["name"].append(key)
|
|
49
52
|
summary_data["ddi"].append(value.attrs["ddi"])
|
|
@@ -65,6 +68,12 @@ class processing_set(dict):
|
|
|
65
68
|
)
|
|
66
69
|
summary_data["start_frequency"].append(value["frequency"].values[0])
|
|
67
70
|
summary_data["end_frequency"].append(value["frequency"].values[-1])
|
|
71
|
+
|
|
72
|
+
ra_dec_rad = value[data_name].attrs["field_info"]['phase_direction']['data']
|
|
73
|
+
frame = value[data_name].attrs["field_info"]['phase_direction']['attrs']['frame'].lower()
|
|
74
|
+
coord = SkyCoord(ra=ra_dec_rad[0]*u.rad, dec=ra_dec_rad[1]*u.rad, frame=frame)
|
|
75
|
+
|
|
76
|
+
summary_data["field_coords"].append([frame, coord.ra.to_string(unit=u.hour), coord.dec.to_string(unit=u.deg)])
|
|
68
77
|
summary_df = pd.DataFrame(summary_data)
|
|
69
78
|
return summary_df
|
|
70
79
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xradio
|
|
3
|
-
Version: 0.0.
|
|
4
|
-
Summary: Xarray Radio Astronomy Data IO
|
|
3
|
+
Version: 0.0.25
|
|
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
|
|
|
@@ -32,7 +32,7 @@ License: BSD 3-Clause License
|
|
|
32
32
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
33
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
34
34
|
|
|
35
|
-
Requires-Python: <3.12,>=3.
|
|
35
|
+
Requires-Python: <3.12,>=3.9
|
|
36
36
|
Description-Content-Type: text/markdown
|
|
37
37
|
License-File: LICENSE.txt
|
|
38
38
|
Requires-Dist: astropy
|
|
@@ -20,7 +20,7 @@ xradio/image/_util/_fits/xds_from_fits.py,sha256=SIYyl4dAoCdiB4CSv0_wV_hY7jhLZZE
|
|
|
20
20
|
xradio/image/_util/_zarr/common.py,sha256=apMX_bF4Hr3pFGjnDFpp36KgmhTYAPBZquNkjBHrsXk,307
|
|
21
21
|
xradio/image/_util/_zarr/xds_from_zarr.py,sha256=hz6lHlpybfr_r8pn_uObDHOFmN5h75F11bkBv8KCuP0,3192
|
|
22
22
|
xradio/image/_util/_zarr/xds_to_zarr.py,sha256=wogXbwX8n3Sl9PHoc3_Y_LBowQsQ-94HZQFZ5NcxUZA,1624
|
|
23
|
-
xradio/image/_util/_zarr/zarr_low_level.py,sha256=
|
|
23
|
+
xradio/image/_util/_zarr/zarr_low_level.py,sha256=5D8Vu8QZD8CpKSPMkxHhnKpdk3vhUStW3kQFHUQUQns,10984
|
|
24
24
|
xradio/schema/__init__.py,sha256=UpejQegOaCLrsbcR4MLudR0RxeE0sN3zxFXM8rzyJPo,444
|
|
25
25
|
xradio/schema/bases.py,sha256=vcW47jZWpJ0mJdni7eFVY7zJoper2sy2VjX8LE3pUqc,150
|
|
26
26
|
xradio/schema/check.py,sha256=3u79hRL3pGF6dvQE0LF21nGdAVnRXWwgnbMmStGBSSA,16310
|
|
@@ -28,7 +28,7 @@ xradio/schema/dataclass.py,sha256=vkc2cqLjGV5QN8j70GbBaNfslT_KLWmebsPGeBEuGcs,88
|
|
|
28
28
|
xradio/schema/metamodel.py,sha256=RHrihyaetinu7_lGTTZ31Rlv-_Db_EgQCXzk56H004o,3476
|
|
29
29
|
xradio/schema/typing.py,sha256=coF3LuKOlCUJGKTUUH81EcjePZ86koOYzm8qzsAw-HU,9983
|
|
30
30
|
xradio/vis/__init__.py,sha256=AV2WG26NzFB1LEEtFaq1ULQKz9VnluEAjg0Qb5Ju7m8,358
|
|
31
|
-
xradio/vis/_processing_set.py,sha256=
|
|
31
|
+
xradio/vis/_processing_set.py,sha256=zYCswmWjsRN_8M61IkbMo6zpI-4ABMWpKZkL8f20KGo,4187
|
|
32
32
|
xradio/vis/convert_msv2_to_processing_set.py,sha256=7vTjqtWFEBOySnLVoadceKCA4VLgOig7eCs1dxrdYQA,3966
|
|
33
33
|
xradio/vis/load_processing_set.py,sha256=DsKjizvcJxXNn5BuXH2fye-dzMoB-BDK2f-8jsvK2QU,4776
|
|
34
34
|
xradio/vis/model.py,sha256=uBjvvhYEY1p-3H3NStrt1ZKMQACLGLo93OiEBvDVId8,17083
|
|
@@ -64,8 +64,8 @@ xradio/vis/_vis_utils/_utils/xds_helper.py,sha256=UhtAZV5DyYzVVBkXzwDAOz6TICxotQ
|
|
|
64
64
|
xradio/vis/_vis_utils/_zarr/encoding.py,sha256=GENIlThV6a9CUCL6gIGlu9c6NR3OFWNos6mpxZjMwDc,536
|
|
65
65
|
xradio/vis/_vis_utils/_zarr/read.py,sha256=ikNGlOdHuZ_cgWpPAZ4iHzeLdU44I0iBLcqSEiM_hCk,7111
|
|
66
66
|
xradio/vis/_vis_utils/_zarr/write.py,sha256=exvrqNVnVKk6LzbDPm_fm142YzX-7lHGqklXTQB9wh0,8864
|
|
67
|
-
xradio-0.0.
|
|
68
|
-
xradio-0.0.
|
|
69
|
-
xradio-0.0.
|
|
70
|
-
xradio-0.0.
|
|
71
|
-
xradio-0.0.
|
|
67
|
+
xradio-0.0.25.dist-info/LICENSE.txt,sha256=dvACd-5O67yjSZlnEKcWmu3DqwzBtbC922iPv0KOeAw,1516
|
|
68
|
+
xradio-0.0.25.dist-info/METADATA,sha256=c_uoGScVmVEzC-iSPJ0KczSHcHN0Wt6ZRRD4k7qVQrw,4069
|
|
69
|
+
xradio-0.0.25.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
70
|
+
xradio-0.0.25.dist-info/top_level.txt,sha256=dQu27fGBZJ2Yk-gW5XeD-dZ76Xa4Xcvk60Vz-dwXp7k,7
|
|
71
|
+
xradio-0.0.25.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|