xradio 1.1.0__tar.gz → 1.1.12a0__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.
Files changed (81) hide show
  1. {xradio-1.1.0/src/xradio.egg-info → xradio-1.1.12a0}/PKG-INFO +1 -1
  2. {xradio-1.1.0 → xradio-1.1.12a0}/pyproject.toml +1 -1
  3. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/_utils/zarr/common.py +1 -0
  4. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/_casacore/xds_from_casacore.py +6 -5
  5. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/_zarr/common.py +1 -0
  6. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/casacore.py +1 -0
  7. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/image_factory.py +1 -10
  8. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/_tables/read.py +3 -7
  9. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/create_field_and_source_xds.py +0 -1
  10. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_utils/interpolate.py +0 -5
  11. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_utils/partition_attrs.py +1 -0
  12. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/schema/common.py +1 -0
  13. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/testing/measurement_set/msv2_io.py +1 -0
  14. {xradio-1.1.0 → xradio-1.1.12a0/src/xradio.egg-info}/PKG-INFO +1 -1
  15. {xradio-1.1.0 → xradio-1.1.12a0}/LICENSE.txt +0 -0
  16. {xradio-1.1.0 → xradio-1.1.12a0}/MANIFEST.in +0 -0
  17. {xradio-1.1.0 → xradio-1.1.12a0}/README.md +0 -0
  18. {xradio-1.1.0 → xradio-1.1.12a0}/setup.cfg +0 -0
  19. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/__init__.py +0 -0
  20. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/_utils/__init__.py +0 -0
  21. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/_utils/_casacore/casacore_from_casatools.py +0 -0
  22. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/_utils/_casacore/tables.py +0 -0
  23. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/_utils/coord_math.py +0 -0
  24. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/_utils/dict_helpers.py +0 -0
  25. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/_utils/list_and_array.py +0 -0
  26. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/_utils/schema.py +0 -0
  27. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/_utils/xarray_helpers.py +0 -0
  28. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/_utils/zarr/__init__.py +0 -0
  29. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/__init__.py +0 -0
  30. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/__init__.py +0 -0
  31. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/_casacore/__init__.py +0 -0
  32. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/_casacore/common.py +0 -0
  33. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/_casacore/xds_to_casacore.py +0 -0
  34. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/_fits/xds_from_fits.py +0 -0
  35. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/_zarr/xds_from_zarr.py +0 -0
  36. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/_zarr/xds_to_zarr.py +0 -0
  37. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/_zarr/zarr_low_level.py +0 -0
  38. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/common.py +0 -0
  39. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/_util/zarr.py +0 -0
  40. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/image.py +0 -0
  41. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/image_xds.py +0 -0
  42. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/image/schema.py +0 -0
  43. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/__init__.py +0 -0
  44. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/__init__.py +0 -0
  45. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/__init__.py +0 -0
  46. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/_tables/read_main_table.py +0 -0
  47. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/_tables/table_query.py +0 -0
  48. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/conversion.py +0 -0
  49. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/create_antenna_xds.py +0 -0
  50. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/msv2_to_msv4_meta.py +0 -0
  51. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/msv4_info_dicts.py +0 -0
  52. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/msv4_sub_xdss.py +1 -1
  53. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/optimised_functions.py +0 -0
  54. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/partition_queries.py +0 -0
  55. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_msv2/subtables.py +0 -0
  56. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_utils/stokes_types.py +0 -0
  57. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/_utils/_zarr/encoding.py +0 -0
  58. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/convert_msv2_to_processing_set.py +0 -0
  59. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/load_processing_set.py +0 -0
  60. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/measurement_set_xdt.py +0 -0
  61. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/open_processing_set.py +0 -0
  62. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/processing_set_xdt.py +0 -0
  63. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/measurement_set/schema.py +0 -0
  64. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/schema/__init__.py +0 -0
  65. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/schema/bases.py +0 -0
  66. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/schema/check.py +0 -0
  67. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/schema/dataclass.py +0 -0
  68. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/schema/export.py +0 -0
  69. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/schema/metamodel.py +0 -0
  70. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/schema/typing.py +0 -0
  71. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/sphinx/__init__.py +0 -0
  72. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/sphinx/schema_table.py +0 -0
  73. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/testing/__init__.py +0 -0
  74. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/testing/_utils/__template__.py +0 -0
  75. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/testing/measurement_set/__init__.py +0 -0
  76. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/testing/measurement_set/checker.py +0 -0
  77. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio/testing/measurement_set/io.py +0 -0
  78. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio.egg-info/SOURCES.txt +0 -0
  79. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio.egg-info/dependency_links.txt +0 -0
  80. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio.egg-info/requires.txt +0 -0
  81. {xradio-1.1.0 → xradio-1.1.12a0}/src/xradio.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xradio
