xradio 0.0.40__py3-none-any.whl → 0.0.41__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.
Files changed (47) hide show
  1. xradio/{vis → correlated_data}/__init__.py +3 -2
  2. xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/_tables/load_main_table.py +1 -1
  3. xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/_tables/read.py +14 -0
  4. xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/conversion.py +117 -58
  5. xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/create_antenna_xds.py +195 -167
  6. xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/create_field_and_source_xds.py +40 -39
  7. xradio/correlated_data/_utils/_ms/msv4_info_dicts.py +203 -0
  8. xradio/correlated_data/_utils/_ms/msv4_sub_xdss.py +516 -0
  9. xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/subtables.py +1 -1
  10. xradio/{vis/_vis_utils → correlated_data/_utils}/zarr.py +3 -3
  11. xradio/{vis → correlated_data}/convert_msv2_to_processing_set.py +9 -2
  12. xradio/correlated_data/correlated_xds.py +13 -0
  13. xradio/{vis → correlated_data}/load_processing_set.py +13 -17
  14. xradio/{vis/read_processing_set.py → correlated_data/open_processing_set.py} +20 -22
  15. xradio/{vis/_processing_set.py → correlated_data/processing_set.py} +11 -12
  16. xradio/{vis → correlated_data}/schema.py +572 -186
  17. xradio/correlated_data/test__processing_set.py +74 -0
  18. {xradio-0.0.40.dist-info → xradio-0.0.41.dist-info}/METADATA +9 -10
  19. xradio-0.0.41.dist-info/RECORD +75 -0
  20. {xradio-0.0.40.dist-info → xradio-0.0.41.dist-info}/WHEEL +1 -1
  21. xradio/vis/_vis_utils/_ms/msv4_infos.py +0 -0
  22. xradio/vis/_vis_utils/_ms/msv4_sub_xdss.py +0 -306
  23. xradio-0.0.40.dist-info/RECORD +0 -73
  24. /xradio/{vis/_vis_utils → correlated_data/_utils}/__init__.py +0 -0
  25. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/_tables/load.py +0 -0
  26. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/_tables/read_main_table.py +0 -0
  27. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/_tables/read_subtables.py +0 -0
  28. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/_tables/table_query.py +0 -0
  29. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/_tables/write.py +0 -0
  30. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/_tables/write_exp_api.py +0 -0
  31. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/chunks.py +0 -0
  32. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/descr.py +0 -0
  33. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/msv2_msv3.py +0 -0
  34. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/msv2_to_msv4_meta.py +0 -0
  35. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/optimised_functions.py +0 -0
  36. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/partition_queries.py +0 -0
  37. /xradio/{vis/_vis_utils → correlated_data/_utils}/_ms/partitions.py +0 -0
  38. /xradio/{vis/_vis_utils → correlated_data/_utils}/_utils/cds.py +0 -0
  39. /xradio/{vis/_vis_utils → correlated_data/_utils}/_utils/partition_attrs.py +0 -0
  40. /xradio/{vis/_vis_utils → correlated_data/_utils}/_utils/stokes_types.py +0 -0
  41. /xradio/{vis/_vis_utils → correlated_data/_utils}/_utils/xds_helper.py +0 -0
  42. /xradio/{vis/_vis_utils → correlated_data/_utils}/_zarr/encoding.py +0 -0
  43. /xradio/{vis/_vis_utils → correlated_data/_utils}/_zarr/read.py +0 -0
  44. /xradio/{vis/_vis_utils → correlated_data/_utils}/_zarr/write.py +0 -0
  45. /xradio/{vis/_vis_utils → correlated_data/_utils}/ms.py +0 -0
  46. {xradio-0.0.40.dist-info → xradio-0.0.41.dist-info}/LICENSE.txt +0 -0
  47. {xradio-0.0.40.dist-info → xradio-0.0.41.dist-info}/top_level.txt +0 -0
@@ -12,12 +12,16 @@ import numpy
12
12
  # Dimensions
13
13
  Time = Literal["time"]
14
14
  """ Observation time dimension """
15
+ TimePointing = Literal["time_pointing"]
16
+ """ time dimension of pointing dataset (when not interpolated to main time) """
17
+ TimeEphemeris = Literal["time_ephemeris"]
18
+ """ time dimension of ephemeris data (when not interpolated to main time) """
19
+ TimeCal = Literal["time_cal"]
20
+ """ time dimension of system calibration (when not interpolated to main time) """
15
21
  AntennaName = Literal["antenna_name"]
16
22
  """ Antenna name dimension """
17
- StationId = Literal["station_id"]
18
- """ Station ID dimension """
19
- ReceptorId = Literal["receptor_id"]
20
- """ Receptor ID dimension """
23
+ StationName = Literal["station_name"]
24
+ """ Station identifier dimension """
21
25
  ReceptorLabel = Literal["receptor_label"]
22
26
  """ Receptor label dimension """
23
27
  ToneLabel = Literal["tone_label"]
@@ -26,12 +30,16 @@ BaselineId = Literal["baseline_id"]
26
30
  """ Baseline ID dimension """
27
31
  Frequency = Literal["frequency"]
28
32
  """ Frequency dimension """
33
+ FrequencyCal = Literal["frequency_cal"]
34
+ """ Frequency dimension in the system calibration dataset """
29
35
  Polarization = Literal["polarization"]
30
36
  """ Polarization dimension """
31
37
  UvwLabel = Literal["uvw_label"]
32
38
  """ Coordinate dimension of UVW data (typically shape 3 for 'u', 'v', 'w') """
33
39
  SkyDirLabel = Literal["sky_dir_label"]
34
40
  """ Coordinate labels of sky directions (typically shape 2 and 'ra', 'dec') """
41
+ LocalSkyDirLabel = Literal["local_sky_dir_label"]
42
+ """ Coordinate labels of local sky directions (typically shape 2 and 'az', 'alt') """
35
43
  SphericalDirLabel = Literal["spherical_dir_label"]
36
44
  """ Coordinate labels of spherical directions (shape 2 and 'lon', 'lat1' """
37
45
  SkyPosLabel = Literal["sky_pos_label"]
@@ -44,7 +52,7 @@ CartesianPosLabel = Literal["cartesian_pos_label"]
44
52
  """ Coordinate labels of geocentric earth location data (typically shape 3 and 'x', 'y', 'z')"""
45
53
  TimePhaseCal = Literal["time_phase_cal"]
46
54
  """ Coordinate label for VLBI-specific phase cal time axis """
47
- TimePolynomial = Literal["time_polynomial"]
55
+ nPolynomial = Literal["n_polynomial"]
48
56
  """ For data that is represented as variable in time using Taylor expansion """
49
57
  PolyTerm = Literal["poly_term"]
50
58
  """ Polynomial term used in VLBI GAIN_CURVE """
