xradio 0.0.45__py3-none-any.whl → 0.0.47__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.
@@ -1029,7 +1029,7 @@ def convert_and_write_partition(
1029
1029
  datetime.timezone.utc
1030
1030
  ).isoformat(),
1031
1031
  "xradio_version": importlib.metadata.version("xradio"),
1032
- "schema_version": "4.0.-9994",
1032
+ "schema_version": "4.0.-9991",
1033
1033
  "type": "visibility",
1034
1034
  }
1035
1035
  )
@@ -1399,58 +1399,58 @@ def antenna_ids_to_names(
1399
1399
  return xds
1400
1400
 
1401
1401
 
1402
+ def add_group_to_data_groups(
1403
+ data_groups: dict, what_group: str, correlated_data_name: str, uvw: bool = True
1404
+ ):
1405
+ """
1406
+ Adds one correlated_data variable to the data_groups dict.
1407
+ A utility function to use when creating/updating data_groups from MSv2 data columns
1408
+ / data variables.
1409
+
1410
+ Parameters
1411
+ ----------
1412
+ data_groups: str
1413
+ The data_groups dict of an MSv4 xds. It is updated in-place
1414
+ what_group: str
1415
+ Name of the data group: "base", "corrected", "model", etc.
1416
+ correlated_data_name: str
1417
+ Name of the correlated_data var: "VISIBILITY", "VISIBILITY_CORRECTED", "SPECTRUM", etc.
1418
+ uvw: bool
1419
+ Whether to add a uvw field to the data group (assume True = interferometric data).
1420
+ """
1421
+ data_groups[what_group] = {
1422
+ "correlated_data": correlated_data_name,
1423
+ "flag": "FLAG",
1424
+ "weight": "WEIGHT",
1425
+ }
1426
+ if uvw:
1427
+ data_groups[what_group]["uvw"] = "UVW"
1428
+
1429
+
1402
1430
  def add_data_groups(xds):
1403
1431
  xds.attrs["data_groups"] = {}
1432
+
1433
+ data_groups = xds.attrs["data_groups"]
1404
1434
  if "VISIBILITY" in xds:
1405
- xds.attrs["data_groups"]["base"] = {
1406
- "correlated_data": "VISIBILITY",
1407
- "flag": "FLAG",
1408
- "weight": "WEIGHT",
1409
- "uvw": "UVW",
1410
- }
1435
+ add_group_to_data_groups(data_groups, "base", "VISIBILITY")
1411
1436
 
1412
1437
  if "VISIBILITY_CORRECTED" in xds:
1413
- xds.attrs["data_groups"]["corrected"] = {
1414
- "correlated_data": "VISIBILITY_CORRECTED",
1415
- "flag": "FLAG",
1416
- "weight": "WEIGHT",
1417
- "uvw": "UVW",
1418
- }
1438
+ add_group_to_data_groups(data_groups, "corrected", "VISIBILITY_CORRECTED")
1419
1439
 
1420
1440
  if "VISIBILITY_MODEL" in xds:
1421
- xds.attrs["data_groups"]["model"] = {
1422
- "correlated_data": "VISIBILITY_MODEL",
1423
- "flag": "FLAG",
1424
- "weight": "WEIGHT",
1425
- "uvw": "UVW",
1426
- }
1441
+ add_group_to_data_groups(data_groups, "model", "VISIBILITY_MODEL")
1427
1442
 
1428
1443
  is_single_dish = False
1429
1444
  if "SPECTRUM" in xds:
1430
- xds.attrs["data_groups"]["base"] = {
1431
- "correlated_data": "SPECTRUM",
1432
- "flag": "FLAG",
1433
- "weight": "WEIGHT",
1434
- "uvw": "UVW",
1435
- }
1445
+ add_group_to_data_groups(data_groups, "base", "SPECTRUM", False)
1436
1446
  is_single_dish = True
1437
1447
 
1438
1448
  if "SPECTRUM_MODEL" in xds:
1439
- xds.attrs["data_groups"]["model"] = {
1440
- "correlated_data": "SPECTRUM_MODEL",
1441
- "flag": "FLAG",
1442
- "weight": "WEIGHT",
1443
- "uvw": "UVW",
1444
- }
1449
+ add_group_to_data_groups(data_groups, "model", "SPECTRUM_MODEL", False)
1445
1450
  is_single_dish = True
1446
1451
 
1447
1452
  if "SPECTRUM_CORRECTED" in xds:
1448
- xds.attrs["data_groups"]["corrected"] = {
1449
- "correlated_data": "SPECTRUM_CORRECTED",
1450
- "flag": "FLAG",
1451
- "weight": "WEIGHT",
1452
- "uvw": "UVW",
1453
- }
1453
+ add_group_to_data_groups(data_groups, "corrected", "SPECTRUM_CORRECTED", False)
1454
1454
  is_single_dish = True
1455
1455
 
1456
1456
  return xds, is_single_dish
@@ -76,8 +76,9 @@ def convert_msv2_to_processing_set(
76
76
  partition_scheme : list, optional
77
77
  A MS v4 can only contain a single data description (spectral window and polarization setup), and observation mode. Consequently, the MS v2 is partitioned when converting to MS v4.
78
78
  In addition to data description and polarization setup a finer partitioning is possible by specifying a list of partitioning keys. Any combination of the following keys are possible:
79
- "FIELD_ID", "SCAN_NUMBER", "STATE_ID", "SOURCE_ID", "SUB_SCAN_NUMBER". For mosaics where the phase center is rapidly changing (such as VLA on the fly mosaics)
80
- partition_scheme should be set to an empty list []. By default, ["FIELD_ID"].
79
+ "FIELD_ID", "SCAN_NUMBER", "STATE_ID", "SOURCE_ID", "SUB_SCAN_NUMBER", "ANTENNA1".
80
+ "ANTENNA1" is intended as a single-dish specific partitioning option.
81
+ For mosaics where the phase center is rapidly changing (such as VLA on the fly mosaics) partition_scheme should be set to an empty list []. By default, ["FIELD_ID"].
81
82
  main_chunksize : Union[Dict, float, None], optional
82
83
  Defines the chunk size of the main dataset. If given as a dictionary, defines the sizes of several dimensions, and acceptable keys are "time", "baseline_id", "antenna_id", "frequency", "polarization". If given as a float, gives the size of a chunk in GiB. By default, None.
83
84
  with_pointing : bool, optional
@@ -125,7 +125,7 @@ class QuantityInHertzArray:
125
125
  @xarray_dataarray_schema
126
126
  class QuantityInMetersArray:
127
127
  """
128
- Quantity with units of Hertz
128
+ Quantity with units of meters
129
129
  """
130
130
 
131
131
  data: Data[ZD, float]
@@ -137,7 +137,7 @@ class QuantityInMetersArray:
137
137
  @xarray_dataarray_schema
138
138
  class QuantityInMetersPerSecondArray:
139
139
  """
140
- Quantity with units of Hertz
140
+ Quantity with units of meters per second
141
141
  """
142
142
 
143
143
  data: Data[ZD, float]
@@ -149,7 +149,7 @@ class QuantityInMetersPerSecondArray:
149
149
  @xarray_dataarray_schema
150
150
  class QuantityInRadiansArray:
151
151
  """
152
- Quantity with units of Hertz
152
+ Quantity with units of radians
153
153
  """
154
154
 
155
155
  data: Data[ZD, float]
@@ -304,6 +304,31 @@ class SkyCoordArray:
304
304
  """
305
305
 
306
306
 
307
+ @xarray_dataarray_schema
308
+ class PointingBeamArray:
309
+ """Pointing beam data array in :py:class:`PointingXds`."""
310
+
311
+ data: Data[
312
+ Union[
313
+ tuple[Time, AntennaName, LocalSkyDirLabel],
314
+ tuple[TimePointing, AntennaName, LocalSkyDirLabel],
315
+ tuple[Time, AntennaName, LocalSkyDirLabel, nPolynomial],
316
+ tuple[TimePointing, AntennaName, LocalSkyDirLabel, nPolynomial],
317
+ ],
318
+ numpy.float64,
319
+ ]
320
+
321
+ type: Attr[SkyCoord] = "sky_coord"
322
+ units: Attr[UnitsOfSkyCoordInRadians] = ("rad", "rad")
323
+ frame: Attr[AllowedSkyCoordFrames] = "fk5"
324
+ """
325
+ From fixvis docs: clean and the im tool ignore the reference frame claimed by the UVW column (it is often mislabelled
326
+ as ITRF when it is really FK5 (J2000)) and instead assume the (u, v, w)s are in the same frame as the phase tracking
327
+ center. calcuvw does not yet force the UVW column and field centers to use the same reference frame! Blank = use the
328
+ phase tracking frame of vis.
329
+ """
330
+
331
+
307
332
  @xarray_dataarray_schema
308
333
  class LocalSkyCoordArray:
309
334
  """Measures array for the arrays that have coordinate local_sky_dir_label in :py:class:`PointingXds`"""
@@ -660,7 +685,7 @@ class FrequencyArray:
660
685
  """Frequency coordinate in the main dataset."""
661
686
 
662
687
  data: Data[Frequency, float]
663
- """ Time, expressed in SI seconds since the epoch. """
688
+ """ Center frequencies for each channel. """
664
689
  spectral_window_name: Attr[str]
665
690
  """ Name associated with spectral window. """
666
691
  frequency_group_name: Optional[Attr[str]]
@@ -698,7 +723,7 @@ class FrequencyCalArray:
698
723
  only measures data, as opposed to the frequency array of the main dataset."""
699
724
 
700
725
  data: Data[FrequencyCal, float]
701
- """ Time, expressed in SI seconds since the epoch. """
726
+ """ Center frequencies for each channel. """
702
727
 
703
728
  type: Attr[SpectralCoord] = "spectral_coord"
704
729
  units: Attr[UnitsHertz] = ("Hz",)
@@ -1188,7 +1213,10 @@ class PartitionInfoDict:
1188
1213
  """ List of source names. """
1189
1214
  # source_id: mising / remove for good?
1190
1215
  intents: list[str]
1191
- """ Infromation in obs_mode column of MSv2 State table. """
1216
+ """ An intent string identifies one intention of the scan, such as to calibrate or observe a
1217
+ target. See :ref:`scan intents` for possible values. When converting from MSv2, the list of
1218
+ intents is derived from the OBS_MODE column of MSv2 state table (every comma separated value
1219
+ is taken as an intent). """
1192
1220
  taql: Optional[str]
1193
1221
  """ The taql query used if converted from MSv2. """
1194
1222
  line_name: list[str]
@@ -1469,7 +1497,7 @@ class WeatherXds:
1469
1497
  time: Optional[Coordof[TimeInterpolatedCoordArray]]
1470
1498
  """ Mid-point of the time interval. Labeled 'time' when interpolated to main time axis """
1471
1499
  time_weather: Optional[Coordof[TimeWeatherCoordArray]]
1472
- """ Mid-point of the time interval. Labeled 'time_cal' when not interpolated to main time axis """
1500
+ """ Mid-point of the time interval. Labeled 'time_weather' when not interpolated to main time axis """
1473
1501
  antenna_name: Optional[Coordof[AntennaNameArray]]
1474
1502
  """ Antenna identifier """
1475
1503
  ellipsoid_pos_label: Optional[Coord[EllipsoidPosLabel, str]] = (
@@ -1574,7 +1602,7 @@ class PointingXds:
1574
1602
  """
1575
1603
  Pointing dataset: antenna pointing information.
1576
1604
 
1577
- In the past the relationship and definition of the pointing infromation has not been clear. Here we attempt to clarify it by explaining the relationship between the ASDM, MSv2 and MSv4 pointing information.
1605
+ In the past the relationship and definition of the pointing information has not been clear. Here we attempt to clarify it by explaining the relationship between the ASDM, MSv2 and MSv4 pointing information.
1578
1606
 
1579
1607
  The following abreviations are used:
1580
1608
 
@@ -1615,29 +1643,31 @@ class PointingXds:
1615
1643
  Direction labels.
1616
1644
  """
1617
1645
 
1618
- POINTING_BEAM: Data[
1619
- Union[
1620
- tuple[Time, AntennaName],
1621
- tuple[TimePointing, AntennaName],
1622
- tuple[Time, AntennaName, nPolynomial],
1623
- tuple[TimePointing, AntennaName, nPolynomial],
1624
- ],
1625
- LocalSkyCoordArray,
1626
- ]
1646
+ POINTING_BEAM: Dataof[PointingBeamArray]
1627
1647
  """
1628
1648
  The direction of the peak response of the beam and is equavalent to the MSv2 DIRECTION (M2_direction) with_pointing_correction=True, optionally expressed as polynomial coefficients.
1629
1649
  """
1630
1650
 
1651
+ # Optional coords:
1652
+
1631
1653
  time: Optional[Coordof[TimeInterpolatedCoordArray]] = None
1632
1654
  """
1633
1655
  Mid-point of the time interval for which the information in this row is
1634
1656
  valid. Required to use the same time measure reference as in visibility dataset.
1635
1657
  Labeled 'time' when interpolating to main time axis.
1636
1658
  """
1659
+
1637
1660
  time_pointing: Optional[Coordof[TimePointingCoordArray]] = None
1638
1661
  """ Midpoint of time for which this set of parameters is accurate. Labeled
1639
1662
  'time_pointing' when not interpolating to main time axis """
1640
1663
 
1664
+ n_polynomial: Optional[Coord[nPolynomial, numpy.int64]] = None
1665
+ """
1666
+ Polynomial index, when using polynomial coefficients to specify POINTING_BEAM
1667
+ """
1668
+
1669
+ # Optional data vars:
1670
+
1641
1671
  POINTING_DISH_MEASURED: Optional[
1642
1672
  Data[
1643
1673
  Union[
@@ -1901,15 +1931,6 @@ class VisibilityXds:
1901
1931
  xradio_version: Optional[Attr[str]] = None
1902
1932
  """ Version of XRADIO used if converted from MSv2. """
1903
1933
 
1904
- intent: Optional[Attr[str]] = None
1905
- """Identifies the intention of the scan, such as to calibrate or observe a
1906
- target. See :ref:`scan intents` for possible values.
1907
- """
1908
- data_description_id: Optional[Attr[str]] = None
1909
- """
1910
- The id assigned to this combination of spectral window and polarization setup.
1911
- """
1912
-
1913
1934
 
1914
1935
  @xarray_dataset_schema
1915
1936
  class SpectrumXds:
@@ -2001,12 +2022,3 @@ class SpectrumXds:
2001
2022
 
2002
2023
  xradio_version: Optional[Attr[str]] = None
2003
2024
  """ Version of XRADIO used if converted from MSv2. """
2004
-
2005
- intent: Optional[Attr[str]] = None
2006
- """Identifies the intention of the scan, such as to calibrate or observe a
2007
- target. See :ref:`scan intents` for possible values.
2008
- """
2009
- data_description_id: Optional[Attr[str]] = None
2010
- """
2011
- The id assigned to this combination of spectral window and polarization setup.
2012
- """
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: xradio
3
- Version: 0.0.45
3
+ Version: 0.0.47
4
4
  Summary: Xarray Radio Astronomy Data IO
5
5
  Author-email: Jan-Willem Steeb <jsteeb@nrao.edu>
6
6
  License: BSD 3-Clause License
@@ -52,7 +52,7 @@ Requires-Dist: pytest-html
52
52
  Requires-Dist: s3fs
53
53
  Requires-Dist: scipy
54
54
  Requires-Dist: xarray
55
- Requires-Dist: zarr
55
+ Requires-Dist: zarr<3,>=2
56
56
  Requires-Dist: pyarrow
57
57
  Requires-Dist: python_casacore>=3.6.1; sys_platform != "darwin"
58
58
  Requires-Dist: typing_extensions; python_version < "3.10"
@@ -25,17 +25,17 @@ xradio/image/_util/_zarr/xds_from_zarr.py,sha256=4b6KHmAcnrhBbCi-Z7e3Lm6l6wziJL1
25
25
  xradio/image/_util/_zarr/xds_to_zarr.py,sha256=wogXbwX8n3Sl9PHoc3_Y_LBowQsQ-94HZQFZ5NcxUZA,1624
26
26
  xradio/image/_util/_zarr/zarr_low_level.py,sha256=fVaPnxYazz6UDLBZuyUOekZKQ945OwhfBHeNeDgnW0w,13338
27
27
  xradio/measurement_set/__init__.py,sha256=dTrX1Rki43UGz0srfGh07lm-zcUXJdSdSPbS3QPaMpg,662
28
- xradio/measurement_set/convert_msv2_to_processing_set.py,sha256=AoYZBrFyy8kaPg_2GuIr8yc_ht9vSNkUPPY7VO5Nsn8,8083
28
+ xradio/measurement_set/convert_msv2_to_processing_set.py,sha256=KQomjZtfrahMZFHH9XV0xfw4jlNvEuveUgLSEmeBo80,8173
29
29
  xradio/measurement_set/load_processing_set.py,sha256=RedC4i4dOHzgYiz_C0P-3F0PwvEGUomvq_ilpcfUCco,5540
30
30
  xradio/measurement_set/measurement_set_xds.py,sha256=slZ4Nj3io3WkspjUqY4E-JO3LR2X7g9w2e88yjxcDQ8,4621
31
31
  xradio/measurement_set/open_processing_set.py,sha256=533fwEP4pJIBB-NdwFttbobVb8zEXsblvDTjF4ptTDU,3831
32
32
  xradio/measurement_set/processing_set.py,sha256=uVc8PpG_7ivGYqTZpDCLCfuXBOwTLMFj3TebbEpKMRI,29904
33
- xradio/measurement_set/schema.py,sha256=OPAliKAdZt9oblyGW-CHnEzl-1hMj3-9I8G220XArXM,76439
33
+ xradio/measurement_set/schema.py,sha256=oETmqrBoaVE0xS36yQIXe9Yo3YjOBkIndWB76v8wlc0,77022
34
34
  xradio/measurement_set/_utils/__init__.py,sha256=XE-h1yMfr6tVD6gdUwXO1CVq5SQ6kD_oj-e5TFwslds,97
35
35
  xradio/measurement_set/_utils/msv2.py,sha256=7hnZMFoQ-s1g0ATjEupLvtdqQCdroPv-Rl5OwjqXjh8,4430
36
36
  xradio/measurement_set/_utils/zarr.py,sha256=ehXlu0Xh_UZ5Xm2RnHCxESsRZ26c3DQAO5rqMK5MwTk,3947
37
37
  xradio/measurement_set/_utils/_msv2/chunks.py,sha256=JTPk3il6fk570BjWZMoOAtsbvnLmqPcBv9EPY6A2yOs,2964
38
- xradio/measurement_set/_utils/_msv2/conversion.py,sha256=bWySUtoOl9IAWJG6pncPZtmE6gV11B8jEu3QNpEvY1k,51914
38
+ xradio/measurement_set/_utils/_msv2/conversion.py,sha256=9At2ytmBWp1tKuGPYD6ONcnl1ymW8QpdpouwQDFUs8k,52215
39
39
  xradio/measurement_set/_utils/_msv2/create_antenna_xds.py,sha256=qLUDxbkJBOaD7EaVx7ufiU0CL5f8VVxK-923-j4XpXc,17758
40
40
  xradio/measurement_set/_utils/_msv2/create_field_and_source_xds.py,sha256=MNO1M6o8i-_L9I26mx20jkMRNKU4ymxLCohbSTpZwLo,34167
41
41
  xradio/measurement_set/_utils/_msv2/descr.py,sha256=dYK8mhXxODIh-dfqaOm-YZb7kmoN1N2golX_RFncO94,5215
@@ -70,8 +70,8 @@ xradio/schema/metamodel.py,sha256=WjtW7pAVzcjLRWifRH3sQoOiN6TV810hARpOIz1M_gw,38
70
70
  xradio/schema/typing.py,sha256=8-o6fZd99kJ4FVdgBYRTIRJ-wDqpcUNXzCTfJvl3TIw,10439
71
71
  xradio/sphinx/__init__.py,sha256=VGY-7Ty3q67qpnBee0-znbiJ-Iy0F93UO--IpjEdHXc,380
72
72
  xradio/sphinx/schema_table.py,sha256=YTQvK-VOBIpFtcx7sjcaMod4OSbl0uowelYIcdP3oVg,11878
73
- xradio-0.0.45.dist-info/LICENSE.txt,sha256=9CYIJt7riOXo9AD0eXBZviLxo_HebD-2JJI8oiWtzfg,1807
74
- xradio-0.0.45.dist-info/METADATA,sha256=S4j62JPPIt_1dTmA5rHGPiwmVARgKvouth0LrQkJy4w,4470
75
- xradio-0.0.45.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
76
- xradio-0.0.45.dist-info/top_level.txt,sha256=dQu27fGBZJ2Yk-gW5XeD-dZ76Xa4Xcvk60Vz-dwXp7k,7
77
- xradio-0.0.45.dist-info/RECORD,,
73
+ xradio-0.0.47.dist-info/LICENSE.txt,sha256=9CYIJt7riOXo9AD0eXBZviLxo_HebD-2JJI8oiWtzfg,1807
74
+ xradio-0.0.47.dist-info/METADATA,sha256=KAix-ctdEBi-LKGLqSiJw64oCKjrZUl5LyrbCwjbJak,4476
75
+ xradio-0.0.47.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
76
+ xradio-0.0.47.dist-info/top_level.txt,sha256=dQu27fGBZJ2Yk-gW5XeD-dZ76Xa4Xcvk60Vz-dwXp7k,7
77
+ xradio-0.0.47.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5