xradio 0.0.46__py3-none-any.whl → 0.0.48__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.
@@ -12,7 +12,7 @@ import numpy
12
12
  # Dimensions
13
13
  Time = Literal["time"]
14
14
  """ Observation time dimension """
15
- TimeCal = Literal["time_cal"]
15
+ TimeSystemCal = Literal["time_system_cal"]
16
16
  """ time dimension of system calibration (when not interpolated to main time)"""
17
17
  TimeEphemeris = Literal["time_ephemeris"]
18
18
  """ time dimension of ephemeris data (when not interpolated to main time) """
@@ -34,7 +34,7 @@ BaselineId = Literal["baseline_id"]
34
34
  """ Baseline ID dimension """
35
35
  Frequency = Literal["frequency"]
36
36
  """ Frequency dimension """
37
- FrequencyCal = Literal["frequency_cal"]
37
+ FrequencySystemCal = Literal["frequency_system_cal"]
38
38
  """ Frequency dimension in the system calibration dataset """
39
39
  Polarization = Literal["polarization"]
40
40
  """ Polarization dimension """
@@ -60,6 +60,8 @@ PolyTerm = Literal["poly_term"]
60
60
  """ Polynomial term used in VLBI GAIN_CURVE """
61
61
  LineLabel = Literal["line_label"]
62
62
  """ Line labels (for line names and variables). """
63
+ FieldName = Literal["field_name"]
64
+ """ Field names dimension. """
63
65
 
64
66
  # Represents "no dimension", i.e. used for coordinates and data variables with
65
67
  # zero dimensions.
@@ -379,7 +381,7 @@ class TimeInterpolatedCoordArray:
379
381
  Data model of a time axis when it is interpolated to match the time
380
382
  axis of the main dataset. This can be used in the system_calibration_xds,
381
383
  pointing_xds, weather_xds, field_and_source_info_xds, and phase_cal_xds
382
- when their respective time_cal, time_pointing, time_weather,
384
+ when their respective time_system_cal, time_pointing, time_weather,
383
385
  time_ephemeris or time_phase_cal are interpolated to the main dataset
384
386
  time. See also :py:class:`TimeArray`.
385
387
 
@@ -407,19 +409,19 @@ class TimeInterpolatedCoordArray:
407
409
 
408
410
 
409
411
  @xarray_dataarray_schema