@@ -112,6 +120,20 @@ class SkyCoordArray:
112
120
  """
113
121
 
114
122
 
123
+ @xarray_dataarray_schema
124
+ class LocalSkyCoordArray:
125
+ """Coordinate array for the arrays that have coordinate local_sky_dir_label
126
+ in pointing_xds"""
127
+
128
+ data: Data[LocalSkyDirLabel, float]
129
+
130
+ type: Attr[str] = "sky_coord"
131
+ units: Attr[list[str]] = ("rad", "rad")
132
+ frame: Attr[str] = ""
133
+ """
134
+ """
135
+
136
+
115
137
  @xarray_dataarray_schema
116
138
  class SkyCoordOffsetArray:
117
139
  data: Data[Union[SkyDirLabel, SkyPosLabel], float]
@@ -135,15 +157,8 @@ class QuantityArray:
135
157
 
136
158
 
137
159
  # Coordinates / Axes
138
- @xarray_dataarray_schema
139
- class TimeCoordArray:
140
- """Data model of visibility time axis. See also :py:class:`TimeArray`."""
141
-
142
- data: Data[Time, float]
143
- """
144
- Time, expressed in seconds since the epoch (see ``scale`` &
145
- ``format``), see also see :py:class:`TimeArray`.
146
- """
160
+ class TimeCoordArrayBase:
161
+ """Base class with the metadata found in time array coords."""
147
162
 
148
163
  integration_time: Optional[Attr[QuantityArray]] = None
149
164
  """ The nominal sampling interval (ms v2). Units of seconds. """
@@ -153,8 +168,6 @@ class TimeCoordArray:
153
168
  the effects of missing data.
154
169
  """
155
170
 
156
- type: Attr[str] = "time"
157
- """ Coordinate type. Should be ``"time"``. """
158
171
  units: Attr[list[str]] = ("s",)
159
172
  """ Units to associate with axis"""
160
173
  scale: Attr[str] = "tai"
@@ -165,6 +178,163 @@ class TimeCoordArray:
165
178
  """ Long-form name to use for axis"""
166
179
 
167
180
 
181
+ @xarray_dataarray_schema
182
+ class TimeCoordArray(TimeCoordArrayBase):
183
+ """Data model of visibility time axis. See also :py:class:`TimeArray`."""
184
+
185
+ data: Data[Time, float]
186
+ """
187
+ Time, expressed in seconds since the epoch (see ``scale`` &
188
+ ``format``), see also see :py:class:`TimeArray`.
189
+ """
190
+
191
+ type: Attr[str] = "time"
192
+ """ Coordinate type. Should be ``"time"``. """
193
+
194
+
195
+ @xarray_dataarray_schema
196
+ class TimeCalCoordArray(TimeCoordArrayBase):
197
+ """Data model of 'time_cal' axis (time axis in system_calibration_xds
198
+ when not interpolated to the main time axis. See also
199
+ :py:class:`TimeCoordArray`."""
200
+
201
+ data: Data[TimeCal, float]
202
+ """
203
+ Time, expressed in seconds since the epoch (see ``scale`` &
204
+ ``format``).
205
+ """
206
+
207
+ type: Attr[str] = "time_cal"
208
+ """ Coordinate type. Should be ``"time_cal"``. """
209
+
210
+
211
+ @xarray_dataarray_schema
212
+ class TimePointingCoordArray(TimeCoordArrayBase):
213
+ """Data model of 'time_pointing' axis (time axis in pointing_xds
214
+ when not interpolated to the main time axis. See also
215
+ :py:class:`TimeCoordArray`."""
216
+
217
+ data: Data[TimePointing, float]
218
+ """
219
+ Time, expressed in seconds since the epoch (see ``scale`` &
220
+ ``format``).
221
+ """
222
+
223
+ type: Attr[str] = "time_pointing"
224
+ """ Coordinate type. Should be ``"time_pointing"``. """
225
+
226
+
227
+ @xarray_dataarray_schema
228
+ class TimeEphemerisCoordArray(TimeCoordArrayBase):
229
+ """Data model of 'time_ephemeris' axis (time axis in field_and_source_info_xds
230
+ when not interpolated to the main time axis. See also
231
+ :py:class:`TimeCoordArray`."""
232
+
233
+ data: Data[TimeEphemeris, float]
234
+ """
235
+ Time, expressed in seconds since the epoch (see ``scale`` &
236
+ ``format``).
237
+ """
238
+
239
+ type: Attr[str] = "time_ephemeris"
240
+ """ Coordinate type. Should be ``"time_ephemeris"``. """
241
+
242
+
243
+ @xarray_dataarray_schema
244
+ class SpectralCoordArray:
245
+ data: Data[ZD, float]
246
+
247
+ frame: Attr[str] = "gcrs"
248
+ """Astropy time scales."""
249
+
250
+ type: Attr[str] = "frequency"
251
+ units: Attr[list[str]] = ("Hz",)
252
+
253
+
254
+ @xarray_dataarray_schema
255
+ class EarthLocationArray:
256
+ data: Data[CartesianPosLabel, float]
257
+
258
+ ellipsoid: Attr[str]
259
+ """
260
+ ITRF makes use of GRS80 ellipsoid and WGS84 makes use of WGS84 ellipsoid
261
+ """
262
+ units: Attr[list[str]] = ("m", "m", "m")
263
+ """
264
+ If the units are a list of strings then it must be the same length as
265
+ the last dimension of the data array. This allows for having different
266
+ units in the same data array,for example geodetic coordinates could use
267
+ ``['rad','rad','m']``.
268
+ """
269
+
270
+
271
+ @xarray_dataarray_schema
272
+ class LocationArray:
273
+ """
274
+ Measure type used for example in field_and_source_xds/OBSERVER_POSITION
275
+ Data dimensions can be EllipsoidPosLabel or CartesianPosLabel
276
+ """
277
+
278
+ data: Data[Union[EllipsoidPosLabel, CartesianPosLabel], float]
279
+
280
+ ellipsoid: Attr[str]
281
+ """
282
+ ITRF makes use of GRS80 ellipsoid and WGS84 makes use of WGS84 ellipsoid
283
+ """
284
+
285
+ origin_object_name: Attr[str]
286
+ """
287
+ earth/sun/moon/etc
288
+ """
289
+
290
+ coordinate_system: Attr[str]
291
+ """ geocentric/planetcentric, geodetic/planetodetic, orbital """
292
+
293
+ type: Attr[str] = "location"
294
+ """ """
295
+
296
+ units: Attr[list[str]] = ("deg", "deg", "m")
297
+ """
298
+ If the units are a list of strings then it must be the same length as
299
+ the last dimension of the data array. This allows for having different
300
+ units in the same data array,for example geodetic coordinates could use
301
+ ``['rad','rad','m']``.
302
+ """
303
+
304
+
305
+ @xarray_dataarray_schema
306
+ class EllipsoidPosLocationArray:
307
+ """
308
+ Measure type used for example in field_and_source_xds/SUB_OBSERVER_POSITION, SUB_SOLAR_POSITION
309
+ """
310
+
311
+ data: Data[EllipsoidPosLabel, float]
312
+
313
+ ellipsoid: Attr[str]
314
+ """
315
+ ITRF makes use of GRS80 ellipsoid and WGS84 makes use of WGS84 ellipsoid
316
+ """
317
+
318
+ origin_object_name: Attr[str]
319
+ """
320
+ earth/sun/moon/etc
321
+ """
322
+
323
+ coordinate_system: Attr[str]
324
+ """ geocentric/planetcentric, geodetic/planetodetic, orbital """
325
+
326
+ type: Attr[str] = "location"
327
+ """ """
328
+
329
+ units: Attr[list[str]] = ("deg", "deg", "m")
330
+ """
331
+ If the units are a list of strings then it must be the same length as
332
+ the last dimension of the data array. This allows for having different
333
+ units in the same data array,for example geodetic coordinates could use
334
+ ``['rad','rad','m']``.
335
+ """
336
+
337
+
168
338
  @xarray_dataset_schema