3
- Version: 1.1.0
3
+ Version: 1.1.12a0
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "xradio"
3
- version = "v1.1.0"
3
+ version = "v1.1.12-alpha"
4
4
  description = " Xarray Radio Astronomy Data IO"
5
5
  authors = [
6
6
  {name = "Jan-Willem Steeb", email="jsteeb@nrao.edu"},
@@ -1,6 +1,7 @@
1
1
  import xarray as xr
2
2
  import os
3
3
 
4
+
4
5
  # from xradio.vis._vis_utils._ms.msv2_to_msv4_meta import (
5
6
  # column_description_casacore_to_msv4_measure,
6
7
  # )
@@ -381,12 +381,14 @@ def _casa_image_to_xds_coords(
381
381
  attrs["sphr_dims"] = sphr_dims
382
382
  coords = {}
383
383
  coord_attrs = {}
384
- coords["time"], coord_attrs["time"] = _get_time_values_attrs(coord_dict)
385
- coords["frequency"], coord_attrs["frequency"] = _get_freq_values_attrs(csys, shape)
386
- velocity_vals, coord_attrs["velocity"] = _get_velocity_values_attrs(
384
+ (coords["time"], coord_attrs["time"]) = _get_time_values_attrs(coord_dict)
385
+ (coords["frequency"], coord_attrs["frequency"]) = _get_freq_values_attrs(
386
+ csys, shape
387
+ )
388
+ (velocity_vals, coord_attrs["velocity"]) = _get_velocity_values_attrs(
387
389
  coord_dict, coords["frequency"]
388
390
  )
389
- coords["polarization"], coord_attrs["polarization"] = _get_pol_values_attrs(
391
+ (coords["polarization"], coord_attrs["polarization"]) = _get_pol_values_attrs(
390
392
  coord_dict
391
393
  )
392
394
  coords["velocity"] = (["frequency"], velocity_vals)
@@ -683,7 +685,6 @@ def _get_persistent_block(
683
685
  block = _read_image_chunk(infile, shapes, starts)
684
686
  block = np.expand_dims(block, new_axes)
685
687
  block = block.transpose(transpose_list)
686
- block = da.from_array(block, chunks=block.shape)
687
688
  block = xr.DataArray(block, dims=dimorder)
688
689
  return block
689
690
 
@@ -1,5 +1,6 @@
1
1
  import numpy as np
2
2
 
3
+
3
4
  _np_types = {
4
5
  "complex128": np.complex128,
5
6
  "complex64": np.complex64,
@@ -202,6 +202,7 @@ def _xds_to_multiple_casa_images(xds: xr.Dataset, image_store_name: str) -> None
202
202
  ]
203
203
 
204
204
  if "flag" in xds.attrs["data_groups"][data_group]:
205
+ print("******* found flag")
205
206
  mask_sky_name = xds.attrs["data_groups"][data_group]["flag"]
206
207
  image_to_write_xds["MASK_0"] = xds[mask_sky_name]
207
208
  image_to_write_xds["SKY"].attrs["flag"] = "MASK_0"
@@ -337,16 +337,7 @@ def detect_store_type(store):
337
337
  raise ValueError("Unknown directory structure." + str(store))
338
338
  else:
339
339
  logger.error("Path does not exist.")
340
- raise ValueError(
341
- "Path does not exist. The current path: "
342
- + str(os.system("pwd"))
343
- + " .The current casa directory: "
344
- + str(os.system("ls 3c286_Band6_5chans_lsrk_robust_0.5_niter_99_casa"))
345
- + ". The current fits directory: "
346
- + str(os.system("ls 3c286_Band6_5chans_lsrk_robust_0.5_niter_99_fits"))
347
- + " The given store "
348
- + str(store)
349
- )
340
+ raise ValueError("Path does not exist." + str(store))
350
341
  else:
351
342
  store_type = "zarr"
352
343
 
@@ -93,12 +93,9 @@ def convert_mjd_time(rawtimes: np.ndarray) -> np.ndarray:
93
93
  np.ndarray
94
94
  times converted to pandas reference and datetime type
95
95
  """
96
-
97
- print("^^^^^^^", rawtimes, MJD_DIF_UNIX, SECS_IN_DAY)
98
96
  times_reref = pd.to_datetime(
99
97
  (rawtimes - MJD_DIF_UNIX) * SECS_IN_DAY, unit="s"
100
98
  ).values
101
- print("^^^^^^^", times_reref)
102
99
 
103
100
  return times_reref
104
101
 
@@ -163,7 +160,7 @@ def make_taql_where_between_min_max(
163
160
  if min_max_range is None:
164
161
  taql = None
165
162
  else:
166
- min_val, max_val = min_max_range
163
+ (min_val, max_val) = min_max_range
167
164
  taql = f"where {colname} >= {min_val} AND {colname} <= {max_val}"
168
165
 
169
166
  return taql
@@ -229,7 +226,7 @@ def find_projected_min_max_array(
229
226
  """Does the min/max checks and search for find_projected_min_max_table()"""
230
227
 
231
228
  sorted_array = np.sort(array)
232
- range_min, range_max = min_max
229
+ (range_min, range_max) = min_max
233
230
  if len(sorted_array) < 2:
234
231
  tol = np.finfo(sorted_array.dtype).eps * 4
235
232
  else:
@@ -894,8 +891,7 @@ def raw_col_data_to_coords_vars(
894
891
 
895
892
  if col in timecols:
896
893
  if col == "MJD":
897
- # data = convert_mjd_time(data).astype("float64") / 1e9
898
- data = convert_mjd_time(data).astype("datetime64[ns]").view("int64") / 1e9
894
+ data = convert_mjd_time(data).astype("float64") / 1e9
899
895
  else:
900
896
  try:
901
897
  data = convert_casacore_time(data, False)
@@ -285,7 +285,6 @@ def extract_ephemeris_info(
285
285
  # Metadata has to be fixed manually. Alternatively, issues like
286
286
  # UNIT/QuantumUnits issue could be handled in convert_generic_xds_to_xradio_schema,
287
287
  # but for now preferring not to pollute that function.
288
-
289
288
  time_ephemeris_dim = ["time_ephemeris"]
290
289
  to_new_data_variables = {
291
290
  # mandatory: SOURCE_RADIAL_VELOCITY
@@ -41,10 +41,6 @@ def interpolate_to_time(
41
41
  method = "linear"
42
42
  else:
43
43
  method = "nearest"
44
-
45
- # print("xds before interp:",xds.NORTH_POLE_ANGULAR_DISTANCE.values, xds[time_name].values)
46
- # print("interp_time data:",interp_time,interp_time.data)
47
- # print("method:",method)
48
44
  xds = xds.interp(
49
45
  {time_name: interp_time.data}, method=method, assume_sorted=True
50
46
  )
@@ -60,6 +56,5 @@ def interpolate_to_time(
60
56
  f"{message_prefix}: interpolating the time coordinate "
61
57
  f"from {points_before} to {points_after} points"
62
58
  )
63
- # print("xds after interp:",xds.NORTH_POLE_ANGULAR_DISTANCE.values, xds[time_name].values)
64
59
 
65
60
  return xds
@@ -2,6 +2,7 @@ from typing import Dict, TypedDict, Union
2
2
 
3
3
  import xarray as xr
4
4
 
5
+
5
6
  PartitionIds = TypedDict(
6
7
  "PartitionIds",
7
8
  {
@@ -9,6 +9,7 @@ from xradio.schema.bases import (
9
9
  from xradio.schema.typing import Attr, Coord, Coordof, Data, Dataof, Name
10
10
  import numpy
11
11
 
12
+
12
13
  # Dimensions
13
14
  Time = Literal["time"]
14
15
  """ Observation time dimension """
@@ -19,6 +19,7 @@ from casacore.tables import default_ms, default_ms_subtable
19
19
  from casacore.tables.tableutil import makedminfo, maketabdesc
20
20
  from casacore.tables.msutil import complete_ms_desc, makearrcoldesc, required_ms_desc
21
21
 
22
+
22
23
  # 2 observations, 2 fields, 2 states
23
24
  # 2 SPWs, 4 polarizations
24
25
  default_ms_descr = {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xradio
3
- Version: 1.1.0
3
+ Version: 1.1.12a0
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
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -27,6 +27,7 @@ from xradio.measurement_set._utils._msv2._tables.read import (
27
27
  table_has_column,
28
28
  )
29
29
 
30
+
30
31
  standard_time_coord_attrs = make_time_measure_attrs(time_format="unix")
31
32
 
32
33
 
@@ -80,7 +81,6 @@ def rename_and_interpolate_to_time(
80
81
  )
81
82
 
82
83
  # rename the time_* axis to time.
83
-
84
84
  time_coord = {"time": (time_initial_name, interp_time.data)}
85
85
  renamed_time_xds = interpolated_xds.assign_coords(time_coord)
86
86
  renamed_time_xds.coords["time"].attrs.update(standard_time_coord_attrs)