410
- class TimeCalCoordArray:
411
- """Data model of 'time_cal' axis (time axis in system_calibration_xds
412
+ class TimeSystemCalCoordArray:
413
+ """Data model of 'time_system_cal' axis (time axis in system_calibration_xds
412
414
  subdataset when not interpolated to the main time axis. See also
413
415
  :py:class:`TimeCoordArray`."""
414
416
 
415
- data: Data[TimeCal, float]
417
+ data: Data[TimeSystemCal, float]
416
418
  """
417
419
  Time, expressed in seconds since the epoch (see ``scale`` &
418
420
  ``format``).
419
421
  """
420
422
 
421
- type: Attr[Time] = "time_cal"
422
- """ Coordinate type. Should be ``"time_cal"``. """
423
+ type: Attr[Time] = "time_system_cal"
424
+ """ Coordinate type. Should be ``"time_system_cal"``. """
423
425
 
424
426
  units: Attr[UnitsSeconds] = ("s",)
425
427
  """ Units to associate with axis"""
@@ -627,7 +629,7 @@ class EllipsoidPosLocationArray:
627
629
 
628
630
  @xarray_dataarray_schema
629
631
  class BaselineArray:
630
- """Model of the baseline_id coordinate in the main dataset (interferometric data, :py:class:`VisibiiltyXds`)"""
632
+ """Model of the baseline_id coordinate in the main dataset (interferometric data, :py:class:`VisibilityXds`)"""
631
633
 
632
634
  data: Data[BaselineId, Union[numpy.int64, numpy.int32]]
633
635
  """Unique id for each baseline."""
@@ -718,11 +720,11 @@ class FrequencyArray:
718
720
 
719
721
 
720
722
  @xarray_dataarray_schema
721
- class FrequencyCalArray:
722
- """The frequency_cal coordinate of the system calibration dataset. It has
723
+ class FrequencySystemCalArray:
724
+ """The frequency_system_cal coordinate of the system calibration dataset. It has
723
725
  only measures data, as opposed to the frequency array of the main dataset."""
724
726
 
725
- data: Data[FrequencyCal, float]
727
+ data: Data[FrequencySystemCal, float]
726
728
  """ Center frequencies for each channel. """
727
729
 
728
730
  type: Attr[SpectralCoord] = "spectral_coord"
@@ -961,7 +963,7 @@ class FreqSamplingArray:
961
963
  """
962
964
 
963
965
 
964
- # Define FieldAndSourceXds dataset already here, as it is needed in the
966
+ # Define FieldAndSourceXds and FieldSourceEphemerisXds already here, as they are needed in the
965
967
  # definition of VisibilityArray
966
968
  @xarray_dataset_schema
967
969
  class FieldSourceXds:
@@ -972,34 +974,16 @@ class FieldSourceXds:
972
974
  For single dishes, this is the nominal pointing direction.
973
975
  """
974
976
 
975
- source_name: Optional[Coord[Union[ZD, Time], str]]
977
+ source_name: Coord[FieldName, str]
976
978
  """ Source name. """
977
- field_name: Optional[Coord[Union[ZD, Time], str]]
978
- """Field name."""
979
-
980
- time: Optional[Coordof[TimeInterpolatedCoordArray]]
981
- """Midpoint of time for which this set of parameters is accurate. Labeled 'time' when interpolated to main time """
982
- time_ephemeris: Optional[Coordof[TimeEphemerisCoordArray]]
983
- """Midpoint of time for which this set of parameters is accurate. Labeled 'time_ephemeris' when not interpolating to main time """
984
979
 
985
- line_label: Optional[Coord[LineLabel, str]]
986
- """ Line labels (for line names and variables). """
980
+ field_name: Coord[FieldName, str]
981
+ """Field name."""
987
982
 
988
- line_names: Optional[
989
- Coord[
990
- Union[
991
- tuple[LineLabel],
992
- tuple[Time, LineLabel],
993
- tuple[TimeEphemeris, LineLabel],
994
- ],
995
- str,
996
- ]
997
- ]
998
- """ Line names (e.g. v=1, J=1-0, SiO). """
983
+ sky_dir_label: Coord[SkyDirLabel, str]
984
+ """ Coordinate labels of sky directions (typically shape 2 and 'ra', 'dec') """
999
985
 
1000
- FIELD_PHASE_CENTER: Optional[
1001
- Data[Union[ZD, tuple[Time], tuple[TimeEphemeris]], SkyCoordArray]
1002
- ]
986
+ FIELD_PHASE_CENTER: Optional[Data[FieldName, SkyCoordArray]]
1003
987
  """
1004
988
  Offset from the SOURCE_DIRECTION that gives the direction of phase
1005
989
  center for which the fringes have been stopped-that is a point source in
@@ -1009,25 +993,14 @@ class FieldSourceXds:
1009
993
  varies with field, it refers DelayDir_Ref column instead.
1010
994
  """
1011
995
 
1012
- FIELD_REFERENCE_CENTER: Optional[
1013
- Data[Union[ZD, tuple[Time], tuple[TimeEphemeris]], SkyCoordArray]
1014
- ]
996
+ FIELD_REFERENCE_CENTER: Optional[Data[FieldName, SkyCoordArray]]
1015
997
  """
1016
998
  Used in single-dish to record the associated reference direction if positionswitching
1017
999
  been applied. For conversion from MSv2, frame refers column keywords by default. If
1018
1000
  frame varies with field, it refers DelayDir_Ref column instead.
1019
1001
  """
1020
1002
 
1021
- SOURCE_LOCATION: Optional[
1022
- Data[
1023
- Union[
1024
- ZD,
1025
- tuple[Time],
1026
- tuple[TimeEphemeris],
1027
- ],
1028
- SkyCoordArray,
1029
- ]
1030
- ]
1003
+ SOURCE_LOCATION: Optional[Data[FieldName, SkyCoordArray]]
1031
1004
  """
1032
1005
  CASA Table Cols: RA,DEC,Rho."Astrometric RA and Dec and Geocentric
1033
1006
  distance with respect to the observer’s location (Geocentric). "Adjusted
@@ -1040,11 +1013,7 @@ class FieldSourceXds:
1040
1013
 
1041
1014
  LINE_REST_FREQUENCY: Optional[
1042
1015
  Data[
1043
- Union[
1044
- tuple[LineLabel],
1045
- tuple[Time, LineLabel],
1046
- tuple[TimeEphemeris, LineLabel],
1047
- ],
1016
+ tuple[FieldName, LineLabel],
1048
1017
  SpectralCoordArray,
1049
1018
  ]
1050
1019
  ]
@@ -1052,37 +1021,118 @@ class FieldSourceXds:
1052
1021
 
1053
1022
  LINE_SYSTEMIC_VELOCITY: Optional[
1054
1023
  Data[
1055
- Union[
1056
- tuple[LineLabel],
1057
- tuple[Time, LineLabel],
1058
- tuple[TimeEphemeris, LineLabel],
1059
- ],
1024
+ tuple[FieldName, LineLabel],
1060
1025
  QuantityInMetersPerSecondArray,
1061
1026
  ]
1062
1027
  ]
1063
1028
  """ Systemic velocity at reference """
1064
1029
 
1065
- SOURCE_RADIAL_VELOCITY: Optional[
1030
+ OBSERVER_POSITION: Optional[Data[ZD, LocationArray]]
1031
+ """ Observer location. """
1032
+
1033
+ # --- Attributes ---
1034
+ doppler_shift_velocity: Optional[Attr[UnitsOfDopplerShift]]
1035
+ """ Velocity definition of the Doppler shift, e.g., RADIO or OPTICAL velocity in m/s """
1036
+
1037
+ source_model_url: Optional[Attr[str]]
1038
+ """URL to access source model"""
1039
+
1040
+ type: Attr[Literal["field_and_source"]] = "field_and_source"
1041
+ """
1042
+ Type of dataset.
1043
+ """
1044
+
1045
+ # --- Optional coordinates ---
1046
+ cartesian_pos_label: Optional[Coord[CartesianPosLabel, str]] = ("x", "y", "z")
1047
+ """ Coordinate labels of geocentric earth location data (typically shape 3 and 'x', 'y', 'z')"""
1048
+
1049
+ line_label: Optional[Coord[LineLabel, str]] = ()
1050
+ """ Line labels (for line names and variables). """
1051
+
1052
+ line_names: Optional[Coord[tuple[FieldName, LineLabel], str]] = ()
1053
+ """ Line names (e.g. v=1, J=1-0, SiO). """
1054
+
1055
+
1056
+ @xarray_dataset_schema
1057
+ class FieldSourceEphemerisXds:
1058
+ """
1059
+ Field positions for each source, when the source have ephemeris information.
1060
+
1061
+ Defines a field position on the sky. For interferometers, this is the correlated field position.
1062
+ For single dishes, this is the nominal pointing direction.
1063
+ """
1064
+
1065
+ source_name: Coord[Time, str]
1066
+ """ Source name. """
1067
+
1068
+ field_name: Coord[Time, str]
1069
+ """Field name."""
1070
+
1071
+ time: Coordof[TimeInterpolatedCoordArray]
1072
+ """Midpoint of time for which this set of parameters is accurate. Labeled 'time' when interpolated to main time """
1073
+
1074
+ FIELD_PHASE_CENTER: Optional[Data[tuple[Time], SkyCoordArray]]
1075
+ """
1076
+ Offset from the SOURCE_DIRECTION that gives the direction of phase
1077
+ center for which the fringes have been stopped-that is a point source in
1078
+ this direction will produce a constant measured phase (page 2 of
1079
+ https://articles.adsabs.harvard.edu/pdf/1999ASPC..180...79F). For
1080
+ conversion from MSv2, frame refers column keywords by default. If frame
1081
+ varies with field, it refers DelayDir_Ref column instead.
1082
+ """
1083
+
1084
+ FIELD_REFERENCE_CENTER: Optional[Data[tuple[Time], SkyCoordArray]]
1085
+ """
1086
+ Used in single-dish to record the associated reference direction if positionswitching
1087
+ been applied. For conversion from MSv2, frame refers column keywords by default. If
1088
+ frame varies with field, it refers DelayDir_Ref column instead.
1089
+ """
1090
+
1091
+ LINE_REST_FREQUENCY: Optional[Data[tuple[Time, LineLabel], SpectralCoordArray]]
1092
+ """ Rest frequencies for the transitions. """
1093
+
1094
+ LINE_SYSTEMIC_VELOCITY: Optional[
1095
+ Data[tuple[Time, LineLabel], QuantityInMetersPerSecondArray]
1096
+ ]
1097
+ """ Systemic velocity at reference """
1098
+
1099
+ SOURCE_LOCATION: Optional[
1066
1100
  Data[
1067
- Union[ZD, tuple[Time], tuple[TimeEphemeris]], QuantityInMetersPerSecondArray
1101
+ Union[
1102
+ tuple[Time],
1103
+ tuple[TimeEphemeris],
1104
+ ],
1105
+ SkyCoordArray,
1068
1106
  ]
1069
1107
  ]
1108
+ """
1109
+ CASA Table Cols: RA,DEC,Rho."Astrometric RA and Dec and Geocentric
1110
+ distance with respect to the observer’s location (Geocentric). "Adjusted
1111
+ for light-time aberration only. With respect to the reference plane and
1112
+ equinox of the chosen system (ICRF or FK4/B1950). If the FK4/B1950 frame
1113
+ output is selected, elliptic aberration terms are added. Astrometric RA/DEC
1114
+ is generally used when comparing or reducing data against a star catalog."
1115
+ https://ssd.jpl.nasa.gov/horizons/manual.html : 1. Astrometric RA & DEC
1116
+ """
1117
+
1118
+ SOURCE_RADIAL_VELOCITY: Optional[
1119
+ Data[Union[tuple[Time], tuple[TimeEphemeris]], QuantityInMetersPerSecondArray]
1120
+ ]
1070
1121
  """ CASA Table Cols: RadVel. Geocentric distance rate """
1071
1122
 
1072
1123
  NORTH_POLE_POSITION_ANGLE: Optional[
1073
- Data[Union[ZD, tuple[Time], tuple[TimeEphemeris]], QuantityInRadiansArray]
1124
+ Data[Union[tuple[Time], tuple[TimeEphemeris]], QuantityInRadiansArray]
1074
1125
  ]
1075
1126
  """ CASA Table cols: NP_ang, "Targets' apparent north-pole position angle (counter-clockwise with respect to direction of true-of-date reference-frame north pole) and angular distance from the sub-observer point (center of disc) at print time. A negative distance indicates the north-pole is on the hidden hemisphere." https://ssd.jpl.nasa.gov/horizons/manual.html : 17. North pole position angle & distance from disc center. """
1076
1127
 
1077
1128
  NORTH_POLE_ANGULAR_DISTANCE: Optional[
1078
- Data[Union[ZD, tuple[Time], tuple[TimeEphemeris]], QuantityInRadiansArray]
1129
+ Data[Union[tuple[Time], tuple[TimeEphemeris]], QuantityInRadiansArray]
1079
1130
  ]
1080
1131
  """ CASA Table cols: NP_dist, "Targets' apparent north-pole position angle (counter-clockwise with respect to direction of true-of date reference-frame north pole) and angular distance from the sub-observer point (center of disc) at print time. A negative distance indicates the north-pole is on the hidden hemisphere."https://ssd.jpl.nasa.gov/horizons/manual.html : 17. North pole position angle & distance from disc center. """
1081
1132
 
1082
1133
  SUB_OBSERVER_DIRECTION: Optional[
1083
1134
  Data[
1084
1135
  Union[
1085
- ZD,
1086
1136
  tuple[Time],
1087
1137
  tuple[TimeEphemeris],
1088
1138
  ],
@@ -1094,7 +1144,6 @@ class FieldSourceXds:
1094
1144
  SUB_SOLAR_POSITION: Optional[
1095
1145
  Data[
1096
1146
  Union[
1097
- ZD,
1098
1147
  tuple[Time],
1099
1148
  tuple[TimeEphemeris],
1100
1149
  ],
@@ -1104,14 +1153,12 @@ class FieldSourceXds:
1104
1153
  """ CASA Table cols: Sl_lon, Sl_lat, r. "Heliocentric distance along with "Apparent sub-solar longitude and latitude of the Sun on the target. The apparent planetodetic longitude and latitude of the center of the target disc as seen from the Sun, as seen by the observer at print-time. This is _NOT_ exactly the same as the "sub-solar" (nearest) point for a non-spherical target shape (since the center of the disc seen from the Sun might not be the closest point to the Sun), but is very close if not a highly irregular body shape. Light travel-time from Sun to target and from target to observer is taken into account. Latitude is the angle between the equatorial plane and the line perpendicular to the reference ellipsoid of the body. The reference ellipsoid is an oblate spheroid with a single flatness coefficient in which the y-axis body radius is taken to be the same value as the x-axis radius. Uses IAU2009 rotation models except for Earth and Moon, which uses a higher precision models. Values for Jupiter, Saturn, Uranus and Neptune are Set III, referring to rotation of their magnetic fields. Whether longitude is positive to the east or west for the target will be indicated at the end of the output ephemeris." https://ssd.jpl.nasa.gov/horizons/manual.html : 15. Solar sub-longitude & sub-latitude """
1105
1154
 
1106
1155
  HELIOCENTRIC_RADIAL_VELOCITY: Optional[
1107
- Data[
1108
- Union[ZD, tuple[Time], tuple[TimeEphemeris]], QuantityInMetersPerSecondArray
1109
- ]
1156
+ Data[Union[tuple[Time], tuple[TimeEphemeris]], QuantityInMetersPerSecondArray]
1110
1157
  ]
1111
1158
  """ CASA Table cols: rdot."The Sun's apparent range-rate relative to the target, as seen by the observer. A positive "rdot" means the target was moving away from the Sun, negative indicates movement toward the Sun." https://ssd.jpl.nasa.gov/horizons/manual.html : 19. Solar range & range-rate (relative to target) """
1112
1159
 
1113
1160
  OBSERVER_PHASE_ANGLE: Optional[
1114
- Data[Union[ZD, tuple[Time], tuple[TimeEphemeris]], QuantityInRadiansArray]
1161
+ Data[Union[tuple[Time], tuple[TimeEphemeris]], QuantityInRadiansArray]
1115
1162
  ]
1116
1163
  """ CASA Table cols: phang.""phi" is the true PHASE ANGLE at the observers' location at print time. "PAB-LON" and "PAB-LAT" are the FK4/B1950 or ICRF/J2000 ecliptic longitude and latitude of the phase angle bisector direction; the outward directed angle bisecting the arc created by the apparent vector from Sun to target center and the astrometric vector from observer to target center. For an otherwise uniform ellipsoid, the time when its long-axis is perpendicular to the PAB direction approximately corresponds to lightcurve maximum (or maximum brightness) of the body. PAB is discussed in Harris et al., Icarus 57, 251-258 (1984)." https://ssd.jpl.nasa.gov/horizons/manual.html : Phase angle and bisector """
1117
1164
 
@@ -1124,15 +1171,15 @@ class FieldSourceXds:
1124
1171
 
1125
1172
  source_model_url: Optional[Attr[str]]
1126
1173
  """URL to access source model"""
1174
+
1127
1175
  ephemeris_name: Optional[Attr[str]]
1128
1176
  """The name of the ephemeris. For example DE430.
1129
1177
 
1130
1178
  This can be used with Astropy solar_system_ephemeris.set('DE430'), see
1131
1179
  https://docs.astropy.org/en/stable/coordinates/solarsystem.html.
1132
1180
  """
1133
- is_ephemeris: Attr[bool] = False
1134
1181
 
1135
- type: Attr[Literal["field_and_source"]] = "field_and_source"
1182
+ type: Attr[Literal["field_and_source_ephemeris"]] = "field_and_source_ephemeris"
1136
1183
  """
1137
1184
  Type of dataset.
1138
1185
  """
@@ -1151,6 +1198,15 @@ class FieldSourceXds:
1151
1198
  cartesian_pos_label: Optional[Coord[CartesianPosLabel, str]] = ("x", "y", "z")
1152
1199
  """ Coordinate labels of geocentric earth location data (typically shape 3 and 'x', 'y', 'z')"""
1153
1200
 
1201
+ line_label: Optional[Coord[LineLabel, str]] = ()
1202
+ """ Line labels (for line names and variables). """
1203
+
1204
+ line_names: Optional[Coord[tuple[FieldName, LineLabel], str]] = ()
1205
+ """ Line names (e.g. v=1, J=1-0, SiO). """
1206
+
1207
+ time_ephemeris: Optional[Coordof[TimeEphemerisCoordArray]] = ()
1208
+ """Midpoint of time for which this set of parameters is accurate. Labeled 'time_ephemeris' when not interpolating to main time """
1209
+
1154
1210
 
1155
1211
  @xarray_dataarray_schema
1156
1212
  class SpectrumArray:
@@ -1166,7 +1222,9 @@ class SpectrumArray:
1166
1222
  frequency: Coordof[FrequencyArray]
1167
1223
  polarization: Coordof[PolarizationArray]
1168
1224
 
1169
- field_and_source_xds: Attr[FieldSourceXds]
1225
+ field_and_source_xds: Attr[Union[FieldSourceXds, FieldSourceEphemerisXds]]
1226
+ """ Field and source information. Also alows for variant where ephemeris information is included. """
1227
+
1170
1228
  long_name: Optional[Attr[str]] = "Spectrum values"
1171
1229
  """ Long-form name to use for axis. Should be ``"Spectrum values"``"""
1172
1230
  units: Attr[list[str]] = ("Jy",)
@@ -1186,7 +1244,9 @@ class VisibilityArray:
1186
1244
  polarization: Coordof[PolarizationArray]
1187
1245
  frequency: Coordof[FrequencyArray]
1188
1246
 
1189
- field_and_source_xds: Attr[FieldSourceXds]
1247
+ field_and_source_xds: Attr[Union[FieldSourceXds, FieldSourceEphemerisXds]]
1248
+ """ Field and source information. Also alows for variant where ephemeris information is included. """
1249
+
1190
1250
  long_name: Optional[Attr[str]] = "Visibility values"
1191
1251
  """ Long-form name to use for axis. Should be ``"Visibility values"``"""
1192
1252
  units: Attr[list[str]] = ("Jy",)
@@ -1207,8 +1267,8 @@ class PartitionInfoDict:
1207
1267
  """ List of all field names """
1208
1268
  polarization_setup: list[str]
1209
1269
  """ List of polrization bases. """
1210
- scan_number: list[int]
1211
- """ List of scan numbers. """
1270
+ scan_name: list[str]
1271
+ """ List of scan names. """
1212
1272
  source_name: list[str]
1213
1273
  """ List of source names. """
1214
1274
  # source_id: mising / remove for good?
@@ -1221,6 +1281,8 @@ class PartitionInfoDict:
1221
1281
  """ The taql query used if converted from MSv2. """
1222
1282
  line_name: list[str]
1223
1283
  """ Spectral line names """
1284
+ antenna_name: Optional[str]
1285
+ """ Name of antenna when partitioning also by antenna (single-dish). """
1224
1286
 
1225
1287
 
1226
1288
  @dict_schema
@@ -1368,7 +1430,7 @@ class GainCurveXds:
1368
1430
  """ Useful when data is combined from mutiple arrays for example ACA + ALMA. """
1369
1431
  receptor_label: Coord[ReceptorLabel, str]
1370
1432
  """ Names of receptors """
1371
- polarization_type: Optional[Coord[tuple[AntennaName, ReceptorLabel], str]]
1433
+ polarization_type: Coord[tuple[AntennaName, ReceptorLabel], str]
1372
1434
  """ Polarization type to which each receptor responds (e.g. ”R”,”L”,”X” or ”Y”).
1373
1435
  This is the receptor polarization type as recorded in the final correlated data (e.g. ”RR”); i.e.
1374
1436
  as measured after all polarization combiners. ['X','Y'], ['R','L'] """
@@ -1425,7 +1487,7 @@ class PhaseCalibrationXds:
1425
1487
  """ Useful when data is combined from mutiple arrays for example ACA + ALMA. """
1426
1488
  receptor_label: Coord[ReceptorLabel, str]
1427
1489
  """ Names of receptors """
1428
- polarization_type: Optional[Coord[tuple[AntennaName, ReceptorLabel], str]]
1490
+ polarization_type: Coord[tuple[AntennaName, ReceptorLabel], str]
1429
1491
  """ Polarization type to which each receptor responds (e.g. ”R”,”L”,”X” or ”Y”).
1430
1492
  This is the receptor polarization type as recorded in the final correlated data (e.g. ”RR”); i.e.
1431
1493
  as measured after all polarization combiners. ['X','Y'], ['R','L'] """
@@ -1516,7 +1578,7 @@ class WeatherXds:
1516
1578
  QuantityInPerSquareMetersArray,
1517
1579
  ]
1518
1580
  ] = None
1519
- """ Average column density of water """
1581
+ """ Average column density of water, in zenith direction (rather than line of sight) """
1520
1582
  IONOS_ELECTRON: Optional[
1521
1583
  Data[
1522
1584
  Union[
@@ -1526,7 +1588,7 @@ class WeatherXds:
1526
1588
  QuantityInPerSquareMetersArray,
1527
1589
  ]
1528
1590
  ] = None
1529
- """ Average column density of electrons """
1591
+ """ Average column density of electrons, in zenith direction (rather than line of sight) """
1530
1592
  PRESSURE: Optional[
1531
1593
  Data[
1532
1594
  Union[
@@ -1705,21 +1767,26 @@ class SystemCalibrationXds:
1705
1767
  # Coordinates
1706
1768
  antenna_name: Coordof[AntennaNameArray]
1707
1769
  """ Antenna identifier """
1708
- receptor_label: Coord[ReceptorLabel, numpy.int64]
1770
+ receptor_label: Coord[ReceptorLabel, str]
1771
+ """ Names of receptors """
1772
+ polarization_type: Coord[tuple[AntennaName, ReceptorLabel], str]
1773
+ """ Polarization type to which each receptor responds (e.g. ”R”,”L”,”X” or ”Y”).
1774
+ This is the receptor polarization type as recorded in the final correlated data (e.g. ”RR”); i.e.
1775
+ as measured after all polarization combiners. ['X','Y'], ['R','L'] """
1709
1776
  """ """
1710
1777
  time: Optional[Coordof[TimeInterpolatedCoordArray]] = None
1711
1778
  """ Midpoint of time for which this set of parameters is accurate. Labeled 'time' when interpolating to main time axis """
1712
- time_cal: Optional[Coordof[TimeCalCoordArray]] = None
1713
- """ Midpoint of time for which this set of parameters is accurate. Labeled 'time_cal' when not interpolating to main time axis """
1714
- frequency: Optional[Coordof[FrequencyCalArray]] = None
1779
+ time_system_cal: Optional[Coordof[TimeSystemCalCoordArray]] = None
1780
+ """ Midpoint of time for which this set of parameters is accurate. Labeled 'time_system_cal' when not interpolating to main time axis """
1781
+ frequency: Optional[Coordof[FrequencySystemCalArray]] = None
1715
1782
  """ """
1716
- frequency_cal: Optional[Coord[FrequencyCal, int]] = None
1783
+ frequency_system_cal: Optional[Coord[FrequencySystemCal, int]] = None
1717
1784
  """TODO: What is this?"""
1718
1785
 
1719
1786
  # Data variables (all optional)
1720
1787
  PHASE_DIFFERENCE: Optional[
1721
1788
  Data[
1722
- Union[tuple[AntennaName, TimeCal], tuple[AntennaName, Time]],
1789
+ Union[tuple[AntennaName, TimeSystemCal], tuple[AntennaName, Time]],
1723
1790
  QuantityInRadiansArray,
1724
1791
  ]
1725
1792
  ] = None
@@ -1727,10 +1794,10 @@ class SystemCalibrationXds:
1727
1794
  TCAL: Optional[
1728
1795
  Data[
1729
1796
  Union[
1730
- tuple[AntennaName, TimeCal, ReceptorLabel, FrequencyCal],
1731
- tuple[AntennaName, TimeCal, ReceptorLabel, Frequency],
1732
- tuple[AntennaName, TimeCal, ReceptorLabel],
1733
- tuple[AntennaName, Time, ReceptorLabel, FrequencyCal],
1797
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel, FrequencySystemCal],
1798
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel, Frequency],
1799
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel],
1800
+ tuple[AntennaName, Time, ReceptorLabel, FrequencySystemCal],
1734
1801
  tuple[AntennaName, Time, ReceptorLabel, Frequency],
1735
1802
  tuple[AntennaName, Time, ReceptorLabel],
1736
1803
  ],
@@ -1741,10 +1808,10 @@ class SystemCalibrationXds:
1741
1808
  TRX: Optional[
1742
1809
  Data[
1743
1810
  Union[
1744
- tuple[AntennaName, TimeCal, ReceptorLabel, FrequencyCal],
1745
- tuple[AntennaName, TimeCal, ReceptorLabel, Frequency],
1746
- tuple[AntennaName, TimeCal, ReceptorLabel],
1747
- tuple[AntennaName, Time, ReceptorLabel, FrequencyCal],
1811
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel, FrequencySystemCal],
1812
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel, Frequency],
1813
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel],
1814
+ tuple[AntennaName, Time, ReceptorLabel, FrequencySystemCal],
1748
1815
  tuple[AntennaName, Time, ReceptorLabel, Frequency],
1749
1816
  tuple[AntennaName, Time, ReceptorLabel],
1750
1817
  ],
@@ -1755,10 +1822,10 @@ class SystemCalibrationXds:
1755
1822
  TSKY: Optional[
1756
1823
  Data[
1757
1824
  Union[
1758
- tuple[AntennaName, TimeCal, ReceptorLabel, FrequencyCal],
1759
- tuple[AntennaName, TimeCal, ReceptorLabel, Frequency],
1760
- tuple[AntennaName, TimeCal, ReceptorLabel],
1761
- tuple[AntennaName, Time, ReceptorLabel, FrequencyCal],
1825
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel, FrequencySystemCal],
1826
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel, Frequency],
1827
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel],
1828
+ tuple[AntennaName, Time, ReceptorLabel, FrequencySystemCal],
1762
1829
  tuple[AntennaName, Time, ReceptorLabel, Frequency],
1763
1830
  tuple[AntennaName, Time, ReceptorLabel],
1764
1831
  ],
@@ -1769,10 +1836,10 @@ class SystemCalibrationXds:
1769
1836
  TSYS: Optional[
1770
1837
  Data[
1771
1838
  Union[
1772
- tuple[AntennaName, TimeCal, ReceptorLabel, FrequencyCal],
1773
- tuple[AntennaName, TimeCal, ReceptorLabel, Frequency],
1774
- tuple[AntennaName, TimeCal, ReceptorLabel],
1775
- tuple[AntennaName, Time, ReceptorLabel, FrequencyCal],
1839
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel, FrequencySystemCal],
1840
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel, Frequency],
1841
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel],
1842
+ tuple[AntennaName, Time, ReceptorLabel, FrequencySystemCal],
1776
1843
  tuple[AntennaName, Time, ReceptorLabel, Frequency],
1777
1844
  tuple[AntennaName, Time, ReceptorLabel],
1778
1845
  ],
@@ -1783,10 +1850,10 @@ class SystemCalibrationXds:
1783
1850
  TANT: Optional[
1784
1851
  Data[
1785
1852
  Union[
1786
- tuple[AntennaName, TimeCal, ReceptorLabel, FrequencyCal],
1787
- tuple[AntennaName, TimeCal, ReceptorLabel, Frequency],
1788
- tuple[AntennaName, TimeCal, ReceptorLabel],
1789
- tuple[AntennaName, Time, ReceptorLabel, FrequencyCal],
1853
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel, FrequencySystemCal],
1854
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel, Frequency],
1855
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel],
1856
+ tuple[AntennaName, Time, ReceptorLabel, FrequencySystemCal],
1790
1857
  tuple[AntennaName, Time, ReceptorLabel, Frequency],
1791
1858
  tuple[AntennaName, Time, ReceptorLabel],
1792
1859
  ],
@@ -1797,10 +1864,10 @@ class SystemCalibrationXds:
1797
1864
  TANT_SYS: Optional[
1798
1865
  Data[
1799
1866
  Union[
1800
- tuple[AntennaName, TimeCal, ReceptorLabel, FrequencyCal],
1801
- tuple[AntennaName, TimeCal, ReceptorLabel, Frequency],
1802
- tuple[AntennaName, TimeCal, ReceptorLabel],
1803
- tuple[AntennaName, Time, ReceptorLabel, FrequencyCal],
1867
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel, FrequencySystemCal],
1868
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel, Frequency],
1869
+ tuple[AntennaName, TimeSystemCal, ReceptorLabel],
1870
+ tuple[AntennaName, Time, ReceptorLabel, FrequencySystemCal],
1804
1871
  tuple[AntennaName, Time, ReceptorLabel, Frequency],
1805
1872
  tuple[AntennaName, Time, ReceptorLabel],
1806
1873
  ],
@@ -1878,12 +1945,15 @@ class VisibilityXds:
1878
1945
  # --- Optional Coordinates ---
1879
1946
  polarization_mixed: Optional[Coord[tuple[BaselineId, Polarization], str]] = None
1880
1947
  """
1881
- If the polarizations are not constant over baseline
1948
+ If the polarizations are not constant over baseline. For mixed polarizations one would
1949
+ use ['PP', 'PQ', 'QP', 'QQ'] as the polarization labels and then specify here the
1950
+ actual polarization basis for each baseline using labels from the set of all
1951
+ combinations of 'X', 'Y', 'R' and 'L'.
1882
1952
  """
1883
1953
  uvw_label: Optional[Coordof[UvwLabelArray]] = None
1884
1954
  """ u,v,w """
1885
- scan_number: Optional[Coord[Time, Union[numpy.int64, numpy.int32]]] = None
1886
- """Arbitary scan number to identify data taken in the same logical scan."""
1955
+ scan_name: Optional[Coord[Time, str]] = None
1956
+ """Arbitary scan name to identify data taken in the same logical scan."""
1887
1957
 
1888
1958
  # --- Optional data variables / arrays ---
1889
1959
 
@@ -1974,10 +2044,13 @@ class SpectrumXds:
1974
2044
  # --- Optional Coordinates ---
1975
2045
  polarization_mixed: Optional[Coord[tuple[AntennaName, Polarization], str]] = None
1976
2046
  """
1977
- If the polarizations are not constant over baseline
2047
+ If the polarizations are not constant over antennas. For mixed polarizations one would
2048
+ use ['PP', 'PQ', 'QP', 'QQ'] as the polarization labels and then specify here the
2049
+ actual polarization basis for each antenna using labels from the set of
2050
+ combinations of 'X', 'Y', 'R' and 'L'.
1978
2051
  """
1979
- scan_number: Optional[Coord[Time, Union[numpy.int64, numpy.int32]]] = None
1980
- """Arbitary scan number to identify data taken in the same logical scan."""
2052
+ scan_name: Optional[Coord[Time, str]] = None
2053
+ """Arbitary scan name to identify data taken in the same logical scan."""
1981
2054
 
1982
2055
  # SPECTRUM_CORRECTED: Optional[Dataof[SpectrumArray]] = None
1983
2056
 
@@ -212,6 +212,18 @@ def format_attr_model_text(state, attr) -> StringList:
212
212
  state.nested_parse(vl, 0, line)
213
213
  return line
214
214
 
215
+ if typing.get_origin(attr.typ) == typing.Union:
216
+ vl = StringList()
217
+ type_args = typing.get_args(attr.typ)
218
+ options = []
219
+ for i, arg in enumerate(type_args):
220
+ vl.append(f":py:class:`~{arg.__module__}.{arg.__name__}`", "")
221
+ if i + 1 < len(type_args):
222
+ vl.append(" or ", "")
223
+ with switch_source_input(state, vl):
224
+ state.nested_parse(vl, 0, line)
225
+ return line
226
+
215
227
  # Derived type, e.g. list of types?
216
228
  if typing.get_origin(attr.typ) == list and all(
217
229
  [isinstance(arg, type) for arg in type_args]
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: xradio
3
- Version: 0.0.46
3
+ Version: 0.0.48
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
@@ -37,7 +37,7 @@ License: BSD 3-Clause License
37
37
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38
38
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
39
 
40
- Requires-Python: <3.13,>=3.9
40
+ Requires-Python: <3.14,>=3.9
41
41
  Description-Content-Type: text/markdown
42
42
  License-File: LICENSE.txt
43
43
  Requires-Dist: astropy
@@ -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"