169
339
  class FieldSourceXds:
170
340
  """
@@ -180,15 +350,28 @@ class FieldSourceXds:
180
350
  """Field name."""
181
351
 
182
352
  time: Optional[Coordof[TimeCoordArray]]
183
- """Midpoint of time for which this set of parameters is accurate"""
353
+ """Midpoint of time for which this set of parameters is accurate. Labeled 'time' when interpolated to main time """
354
+ time_ephemeris: Optional[Coordof[TimeEphemerisCoordArray]]
355
+ """Midpoint of time for which this set of parameters is accurate. Labeled 'time_ephemeris' when not interpolating to main time """
184
356
 
185
357
  line_label: Optional[Coord[LineLabel, str]]
186
358
  """ Line labels (for line names and variables). """
187
359
 
188
- line_names: Optional[Coord[Union[tuple[LineLabel], tuple[Time, LineLabel]], str]]
360
+ line_names: Optional[
361
+ Coord[
362
+ Union[
363
+ tuple[LineLabel],
364
+ tuple[Time, LineLabel],
365
+ tuple[TimeEphemeris, LineLabel],
366
+ ],
367
+ str,
368
+ ]
369
+ ]
189
370
  """ Line names (e.g. v=1, J=1-0, SiO). """
190
371
 
191
- FIELD_PHASE_CENTER: Optional[Data[Union[ZD, Time], SkyCoordOffsetArray]]
372
+ FIELD_PHASE_CENTER: Optional[
373
+ Data[Union[ZD, tuple[Time], tuple[TimeEphemeris]], SkyCoordOffsetArray]
374
+ ]
192
375
  """
193
376
  Offset from the SOURCE_DIRECTION that gives the direction of phase
194
377
  center for which the fringes have been stopped-that is a point source in
@@ -197,27 +380,15 @@ class FieldSourceXds:
197
380
  conversion from MSv2, frame refers column keywords by default. If frame
198
381
  varies with field, it refers DelayDir_Ref column instead.
199
382
  """
200
- FIELD_DELAY_CENTER: Optional[
201
- Data[Union[tuple[SkyDirLabel], tuple[Time, SkyDirLabel]], numpy.float64]
202
- ]
203
- """
204
- Offset from the SOURCE_DIRECTION that gives the direction of delay
205
- center where coherence is maximized by inserting delay into one element of
206
- an interferometer to compensate for the geometrical and instrumental
207
- differential delay. (For conversion from MSv2, frame refers column keywords
208
- by default. If frame varies with field, it refers PhaseDir_Ref column
209
- instead.)
210
- """
211
383
 
212
384
  SOURCE_LOCATION: Optional[
213
385
  Data[
214
386
  Union[
215
- tuple[SkyPosLabel],
216
- tuple[Time, SkyPosLabel],
217
- tuple[SkyDirLabel],
218
- tuple[Time, SkyDirLabel],
387
+ ZD,
388
+ tuple[Time],
389
+ tuple[TimeEphemeris],
219
390
  ],
220
- numpy.float64,
391
+ SkyCoordArray,
221
392
  ]
222
393
  ]
223
394
  """
@@ -231,41 +402,79 @@ class FieldSourceXds:
231
402
  """
232
403
 
233
404
  LINE_REST_FREQUENCY: Optional[
234
- Data[Union[tuple[LineLabel], tuple[Time, LineLabel]], numpy.float64]
405
+ Data[
406
+ Union[
407
+ tuple[LineLabel],
408
+ tuple[Time, LineLabel],
409
+ tuple[TimeEphemeris, LineLabel],
410
+ ],
411
+ SpectralCoordArray,
412
+ ]
235
413
  ]
236
414
  """ Rest frequencies for the transitions. """
237
415
 
238
416
  LINE_SYSTEMIC_VELOCITY: Optional[
239
- Data[Union[tuple[LineLabel], tuple[Time, LineLabel]], numpy.float64]
417
+ Data[
418
+ Union[
419
+ tuple[LineLabel],
420
+ tuple[Time, LineLabel],
421
+ tuple[TimeEphemeris, LineLabel],
422
+ ],
423
+ QuantityArray,
424
+ ]
240
425
  ]
241
426
  """ Systemic velocity at reference """
242
427
 
243
- SOURCE_RADIAL_VELOCITY: Optional[Data[tuple[Time], numpy.float64]]
428
+ SOURCE_RADIAL_VELOCITY: Optional[
429
+ Data[Union[ZD, tuple[Time], tuple[TimeEphemeris]], QuantityArray]
430
+ ]
244
431
  """ CASA Table Cols: RadVel. Geocentric distance rate """
245
432
 
246
- NORTH_POLE_POSITION_ANGLE: Optional[Data[tuple[Time], numpy.float64]]
433
+ NORTH_POLE_POSITION_ANGLE: Optional[
434
+ Data[Union[ZD, tuple[Time], tuple[TimeEphemeris]], QuantityArray]
435
+ ]
247
436
  """ 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. """
248
437
 
249
- NORTH_POLE_ANGULAR_DISTANCE: Optional[Data[tuple[Time], numpy.float64]]
438
+ NORTH_POLE_ANGULAR_DISTANCE: Optional[
439
+ Data[Union[ZD, tuple[Time], tuple[TimeEphemeris]], QuantityArray]
440
+ ]
250
441
  """ 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. """
251
442
 
252
443
  SUB_OBSERVER_DIRECTION: Optional[
253
- Data[tuple[Time, SphericalDirLabel], numpy.float64]
444
+ Data[
445
+ Union[
446
+ ZD,
447
+ tuple[Time],
448
+ tuple[TimeEphemeris],
449
+ ],
450
+ EllipsoidPosLocationArray,
451
+ ]
254
452
  ]
255
453
  """ CASA Table cols: DiskLong, DiskLat. "Apparent planetodetic longitude and latitude of the center of the target disc seen by the OBSERVER at print-time. This is not exactly the same as the "nearest point" for a non-spherical target shape (since the center of the disc might not be the point closest to the observer), but is generally very close if not a very irregular body shape. The IAU2009 rotation models are used except for Earth and MOON, which use higher-precision models. For the gas giants Jupiter, Saturn, Uranus and Neptune, IAU2009 longitude is based on the "System III" prime meridian rotation angle of the magnetic field. By contrast, pole direction (thus latitude) is relative to the body dynamical equator. There can be an offset between the magnetic pole and the dynamical pole of rotation. Down-leg light travel-time from target to observer is taken into account. Latitude is the angle between the equatorial plane and perpendicular to the reference ellipsoid of the body and body oblateness thereby included. 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. 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 : 14. Observer sub-longitude & sub-latitude """
256
454
 
257
- SUB_SOLAR_POSITION: Optional[Data[tuple[Time, SphericalPosLabel], numpy.float64]]
455
+ SUB_SOLAR_POSITION: Optional[
456
+ Data[
457
+ Union[
458
+ ZD,
459
+ tuple[Time],
460
+ tuple[TimeEphemeris],
461
+ ],
462
+ EllipsoidPosLocationArray,
463
+ ]
464
+ ]
258
465
  """ 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 """
259
466
 
260
- HELIOCENTRIC_RADIAL_VELOCITY: Optional[Data[tuple[Time], numpy.float64]]
467
+ HELIOCENTRIC_RADIAL_VELOCITY: Optional[
468
+ Data[Union[ZD, tuple[Time], tuple[TimeEphemeris]], QuantityArray]
469
+ ]
261
470
  """ 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) """
262
471
 
263
- OBSERVER_PHASE_ANGLE: Optional[Data[tuple[Time], numpy.float64]]
472
+ OBSERVER_PHASE_ANGLE: Optional[
473
+ Data[Union[ZD, tuple[Time], tuple[TimeEphemeris]], QuantityArray]
474
+ ]
264
475
  """ 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 """
265
476
 
266
- OBSERVER_POSITION: Optional[
267
- Data[Union[tuple[EllipsoidPosLabel], tuple[CartesianPosLabel]], numpy.float64]
268
- ]
477
+ OBSERVER_POSITION: Optional[Data[ZD, LocationArray]]
269
478
  """ Observer location. """
270
479
 
271
480
  # --- Attributes ---
@@ -302,48 +511,27 @@ class FieldSourceXds:
302
511
  """ Coordinate labels of geocentric earth location data (typically shape 3 and 'x', 'y', 'z')"""
303
512
 
304
513
 
305
- @xarray_dataarray_schema
306
- class SpectralCoordArray:
307
- data: Data[ZD, float]
308
-
309
- frame: Attr[str] = "gcrs"
310
- """Astropy time scales."""
311
-
312
- type: Attr[str] = "frequency"
313
- units: Attr[list[str]] = ("Hz",)
314
-
315
-
316
- @xarray_dataarray_schema
317
- class EarthLocationArray:
318
- data: Data[CartesianPosLabel, float]
319
-
320
- ellipsoid: Attr[str]
321
- """
322
- ITRF makes use of GRS80 ellipsoid and WGS84 makes use of WGS84 ellipsoid
323
- """
324
- units: Attr[list[str]] = ("m", "m", "m")
325
- """
326
- If the units are a list of strings then it must be the same length as
327
- the last dimension of the data array. This allows for having different
328
- units in the same data array,for example geodetic coordinates could use
329
- ``['rad','rad','m']``.
330
- """
331
-
332
-
333
514
  @dict_schema
334
515
  class PartitionInfoDict:
335
516
  # spectral_window_id: missing / remove for good?
336
517
  spectral_window_name: str
518
+ """ Spectral window Name """
337
519
  # field_id: missing / probably remove for good?
338
520
  field_name: list[str]
339
- # source_id: mising / remove for good?
340
- line_name: list[str]
521
+ """ List of all field names """
522
+ polarization_setup: list[str]
523
+ """ List of polrization bases. """
341
524
  scan_number: list[int]
525
+ """ List of scan numbers. """
342
526
  source_name: list[str]
343
- polarization_setup: list[str]
344
- num_lines: int
345
- obs_mode: list[str]
527
+ """ List of source names. """
528
+ # source_id: mising / remove for good?
529
+ intents: list[str]
530
+ """ Infromation in obs_mode column of MSv2 State table. """
346
531
  taql: Optional[str]
532
+ """ The taql query used if converted from MSv2. """
533
+ line_name: list[str]
534
+ """ Spectral line names """
347
535
 
348
536
 
349
537
  @dict_schema
@@ -352,13 +540,13 @@ class ObservationInfoDict:
352
540
  """List of observer names."""
353
541
  project: str
354
542
  """Project Code/Project_UID"""
355
- release_data: str
543
+ release_date: str
356
544
  """Project release date. This is the date on which the data may become
357
545
  public. Format: YYYY-MM-DDTHH:mm:ss.SSS (ISO 8601)"""
358
546
  execution_block_id: Optional[str]
359
547
  """ ASDM: Indicates the position of the execution block in the project
360
548
  (sequential numbering starting at 1). """
361
- execution_block_number: Optional[str]
549
+ execution_block_number: Optional[int]
362
550
  """ASDM: Indicates the position of the execution block in the project
363
551
  (sequential numbering starting at 1)."""
364
552
  execution_block_UID: Optional[str]
@@ -413,7 +601,8 @@ class AntennaNameArray:
413
601
 
414
602
  @xarray_dataset_schema
415
603
  class DopplerXds:
416
- # TODO
604
+ """Not specified. Not implemented."""
605
+
417
606
  pass
418
607
 
419
608
 
@@ -452,6 +641,24 @@ class FrequencyArray:
452
641
  """
453
642
 
454
643
 
644
+ @xarray_dataarray_schema
645
+ class FrequencyCalArray:
646
+ """The frequency_cal coordinate of the system calibration dataset. It has
647
+ only measures data, as opposed to the frequency array of the main dataset."""
648
+
649
+ data: Data[FrequencyCal, float]
650
+ """ Time, expressed in SI seconds since the epoch. """
651
+ reference_value: Attr[SpectralCoordArray]
652
+ """ A frequency representative of the spectral window, usually the sky
653
+ frequency corresponding to the DC edge of the baseband. Used by the calibration
654
+ system if a fixed scaling frequency is required or in algorithms to identify the
655
+ observing band. """
656
+
657
+ type: Attr[str] = "spectral_coord"
658
+ units: Attr[list[str]] = ("Hz",)
659
+ """ Units to associate with axis"""
660
+
661
+
455
662
  @xarray_dataarray_schema
456
663
  class PolarizationArray:
457
664
  """
@@ -501,14 +708,10 @@ class VisibilityArray:
501
708
  Union[numpy.complex64, numpy.complex128],
502
709
  ]
503
710
 
504
- time: Coord[tuple[()], TimeCoordArray]
505
- baseline_id: Coord[tuple[()], BaselineArray]
506
- polarization: Coord[tuple[()], PolarizationArray]
507
- frequency: Coord[tuple[()], FrequencyArray]
508
- time: Coord[ZD, TimeCoordArray]
509
- baseline_id: Coord[ZD, BaselineArray]
510
- polarization: Coord[ZD, PolarizationArray]
511
- frequency: Coord[ZD, FrequencyArray]
711
+ time: Coordof[TimeCoordArray]
712
+ baseline_id: Coordof[BaselineArray]
713
+ polarization: Coordof[PolarizationArray]
714
+ frequency: Coordof[FrequencyArray]
512
715
 
513
716
  field_and_source_xds: Attr[FieldSourceXds]
514
717
  long_name: Optional[Attr[str]] = "Visibility values"
@@ -726,7 +929,7 @@ class AntennaXds:
726
929
  "ALT-AZ+NASMYTH-L:: Nasmyth mount with receivers at the left-hand side of the cabin.
727
930
  ”X-Y” - x-y mount;
728
931
  ”SPACE-HALCA” - specific orientation model."""
729
- telescope_name: Optional[Coord[AntennaName, str]]
932
+ telescope_name: Coord[AntennaName, str]
730
933
  """ Useful when data is combined from mutiple arrays for example ACA + ALMA. """
731
934
  # TODO: receptor_label, polarization_type, sky_dir_label set as optional
732
935
  # for datasets like test_alma_ephemris_mosaic. See also BEAM_OFFSET below.
@@ -742,14 +945,6 @@ class AntennaXds:
742
945
  """ (lon, lat, dist) - either cartesian or ellipsoid"""
743
946
  sky_dir_label: Optional[Coord[SkyDirLabel, str]]
744
947
  """ ra, dec """
745
- time: Optional[Coordof[TimeCoordArray]]
746
- """ Time for VLBI phase cal"""
747
- time_phase_cal: Optional[Coord[TimePhaseCal, numpy.float64]]
748
- """ Time for VLBI phase cal"""
749
- tone_label: Optional[Coord[ToneLabel, str]]
750
- """ ? """
751
- gain_curve_type: Optional[Coord[AntennaName, str]]
752
- """ ? """
753
948
 
754
949
  # Data variables
755
950
  ANTENNA_POSITION: Data[
@@ -796,51 +991,6 @@ class AntennaXds:
796
991
  Focus length. As defined along the optical axis of the antenna.
797
992
  """
798
993
 
799
- GAIN_CURVE: Optional[
800
- Data[tuple[AntennaName, ReceptorLabel, PolyTerm], numpy.float32]
801
- ]
802
- """ VLBI. ? """
803
- GAIN_CURVE_INTERVAL: Optional[Data[tuple[AntennaName], QuantityArray]]
804
- """ VLBI. ? """
805
- GAIN_CURVE_SENSITIVITY: Optional[
806
- Data[tuple[AntennaName, ReceptorLabel], numpy.float32]
807
- ]
808
- """ VLBI. ? """
809
- PHASE_CAL: Optional[
810
- Data[
811
- Union[
812
- tuple[AntennaName, Time, ReceptorLabel, ToneLabel],
813
- tuple[AntennaName, TimePhaseCal, ReceptorLabel, ToneLabel],
814
- ],
815
- numpy.complex64,
816
- ]
817
- ]
818
- """ VLBI. ? """
819
- PHASE_CAL_CABLE_CAL: Optional[
820
- Data[
821
- Union[tuple[AntennaName, Time], tuple[AntennaName, TimePhaseCal]],
822
- QuantityArray,
823
- ]
824
- ]
825
- """ VLBI. ? """
826
- PHASE_CAL_INTERVAL: Optional[
827
- Data[
828
- Union[tuple[AntennaName, Time], tuple[AntennaName, TimePhaseCal]],
829
- QuantityArray,
830
- ]
831
- ]
832
- """ VLBI. ? """
833
- PHASE_CAL_TONE_FREQUENCY: Optional[
834
- Data[
835
- Union[
836
- tuple[AntennaName, Time, ReceptorLabel, ToneLabel],
837
- tuple[AntennaName, TimePhaseCal, ReceptorLabel, ToneLabel],
838
- ],
839
- QuantityArray,
840
- ]
841
- ]
842
- """ VLBI. ? """
843
-
844
994
  # Attributes
845
995
  overall_telescope_name: Optional[Attr[str]]
846
996
  """
@@ -858,37 +1008,174 @@ class AntennaXds:
858
1008
  """
859
1009
 
860
1010
 
1011
+ @xarray_dataset_schema
1012
+ class GainCurveXds:
1013
+ """
1014
+ Gain curve dataset. See See https://casacore.github.io/casacore-notes/265.pdf for a full description.
1015
+ """
1016
+
1017
+ # Coordinates
1018
+ antenna_name: Coordof[AntennaNameArray]
1019
+ """ Antenna name """
1020
+ station: Coord[AntennaName, str]
1021
+ """ Name of the station pad (relevant to arrays with moving antennas). """
1022
+ mount: Coord[AntennaName, str]
1023
+ """ Mount type of the antenna. Reserved keywords include: ”EQUATORIAL” - equatorial mount;
1024
+ ”ALT-AZ” - azimuth-elevation mount;
1025
+ "ALT-AZ+ROTATOR" alt-az mount with feed rotator; introduced for ASKAP dishes;
1026
+ "ALT-AZ+NASMYTH-R": Nasmyth mount with receivers at the right-hand side of the cabin. Many high-frequency antennas used for VLBI have such a mount typel;
1027
+ "ALT-AZ+NASMYTH-L:: Nasmyth mount with receivers at the left-hand side of the cabin.
1028
+ ”X-Y” - x-y mount;
1029
+ ”SPACE-HALCA” - specific orientation model."""
1030
+ telescope_name: Coord[AntennaName, str]
1031
+ """ Useful when data is combined from mutiple arrays for example ACA + ALMA. """
1032
+ # TODO: receptor_label, polarization_type, sky_dir_label set as optional
1033
+ # for datasets like test_alma_ephemris_mosaic. See also BEAM_OFFSET below.
1034
+ receptor_label: Coord[ReceptorLabel, str]
1035
+ """ Names of receptors """
1036
+ polarization_type: Optional[Coord[tuple[AntennaName, ReceptorLabel], str]]
1037
+ """ Polarization type to which each receptor responds (e.g. ”R”,”L”,”X” or ”Y”).
1038
+ This is the receptor polarization type as recorded in the final correlated data (e.g. ”RR”); i.e.
1039
+ as measured after all polarization combiners. ['X','Y'], ['R','L'] """
1040
+ gain_curve_type: Optional[Coord[AntennaName, str]]
1041
+ """
1042
+ Gain curve type. Reserved keywords include:
1043
+ (”POWER(EL)” - Power as a function of elevation;
1044
+ ”POWER(ZA)” - Power as a function of zenith angle;
1045
+ ”VOLTAGE(EL)” - Voltage as a function of elevation;
1046
+ ”VOLTAGE(ZA)” - Voltage as a function of zenith angle). See https://casacore.github.io/casacore-notes/265.pdf
1047
+ """
1048
+
1049
+ GAIN_CURVE_SENSITIVITY: Data[tuple[AntennaName, ReceptorLabel], numpy.float32]
1050
+ """ Sensitivity of the antenna expressed in K/Jy. This is what AIPS calls “DPFU”. """
1051
+ GAIN_CURVE: Data[tuple[AntennaName, PolyTerm, ReceptorLabel], numpy.float32]
1052
+ """ Coefficients of the polynomial that describes the (power or voltage) gain. """
1053
+ GAIN_CURVE_INTERVAL: Data[tuple[AntennaName], QuantityArray]
1054
+ """ Time interval. """
1055
+
1056
+ measured_date: Attr[str]
1057
+ """
1058
+ Date gain curve was measured. Format: YYYY-MM-DDTHH:mm:ss.SSS (ISO 8601)
1059
+ """
1060
+ type: Attr[str] = "gain_curve"
1061
+ """
1062
+ Type of dataset. Expected to be ``gain_curve``
1063
+ """
1064
+
1065
+
1066
+ @xarray_dataset_schema
1067
+ class PhaseCalibrationXds:
1068
+
1069
+ # Coordinates
1070
+ antenna_name: Coordof[AntennaNameArray]
1071
+ """ Antenna name """
1072
+ station: Coord[AntennaName, str]
1073
+ """ Name of the station pad (relevant to arrays with moving antennas). """
1074
+ mount: Coord[AntennaName, str]
1075
+ """ Mount type of the antenna. Reserved keywords include: ”EQUATORIAL” - equatorial mount;
1076
+ ”ALT-AZ” - azimuth-elevation mount;
1077
+ "ALT-AZ+ROTATOR" alt-az mount with feed rotator; introduced for ASKAP dishes;
1078
+ "ALT-AZ+NASMYTH-R": Nasmyth mount with receivers at the right-hand side of the cabin. Many high-frequency antennas used for VLBI have such a mount typel;
1079
+ "ALT-AZ+NASMYTH-L:: Nasmyth mount with receivers at the left-hand side of the cabin.
1080
+ ”X-Y” - x-y mount;
1081
+ ”SPACE-HALCA” - specific orientation model."""
1082
+ telescope_name: Coord[AntennaName, str]
1083
+ """ Useful when data is combined from mutiple arrays for example ACA + ALMA. """
1084
+ # TODO: receptor_label, polarization_type, sky_dir_label set as optional
1085
+ # for datasets like test_alma_ephemris_mosaic. See also BEAM_OFFSET below.
1086
+ receptor_label: Optional[Coord[ReceptorLabel, str]]
1087
+ """ Names of receptors """
1088
+ polarization_type: Optional[Coord[tuple[AntennaName, ReceptorLabel], str]]
1089
+ """ Polarization type to which each receptor responds (e.g. ”R”,”L”,”X” or ”Y”).
1090
+ This is the receptor polarization type as recorded in the final correlated data (e.g. ”RR”); i.e.
1091
+ as measured after all polarization combiners. ['X','Y'], ['R','L'] """
1092
+ time: Optional[Coordof[TimeCoordArray]]
1093
+ """ Time for VLBI phase cal"""
1094
+ time_phase_cal: Optional[Coord[TimePhaseCal, numpy.float64]]
1095
+ """ Time for VLBI phase cal"""
1096
+ tone_label: Optional[Coord[ToneLabel, str]]
1097
+ """
1098
+ Phase-cal tones that are measured. This number may vary by antenna, and may vary by spectral window as well, especially
1099
+ if spectral windows of varying widths are supported
1100
+ """
1101
+
1102
+ PHASE_CAL: Data[
1103
+ Union[
1104
+ tuple[AntennaName, Time, ReceptorLabel, ToneLabel],
1105
+ tuple[AntennaName, TimePhaseCal, ReceptorLabel, ToneLabel],
1106
+ ],
1107
+ numpy.complex64,
1108
+ ]
1109
+ """
1110
+ Phase calibration measurements. These are provided as complex values that represent both the phase
1111
+ and amplitude for a measured phase-cal tone. Measurements are provided as a two-dimensional array such that
1112
+ separate measurements can be provided for each receptor of a feed (so separate values for each polarization)
1113
+ for each of the measured tones. See https://casacore.github.io/casacore-notes/265.pdf
1114
+ """
1115
+ PHASE_CAL_CABLE_CAL: Data[
1116
+ Union[tuple[AntennaName, Time], tuple[AntennaName, TimePhaseCal]],
1117
+ QuantityArray,
1118
+ ]
1119
+ """
1120
+ Cable calibration measurement. This is a measurement of the delay in the cable that provides the
1121
+ reference signal to the receiver. There should be only a single reference signal per feed (even if that feed has
1122
+ multiple receptors) so this is provided as a simple scalar. See https://casacore.github.io/casacore-notes/265.pdf
1123
+ """
1124
+ PHASE_CAL_INTERVAL: Data[
1125
+ Union[tuple[AntennaName, Time], tuple[AntennaName, TimePhaseCal]],
1126
+ QuantityArray,
1127
+ ]
1128
+ """
1129
+ Time interval. See https://casacore.github.io/casacore-notes/265.pdf
1130
+ """
1131
+ PHASE_CAL_TONE_FREQUENCY: Data[
1132
+ Union[
1133
+ tuple[AntennaName, Time, ReceptorLabel, ToneLabel],
1134
+ tuple[AntennaName, TimePhaseCal, ReceptorLabel, ToneLabel],
1135
+ ],
1136
+ QuantityArray,
1137
+ ]
1138
+ """
1139
+ The sky frequencies of each measured phase-cal tone. See https://casacore.github.io/casacore-notes/265.pdf
1140
+ """
1141
+
1142
+ type: Attr[str] = "phase_calibration"
1143
+ """
1144
+ Type of dataset. Expected to be ``phase_calibration``
1145
+ """
1146
+
1147
+
861
1148
  @xarray_dataset_schema
862
1149
  class WeatherXds:
863
1150
  """Weather. Contains station positions and time-dependent mean external
864
1151
  atmosphere and weather information"""
865
1152
 
866
1153
  # Coordinates
1154
+ station_name: Coord[StationName, str]
1155
+ """ Station identifier """
867
1156
  time: Coordof[TimeCoordArray]
868
1157
  """ Mid-point of the time interval """
869
- station_id: Coord[StationId, numpy.int64]
870
- """ Station identifier """
871
1158
  antenna_name: Optional[Coordof[AntennaNameArray]]
872
1159
  """ Antenna identifier """
873
1160
 
874
1161
  # Data variables (all optional)
875
- H2O: Optional[Data[tuple[StationId, Time], QuantityArray]] = None
1162
+ H2O: Optional[Data[tuple[StationName, Time], QuantityArray]] = None
876
1163
  """ Average column density of water """
877
- IONOS_ELECTRON: Optional[Data[tuple[StationId, Time], QuantityArray]] = None
1164
+ IONOS_ELECTRON: Optional[Data[tuple[StationName, Time], QuantityArray]] = None
878
1165
  """ Average column density of electrons """
879
- PRESSURE: Optional[Data[tuple[StationId, Time], QuantityArray]] = None
1166
+ PRESSURE: Optional[Data[tuple[StationName, Time], QuantityArray]] = None
880
1167
  """ Ambient atmospheric pressure """
881
- REL_HUMIDITY: Optional[Data[tuple[StationId, Time], QuantityArray]] = None
1168
+ REL_HUMIDITY: Optional[Data[tuple[StationName, Time], QuantityArray]] = None
882
1169
  """ Ambient relative humidity """
883
- TEMPERATURE: Optional[Data[tuple[StationId, Time], QuantityArray]] = None
1170
+ TEMPERATURE: Optional[Data[tuple[StationName, Time], QuantityArray]] = None
884
1171
  """ Ambient air temperature for an antenna """
885
- DEW_POINT: Optional[Data[tuple[StationId, Time], QuantityArray]] = None
1172
+ DEW_POINT: Optional[Data[tuple[StationName, Time], QuantityArray]] = None
886
1173
  """ Dew point """
887
- WIND_DIRECTION: Optional[Data[tuple[StationId, Time], QuantityArray]] = None
1174
+ WIND_DIRECTION: Optional[Data[tuple[StationName, Time], QuantityArray]] = None
888
1175
  """ Average wind direction """
889
- WIND_SPEED: Optional[Data[tuple[StationId, Time], QuantityArray]] = None
1176
+ WIND_SPEED: Optional[Data[tuple[StationName, Time], QuantityArray]] = None
890
1177
  """ Average wind speed """
891
- STATION_POSITION: Optional[Data[tuple[StationId], QuantityArray]] = None
1178
+ STATION_POSITION: Optional[Data[tuple[StationName], QuantityArray]] = None
892
1179
  """ Station position """
893
1180
 
894
1181
  # Attributes
@@ -900,33 +1187,55 @@ class WeatherXds:
900
1187
 
901
1188
  @xarray_dataset_schema
902
1189
  class PointingXds:
903
- time: Coordof[TimeCoordArray]
904
- """
905
- Mid-point of the time interval for which the information in this row is
906
- valid. Required to use the same time measure reference as in visibility dataset
907
- """
908
1190
  antenna_name: Coordof[AntennaNameArray]
909
1191
  """
910
1192
  Antenna name, as specified by baseline_antenna1/2_name in visibility dataset
911
1193
  """
912
- sky_dir_label: Coord[SkyDirLabel, str]
1194
+
1195
+ local_sky_dir_label: Coord[LocalSkyDirLabel, str]
913
1196
  """
914
1197
  Direction labels.
915
1198
  """
916
1199
 
917
- BEAM_POINTING: Data[
918
- Union[tuple[Time, AntennaName, TimePolynomial], tuple[Time, AntennaName]],
919
- SkyCoordArray,
1200
+ POINTING_BEAM: Data[
1201
+ Union[
1202
+ tuple[Time, AntennaName],
1203
+ tuple[TimePointing, AntennaName],
1204
+ tuple[Time, AntennaName, nPolynomial],
1205
+ tuple[TimePointing, AntennaName, nPolynomial],
1206
+ ],
1207
+ LocalSkyCoordArray,
920
1208
  ]
921
1209
  """
922
1210
  Antenna pointing direction, optionally expressed as polynomial coefficients. DIRECTION in MSv3.
923
1211
  """
924
- DISH_MEASURED_POINTING: Optional[Data[tuple[Time, AntennaName], SkyCoordArray]]
1212
+
1213
+ time: Optional[Coordof[TimeCoordArray]] = None
1214
+ """
1215
+ Mid-point of the time interval for which the information in this row is
1216
+ valid. Required to use the same time measure reference as in visibility dataset.
1217
+ Labeled 'time' when interpolating to main time axis.
1218
+ """
1219
+ time_pointing: Optional[Coordof[TimePointingCoordArray]] = None
1220
+ """ Midpoint of time for which this set of parameters is accurate. Labeled
1221
+ 'time_pointing' when not interpolating to main time axis """
1222
+
1223
+ POINTING_DISH_MEASURED: Optional[
1224
+ Data[
1225
+ Union[
1226
+ tuple[Time, AntennaName],
1227
+ tuple[TimePointing, AntennaName],
1228
+ ],
1229
+ LocalSkyCoordArray,
1230
+ ]
1231
+ ] = None
925
1232
  """
926
1233
  The current encoder values on the primary axes of the mount type for
927
1234
  the antenna. ENCODER in MSv3.
928
1235
  """
929
- OVER_THE_TOP: Optional[Data[tuple[Time, AntennaName], bool]]
1236
+ POINTING_OVER_THE_TOP: Optional[
1237
+ Data[Union[tuple[Time, AntennaName], tuple[TimePointing, AntennaName]], bool]
1238
+ ] = None
930
1239
 
931
1240
 
932
1241
  @xarray_dataset_schema
@@ -949,38 +1258,105 @@ class SystemCalibrationXds:
949
1258
  # Coordinates
950
1259
  antenna_name: Coordof[AntennaNameArray]
951
1260
  """ Antenna identifier """
952
- time: Coordof[TimeCoordArray]
953
- """ Midpoint of time for which this set of parameters is accurate """
954
- receptor_id: Optional[Coord[ReceptorId, numpy.float64]] = None
1261
+ receptor_label: Coord[ReceptorLabel, numpy.int64]
955
1262
  """ """
956
- frequency: Optional[Coordof[FrequencyArray]] = None
1263
+ time: Optional[Coordof[TimeCoordArray]] = None
1264
+ """ Midpoint of time for which this set of parameters is accurate. Labeled 'time' when interpolating to main time axis """
1265
+ time_cal: Optional[Coordof[TimeCalCoordArray]] = None
1266
+ """ Midpoint of time for which this set of parameters is accurate. Labeled 'time_cal' when not interpolating to main time axis """
1267
+ # frequency: Optional[Coordof[FrequencyArray]] = None
1268
+ frequency: Optional[Coordof[FrequencyCalArray]] = None
957
1269
  """ """
958
1270
 
959
1271
  # Data variables (all optional)
960
- PHASE_DIFFERENCE: Optional[Data[tuple[Time, AntennaName], numpy.float64]] = None
1272
+ PHASE_DIFFERENCE: Optional[
1273
+ Data[
1274
+ Union[tuple[AntennaName, TimeCal], tuple[AntennaName, Time]], numpy.float64
1275
+ ]
1276
+ ] = None
961
1277
  """ Phase difference between receptor 0 and receptor 1 """
962
1278
  TCAL: Optional[
963
- Data[tuple[Time, AntennaName, ReceptorId, Frequency], QuantityArray]
1279
+ Data[
1280
+ Union[
1281
+ tuple[AntennaName, TimeCal, ReceptorLabel, FrequencyCal],
1282
+ tuple[AntennaName, TimeCal, ReceptorLabel, Frequency],
1283
+ tuple[AntennaName, TimeCal, ReceptorLabel],
1284
+ tuple[AntennaName, Time, ReceptorLabel, FrequencyCal],
1285
+ tuple[AntennaName, Time, ReceptorLabel, Frequency],
1286
+ tuple[AntennaName, Time, ReceptorLabel],
1287
+ ],
1288
+ QuantityArray,
1289
+ ]
964
1290
  ] = None
965
1291
  """ Calibration temp """
966
1292
  TRX: Optional[
967
- Data[tuple[Time, AntennaName, ReceptorId, Frequency], QuantityArray]
1293
+ Data[
1294
+ Union[
1295
+ tuple[AntennaName, TimeCal, ReceptorLabel, FrequencyCal],
1296
+ tuple[AntennaName, TimeCal, ReceptorLabel, Frequency],
1297
+ tuple[AntennaName, TimeCal, ReceptorLabel],
1298
+ tuple[AntennaName, Time, ReceptorLabel, FrequencyCal],
1299
+ tuple[AntennaName, Time, ReceptorLabel, Frequency],
1300
+ tuple[AntennaName, Time, ReceptorLabel],
1301
+ ],
1302
+ QuantityArray,
1303
+ ]
968
1304
  ] = None
969
1305
  """ Receiver temperature """
970
1306
  TSKY: Optional[
971
- Data[tuple[Time, AntennaName, ReceptorId, Frequency], QuantityArray]
1307
+ Data[
1308
+ Union[
1309
+ tuple[AntennaName, TimeCal, ReceptorLabel, FrequencyCal],
1310
+ tuple[AntennaName, TimeCal, ReceptorLabel, Frequency],
1311
+ tuple[AntennaName, TimeCal, ReceptorLabel],
1312
+ tuple[AntennaName, Time, ReceptorLabel, FrequencyCal],
1313
+ tuple[AntennaName, Time, ReceptorLabel, Frequency],
1314
+ tuple[AntennaName, Time, ReceptorLabel],
1315
+ ],
1316
+ QuantityArray,
1317
+ ]
972
1318
  ] = None
973
1319
  """ Sky temperature """
974
1320
  TSYS: Optional[
975
- Data[tuple[Time, AntennaName, ReceptorId, Frequency], QuantityArray]
1321
+ Data[
1322
+ Union[
1323
+ tuple[AntennaName, TimeCal, ReceptorLabel, FrequencyCal],
1324
+ tuple[AntennaName, TimeCal, ReceptorLabel, Frequency],
1325
+ tuple[AntennaName, TimeCal, ReceptorLabel],
1326
+ tuple[AntennaName, Time, ReceptorLabel, FrequencyCal],
1327
+ tuple[AntennaName, Time, ReceptorLabel, Frequency],
1328
+ tuple[AntennaName, Time, ReceptorLabel],
1329
+ ],
1330
+ QuantityArray,
1331
+ ]
976
1332
  ] = None
977
1333
  """ System temperature """
978
1334
  TANT: Optional[
979
- Data[tuple[Time, AntennaName, ReceptorId, Frequency], QuantityArray]
1335
+ Data[
1336
+ Union[
1337
+ tuple[AntennaName, TimeCal, ReceptorLabel, FrequencyCal],
1338
+ tuple[AntennaName, TimeCal, ReceptorLabel, Frequency],
1339
+ tuple[AntennaName, TimeCal, ReceptorLabel],
1340
+ tuple[AntennaName, Time, ReceptorLabel, FrequencyCal],
1341
+ tuple[AntennaName, Time, ReceptorLabel, Frequency],
1342
+ tuple[AntennaName, Time, ReceptorLabel],
1343
+ ],
1344
+ QuantityArray,
1345
+ ]
980
1346
  ] = None
981
1347
  """ Antenna temperature """
982
1348
  TANT_SYS: Optional[
983
- Data[tuple[Time, AntennaName, ReceptorId, Frequency], QuantityArray]
1349
+ Data[
1350
+ Union[
1351
+ tuple[AntennaName, TimeCal, ReceptorLabel, FrequencyCal],
1352
+ tuple[AntennaName, TimeCal, ReceptorLabel, Frequency],
1353
+ tuple[AntennaName, TimeCal, ReceptorLabel],
1354
+ tuple[AntennaName, Time, ReceptorLabel, FrequencyCal],
1355
+ tuple[AntennaName, Time, ReceptorLabel, Frequency],
1356
+ tuple[AntennaName, Time, ReceptorLabel],
1357
+ ],
1358
+ QuantityArray,
1359
+ ]
984
1360
  ] = None
985
1361
  """ TANT/TSYS """
986
1362
 
@@ -1013,6 +1389,10 @@ class VisibilityXds:
1013
1389
  """
1014
1390
  Labels for polarization types, e.g. ``['XX','XY','YX','YY']``, ``['RR','RL','LR','LL']``.
1015
1391
  """
1392
+ polarization_mixed: Optional[Coord[tuple[BaselineId, Polarization], str]]
1393
+ """
1394
+ If the polarizations are not constant over baseline
1395
+ """
1016
1396
  uvw_label: Optional[Coordof[UvwLabelArray]]
1017
1397
  """ u,v,w """
1018
1398
  baseline_antenna1_name: Optional[Coordof[BaselineAntennaNameArray]] # IF
@@ -1022,8 +1402,15 @@ class VisibilityXds:
1022
1402
 
1023
1403
  # --- Required Attributes ---
1024
1404
  partition_info: Attr[PartitionInfoDict]
1405
+ observation_info: Attr[ObservationInfoDict]
1406
+ processor_info: Attr[ProcessorInfoDict]
1025
1407
  antenna_xds: Attr[AntennaXds]
1026
1408
 
1409
+ schema_version: Attr[str] = None
1410
+ """Semantic version of xradio data format"""
1411
+ creation_date: Attr[str] = None
1412
+ """Date visibility dataset was created . Format: YYYY-MM-DDTHH:mm:ss.SSS (ISO 8601)"""
1413
+
1027
1414
  # --- Optional Coordinates ---
1028
1415
  scan_number: Optional[Coord[Time, Union[numpy.int64, numpy.int32]]] = None
1029
1416
  """Arbitary scan number to identify data taken in the same logical scan."""
@@ -1076,17 +1463,16 @@ class VisibilityXds:
1076
1463
  """Includes the effects of missing data unlike ``frequency``."""
1077
1464
 
1078
1465
  # --- Optional Attributes ---
1079
- observation_info: Optional[Attr[ObservationInfoDict]] = None
1080
- processor_info: Optional[Attr[ProcessorInfoDict]] = None
1081
- weather_xds: Optional[Attr[WeatherXds]] = None
1082
1466
  pointing_xds: Optional[Attr[PointingXds]] = None
1083
- phased_array_xds: Optional[Attr[PhasedArrayXds]] = None
1084
1467
  system_calibration_xds: Optional[Attr[SystemCalibrationXds]] = None
1468
+ gain_curve_xds: Optional[Attr[GainCurveXds]] = None
1469
+ phase_calibration_xds: Optional[Attr[PhaseCalibrationXds]] = None
1470
+ weather_xds: Optional[Attr[WeatherXds]] = None
1471
+ phased_array_xds: Optional[Attr[PhasedArrayXds]] = None
1472
+
1473
+ xradio_version: Optional[Attr[str]] = None
1474
+ """ Version of XRADIO used if converted from MSv2. """
1085
1475
 
1086
- version: Optional[Attr[str]] = None # TODO:
1087
- """Semantic version of xradio data format"""
1088
- creation_date: Optional[Attr[str]] = None
1089
- """Date visibility dataset was created . Format: YYYY-MM-DDTHH:mm:ss.SSS (ISO 8601)"""
1090
1476
  intent: Optional[Attr[str]] = None
1091
1477
  """Identifies the intention of the scan, such as to calibrate or observe a
1092
1478
  target. See :ref:`scan intents` for possible values.