xradio 0.0.60__py3-none-any.whl → 1.0.1__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.
@@ -9,7 +9,7 @@ from xradio.schema.bases import (
9
9
  from xradio.schema.typing import Attr, Coord, Coordof, Data, Dataof
10
10
  import numpy
11
11
 
12
- MSV4_SCHEMA_VERSION = "4.0.-9987"
12
+ MSV4_SCHEMA_VERSION = "4.0.0"
13
13
 
14
14
  # Dimensions
15
15
  Time = Literal["time"]
@@ -59,7 +59,8 @@ EllipsoidDisLabel = Literal["ellipsoid_dis_label"]
59
59
  CartesianPosLabel = Literal["cartesian_pos_label"]
60
60
  """ Coordinate labels of geocentric earth location data (typically shape 3 and 'x', 'y', 'z')"""
61
61
  CartesianPosLabelLocal = Literal["cartesian_pos_label_local"]
62
- """ Coordinate labels for phased array elements positions relative to their parent station position; defined in a station-local frame (typically shape 3 and 'p', 'q', 'r')"""
62
+ """ Coordinate labels for phased array elements positions relative to their
63
+ parent station position; defined in a station-local frame (typically shape 3 and 'p', `'q', 'r')"""
63
64
  nPolynomial = Literal["n_polynomial"]
64
65
  """ For data that is represented as variable in time using Taylor expansion """
65
66
  PolyTerm = Literal["poly_term"]
@@ -252,14 +253,15 @@ class TimeArray:
252
253
  """ Units to associate with axis"""
253
254
  scale: Attr[AllowedTimeScales] = "utc"
254
255
  """
255
- Time scale of data. Must be one of ``(tai’, tcb’, tcg’, tdb’, tt’, ut1’, utc)``,
256
+ Time scale of data. Must be one of ``('tai', 'tcb', 'tcg', 'tdb', 'tt', 'ut1', 'utc')``,
256
257
  see :py:class:`astropy.time.Time`
257
258
  """
258
259
  format: Attr[AllowedTimeFormats] = "unix"
259
- """Time representation and epoch, see :py:class:`TimeArray`."""
260
+ """Time representation and epoch, see :py:class:`~xradio.measurement_set.schema.TimeArray`."""
260
261
 
261
262
 
262
- # Taken from the list of astropy built-in frame classes: https://docs.astropy.org/en/stable/coordinates/index.html
263
+ # Taken from the list of astropy built-in frame classes:
264
+ # https://docs.astropy.org/en/stable/coordinates/index.html
263
265
  AllowedSkyCoordFrames = Literal[
264
266
  "icrs",
265
267
  "fk5",
@@ -301,14 +303,19 @@ class SkyCoordArray:
301
303
  type: Attr[SkyCoord] = "sky_coord"
302
304
  frame: Attr[AllowedSkyCoordFrames] = "icrs"
303
305
  """
304
- Possible values are astropy SkyCoord frames.
305
- Several casacore frames found in MSv2 are translated to astropy frames as follows: AZELGEO=>altaz, J2000=>fk5, ICRS=>icrs.
306
- From fixvis docs: clean and the im tool ignore the reference frame
307
- claimed by the UVW column (it is often mislabelled as ITRF when it is
308
- really FK5 (J2000)) and instead assume the (u, v, w)s are in the same frame
309
- as the phase tracking center. calcuvw does not yet force the UVW column and
310
- field centers to use the same reference frame! Blank = use the phase
311
- tracking frame of vis.
306
+ Possible values are :py:class:`astropy.coordinates.SkyCoord` frames.
307
+
308
+ Several casacore frames found in MSv2 are translated to ``astropy`` frames as follows:
309
+
310
+ * ``AZELGEO`` => ``altaz``
311
+ * ``J2000`` => ``fk5``
312
+ * ``ICRS`` => ``icrs``
313
+
314
+ From ``fixvis`` docs: ``clean`` and the ``im`` tool ignore the reference frame claimed
315
+ by the UVW column (it is often mislabelled as ITRF when it is really FK5
316
+ or J2000) and instead assume the (u, v, w)s are in the same frame as the phase
317
+ tracking center. ``calcuvw`` does not yet force the UVW column and field centers
318
+ to use the same reference frame!
312
319
  """
313
320
 
314
321
 
@@ -330,16 +337,14 @@ class PointingBeamArray:
330
337
  units: Attr[UnitsOfSkyCoordInMetersOrRadians] = "rad"
331
338
  frame: Attr[AllowedSkyCoordFrames] = "icrs"
332
339
  """
333
- From fixvis docs: clean and the im tool ignore the reference frame claimed by the UVW column (it is often mislabelled
334
- 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
335
- center. calcuvw does not yet force the UVW column and field centers to use the same reference frame! Blank = use the
336
- phase tracking frame of vis.
340
+ Blank = use the phase tracking frame of vis.
337
341
  """
338
342
 
339
343
 
340
344
  @xarray_dataarray_schema
341
345
  class LocalSkyCoordArray:
342
- """Measures array for the arrays that have coordinate local_sky_dir_label in :py:class:`PointingXds`"""
346
+ """Measures array for the arrays that have coordinate local_sky_dir_label in
347
+ :py:class:`PointingXds`"""
343
348
 
344
349
  data: Data[LocalSkyDirLabel, float]
345
350
 
@@ -347,22 +352,25 @@ class LocalSkyCoordArray:
347
352
  units: Attr[UnitsOfSkyCoordInMetersOrRadians] = "rad"
348
353
  frame: Attr[AllowedSkyCoordFrames] = "icrs"
349
354
  """
350
- From fixvis docs: clean and the im tool ignore the reference frame claimed by the UVW column (it is often mislabelled
351
- 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
352
- center. calcuvw does not yet force the UVW column and field centers to use the same reference frame! Blank = use the
353
- phase tracking frame of vis.
355
+ From ``fixvis`` docs: ``clean`` and the ``im`` tool ignore the reference frame claimed
356
+ by the UVW column (it is often mislabelled as ITRF when it is really FK5
357
+ or J2000) and instead assume the (u, v, w)s are in the same frame as the phase
358
+ tracking center. ``calcuvw`` does not yet force the UVW column and field centers
359
+ to use the same reference frame!
360
+
361
+ Blank = use the phase tracking frame of vis.
354
362
  """
355
363
 
356
364
 
357
365
  # Coordinates / Axes
358
366
  @xarray_dataarray_schema
359
367
  class TimeCoordArray:
360
- """Data model of the main dataset time axis. See also :py:class:`TimeArray`."""
368
+ """Data model of the main dataset time axis. See also :py:class:`~xradio.measurement_set.schema.TimeArray`."""
361
369
 
362
370
  data: Data[Time, float]
363
371
  """
364
372
  Time, expressed in seconds since the epoch (see ``scale`` &
365
- ``format``), see also see :py:class:`TimeArray`.
373
+ ``format``), see also see :py:class:`~xradio.measurement_set.schema.TimeArray`.
366
374
  """
367
375
 
368
376
  type: Attr[Time] = "time"
@@ -372,10 +380,10 @@ class TimeCoordArray:
372
380
  """ Units to associate with axis"""
373
381
 
374
382
  scale: Attr[AllowedTimeScales] = "utc"
375
- """ Astropy time scales, see :py:class:`TimeArray` """
383
+ """ Astropy time scales, see :py:class:`~xradio.measurement_set.schema.TimeArray` """
376
384
 
377
385
  format: Attr[AllowedTimeFormats] = "unix"
378
- """ Astropy format, see :py:class:`TimeArray`"""
386
+ """ Astropy format, see :py:class:`~xradio.measurement_set.schema.TimeArray`"""
379
387
 
380
388
  integration_time: Attr[QuantityInSecondsArray] = None
381
389
  """ The nominal sampling interval (ms v2). Units of seconds. """
@@ -389,7 +397,7 @@ class TimeInterpolatedCoordArray:
389
397
  pointing_xds, weather_xds, field_and_source_info_xds, and phase_cal_xds
390
398
  when their respective time_system_cal, time_pointing, time_weather,
391
399
  time_ephemeris or time_phase_cal are interpolated to the main dataset
392
- time. See also :py:class:`TimeArray`.
400
+ time. See also :py:class:`~xradio.measurement_set.schema.TimeArray`.
393
401
 
394
402
  The only difference with respect to the main TimeCoordArray is the
395
403
  absence of the attribute integration_time
@@ -398,7 +406,7 @@ class TimeInterpolatedCoordArray:
398
406
  data: Data[Time, float]
399
407
  """
400
408
  Time, expressed in seconds since the epoch (see ``scale`` &
401
- ``format``), see also see :py:class:`TimeArray`.
409
+ ``format``), see also see :py:class:`~xradio.measurement_set.schema.TimeArray`.
402
410
  """
403
411
 
404
412
  type: Attr[Time] = "time"
@@ -408,10 +416,10 @@ class TimeInterpolatedCoordArray:
408
416
  """ Units to associate with axis"""
409
417
 
410
418
  scale: Attr[AllowedTimeScales] = "utc"
411
- """ Astropy time scales, see :py:class:`TimeArray` """
419
+ """ Astropy time scales, see :py:class:`~xradio.measurement_set.schema.TimeArray` """
412
420
 
413
421
  format: Attr[AllowedTimeFormats] = "unix"
414
- """ Astropy format, see :py:class:`TimeArray`"""
422
+ """ Astropy format, see :py:class:`~xradio.measurement_set.schema.TimeArray`"""
415
423
 
416
424
 
417
425
  @xarray_dataarray_schema
@@ -433,10 +441,10 @@ class TimeSystemCalCoordArray:
433
441
  """ Units to associate with axis"""
434
442
 
435
443
  scale: Attr[AllowedTimeScales] = "utc"
436
- """ Astropy time scales, see :py:class:`TimeArray` """
444
+ """ Astropy time scales, see :py:class:`~xradio.measurement_set.schema.TimeArray` """
437
445
 
438
446
  format: Attr[AllowedTimeFormats] = "unix"
439
- """ Astropy format, see :py:class:`TimeArray`"""
447
+ """ Astropy format, see :py:class:`~xradio.measurement_set.schema.TimeArray`"""
440
448
 
441
449
 
442
450
  @xarray_dataarray_schema
@@ -458,10 +466,10 @@ class TimePointingCoordArray:
458
466
  """ Units to associate with axis"""
459
467
 
460
468
  scale: Attr[AllowedTimeScales] = "utc"
461
- """ Astropy time scales, see :py:class:`TimeArray` """
469
+ """ Astropy time scales, see :py:class:`~xradio.measurement_set.schema.TimeArray` """
462
470
 
463
471
  format: Attr[AllowedTimeFormats] = "unix"
464
- """ Astropy format, see :py:class:`TimeArray`"""
472
+ """ Astropy format, see :py:class:`~xradio.measurement_set.schema.TimeArray`"""
465
473
 
466
474
 
467
475
  @xarray_dataarray_schema
@@ -483,10 +491,10 @@ class TimeEphemerisCoordArray:
483
491
  """ Units to associate with axis"""
484
492
 
485
493
  scale: Attr[AllowedTimeScales] = "utc"
486
- """ Astropy time scales, see :py:class:`TimeArray` """
494
+ """ Astropy time scales, see :py:class:`~xradio.measurement_set.schema.TimeArray` """
487
495
 
488
496
  format: Attr[AllowedTimeFormats] = "unix"
489
- """ Astropy format, see :py:class:`TimeArray`"""
497
+ """ Astropy format, see :py:class:`~xradio.measurement_set.schema.TimeArray`"""
490
498
 
491
499
 
492
500
  @xarray_dataarray_schema
@@ -508,14 +516,15 @@ class TimeWeatherCoordArray:
508
516
  """ Units to associate with axis"""
509
517
 
510
518
  scale: Attr[AllowedTimeScales] = "utc"
511
- """ Astropy time scales, see :py:class:`TimeArray` """
519
+ """ Astropy time scales, see :py:class:`~xradio.measurement_set.schema.TimeArray` """
512
520
 
513
521
  format: Attr[AllowedTimeFormats] = "unix"
514
- """ Astropy format, see :py:class:`TimeArray`"""
522
+ """ Astropy format, see :py:class:`~xradio.measurement_set.schema.TimeArray`"""
515
523
 
516
524
 
517
- # For now allowing both some of the casacore frames (from "REST" to "TOPO" - all in uppercase) as well as
518
- # the astropy frames (all in lowercase, taken from the list of SpectralCoord:
525
+ # For now allowing both some of the casacore frames (from "REST" to "TOPO" -
526
+ # all in uppercase) as well as the astropy frames (all in lowercase, taken
527
+ # from the list of SpectralCoord:
519
528
  # https://docs.astropy.org/en/stable/coordinates/spectralcoord.html)
520
529
  AllowedSpectralCoordFrames = Literal[
521
530
  "REST",
@@ -633,7 +642,7 @@ class BaselineAntennaNameArray:
633
642
  @xarray_dataarray_schema
634
643
  class AntennaNameArray:
635
644
  """
636
- Model of the antenna_name coordinate, used in the main dataset (single dish data, :py:class:`VisibiiltyXds`)
645
+ Model of the antenna_name coordinate, used in the main dataset (single dish data, :py:class:`VisibilityXds`)
637
646
  and several sub-datasets such as antenna_xds, pointing_xds, weather_xds, system_calibration_xds, gain_curve_xds, etc.
638
647
  """
639
648
 
@@ -674,7 +683,7 @@ class FrequencyArray:
674
683
  """ Center frequencies for each channel. """
675
684
  spectral_window_name: Attr[str]
676
685
  """ Name associated with spectral window. """
677
- spectral_window_intent: Attr[str]
686
+ spectral_window_intents: Attr[list[str]]
678
687
  """ An intent string that identifies the intention of the spectral window, for example
679
688
  continuum, spectral line, etc. See :ref:`spw intents` for possible values. """
680
689
  frequency_group_name: Optional[Attr[str]]
@@ -766,24 +775,45 @@ class UvwLabelArray:
766
775
  """ Long-form name to use for axis. Should be ``"U/V/W label"``"""
767
776
 
768
777
 
778
+ @xarray_dataarray_schema
779
+ class ScanArray:
780
+ """Scan number coordinate in the main dataset."""
781
+
782
+ data: Data[Time, str]
783
+ """Scan name for each time sample."""
784
+ scan_intents: Attr[list[str]]
785
+ """ An intent string identifies one intention of the scan, such as to calibrate or observe a
786
+ target. See :ref:`scan intents` for possible intent/subintent values. When converting from MSv2,
787
+ the list of intents is derived from the OBS_MODE column of MSv2 state table (every comma
788
+ separated value is taken as an intent).
789
+ A common convention used in the MSv2 OBS_MODE column is to specify multiple intents separated
790
+ by commas, each of them giving a main intent and a subintent separated by a '#' character. This
791
+ is represented in this attribute as a list of "intent#subintent" strings. These are a few
792
+ example lists:
793
+ ["CALIBRATE_DELAY#ON_SOURCE" , "CALIBRATE_PHASE#ON_SOURCE", "CALIBRATE_WVR#ON_SOURCE"],
794
+ ["CALIBRATE_FLUX#ON_SOURCE" , "CALIBRATE_WVR#ON_SOURCE"],
795
+ ["CALIBRATE_POINTING#ON_SOURCE", "CALIBRATE_WVR#ON_SOURCE", "CALIBRATE_DELAY#ON_SOURCE"],
796
+ ["CALIBRATE_ATMOSPHERE#AMBIENT", "CALIBRATE_WVR#AMBIENT"],
797
+ ["CALIBRATE_FOCUS#ON_SOURCE" , "CALIBRATE_WVR#ON_SOURCE"],
798
+ ["OBSERVE_TARGET#ON_SOURCE"], or ["OBSERVE_TARGE#UNSPECIFIED"].
799
+ The list of possible intent and subintent names (see :ref:`scan intents`) is derived from the
800
+ respective ASDM enumerations.
801
+ """
802
+
803
+ long_name: Optional[Attr[str]] = "Scan name"
804
+ """ Long-form name to use for axis. Should be ``"Scan name"``."""
805
+
806
+
769
807
  # Data variables
770
808
  @xarray_dataarray_schema
771
809
  class FlagArray:
772
810
  """
773
- An array of Boolean values with the same shape as `VISIBILITY`,
774
- representing the cumulative flags applying to this data matrix. Data are
775
- flagged bad if the ``FLAG`` array element is ``True``.
811
+ An array of Boolean or integer values with the same shape as ``VISIBILITY``
812
+ or ``SPECTRUM``,
813
+ representing the cumulative flags applying to this data matrix.
814
+
776
815
  """
777
816
 
778
- # data: Data[
779
- # Union[
780
- # tuple[Time, BaselineId, Frequency, Polarization],
781
- # tuple[Time, BaselineId, Frequency],
782
- # tuple[Time, BaselineId],
783
- # tuple[Time, AntennaName, Frequency, Polarization], # SD
784
- # ],
785
- # bool,
786
- # ]
787
817
  data: Data[
788
818
  Union[
789
819
  tuple[Time, BaselineId, Frequency, Polarization],
@@ -791,11 +821,30 @@ class FlagArray:
791
821
  ],
792
822
  Union[bool, numpy.uint8, numpy.uint16, numpy.uint32, numpy.uint64],
793
823
  ]
824
+ """ Flag value. Data is flagged as bad if the array element is
825
+ ``True`` or nonzero. If integer, the value should be calculated as
826
+ ``(1 << X_BIT1) | (1 << X_BIT2) | ...`` for all applying flag
827
+ reasons as indicated by the ``flag_bits`` attribute (see also
828
+ :ref:`flag bits`). """
794
829
  time: Coordof[TimeCoordArray]
795
830
  baseline_id: Optional[Coordof[BaselineArray]] # Only IF
796
831
  antenna_name: Optional[Coordof[AntennaNameArray]] # Only SD
797
832
  frequency: Coordof[FrequencyArray]
798
833
  polarization: Optional[Coordof[PolarizationArray]] = None
834
+ flag_bits: Optional[Attr[list[str]]] = (
835
+ "UNSPECIFIED_BIT",
836
+ "STATIC_BIT",
837
+ "CAM_BIT",
838
+ "DATA_LOST_BIT",
839
+ "INGEST_RFI_BIT",
840
+ "PREDICTED_RFI_BIT",
841
+ "CAL_RFI_BIT",
842
+ "POSTPROC_BIT",
843
+ )
844
+ """
845
+ Labels associated with bits used in ``FlagArray`` data. See
846
+ :ref:`flag bits` for suggested semantics.
847
+ """
799
848
  long_name: Optional[Attr[str]] = "Visibility flags"
800
849
 
801
850
  allow_multiple_versions: Optional[Attr[bool]] = True
@@ -805,10 +854,12 @@ class FlagArray:
805
854
  class WeightArray:
806
855
  """
807
856
  The weight for each channel, with the same shape as the associated
808
- :py:class:`VisibilityArray`, as assigned by the correlator or processor.
857
+ :py:class:`VisibilityArray` or :py:class:`SpectrumArray`, as assigned
858
+ by the correlator or processor.
809
859
 
810
- Weight spectrum in ms v2 is renamed weight. Should be calculated as
811
- 1/sigma^2 (sigma rms noise).
860
+ Weights are channel-dependent in MSv4, and therefore equivalent to the
861
+ ``WEIGHT_SPECTRUM`` column from MSv2. Should be calculated as
862
+ ``1/sigma^2`` (sigma root mean square noise).
812
863
  """
813
864
 
814
865
  data: Data[
@@ -819,15 +870,6 @@ class WeightArray:
819
870
  Union[numpy.float16, numpy.float32, numpy.float64],
820
871
  ]
821
872
 
822
- # data: Data[
823
- # Union[
824
- # tuple[Time, BaselineId, Frequency, Polarization],
825
- # tuple[Time, BaselineId, Frequency],
826
- # tuple[Time, BaselineId],
827
- # tuple[Time, AntennaName, Frequency, Polarization], # SD
828
- # ],
829
- # Union[numpy.float16, numpy.float32, numpy.float64],
830
- # ]
831
873
  """Visibility weights"""
832
874
  time: Coordof[TimeCoordArray]
833
875
  baseline_id: Optional[Coordof[BaselineArray]] # Only IF
@@ -839,8 +881,9 @@ class WeightArray:
839
881
  allow_multiple_versions: Optional[Attr[bool]] = True
840
882
 
841
883
 
842
- # J2000=>fk5 is used most often. icrs is used less often. Both fk5 and icrs are also borrowed from the field center (to fix
843
- # ITRF=>J2000). APP has only been seen in WSRT datasets.
884
+ # J2000=>fk5 is used most often. icrs is used less often. Both fk5 and
885
+ # icrs are also borrowed from the field center (to fix ITRF=>J2000).
886
+ # APP has only been seen in WSRT datasets.
844
887
  AllowedUvwFrames = Literal[
845
888
  "fk5",
846
889
  "icrs",
@@ -930,41 +973,6 @@ class TimeSamplingArray:
930
973
  units: Attr[UnitsSeconds] = "s"
931
974
 
932
975
 
933
- # @xarray_dataarray_schema
934
- # class FreqSamplingArray:
935
- # """
936
- # Model of frequency related data variables of the main dataset, such as EFFECTIV_CHANNEL_WIDTH and FREQUENCY_CENTROID.
937
- # """
938
-
939
- # data: Data[
940
- # Union[
941
- # tuple[Time, BaselineId, Frequency, Polarization],
942
- # tuple[Time, BaselineId, Frequency],
943
- # tuple[Time, Frequency],
944
- # tuple[Frequency],
945
- # ],
946
- # float,
947
- # ]
948
- # """
949
- # Data about frequency sampling, such as centroid or integration
950
- # time. Concrete function depends on concrete data array within
951
- # :py:class:`VisibilityXds` or :py:class:`SpectrumXds`.
952
- # """
953
- # frequency: Coordof[FrequencyArray]
954
- # time: Optional[Coordof[TimeCoordArray]] = None
955
- # baseline_id: Optional[Coordof[BaselineArray]] = None
956
- # polarization: Optional[Coordof[PolarizationArray]] = None
957
- # long_name: Optional[Attr[str]] = "Frequency sampling data"
958
- # units: Attr[UnitsHertz] = "Hz"
959
- # observer: Attr[AllowedSpectralCoordFrames] = "icrs"
960
- # """
961
- # Astropy velocity reference frames (see :external:ref:`astropy-spectralcoord`).
962
- # Note that Astropy does not use the name
963
- # 'topo' (telescope centric) velocity frame, rather it assumes if no velocity
964
- # frame is given that this is the default.
965
- # """
966
-
967
-
968
976
  @xarray_dataarray_schema
969
977
  class FrequencyCentroidArray:
970
978
  """
@@ -1065,7 +1073,7 @@ class FieldSourceXds:
1065
1073
  SOURCE_DIRECTION: Optional[Data[FieldName, SkyCoordArray]]
1066
1074
  """
1067
1075
  CASA Table Cols: RA,DEC,Rho."Astrometric RA and Dec and Geocentric
1068
- distance with respect to the observers location (Geocentric). "Adjusted
1076
+ distance with respect to the observer's location (Geocentric). "Adjusted
1069
1077
  for light-time aberration only. With respect to the reference plane and
1070
1078
  equinox of the chosen system (ICRF or FK4/B1950). If the FK4/B1950 frame
1071
1079
  output is selected, elliptic aberration terms are added. Astrometric RA/DEC
@@ -1186,7 +1194,7 @@ class FieldSourceEphemerisXds:
1186
1194
  ]
1187
1195
  """
1188
1196
  CASA Table Cols: RA,DEC,Rho."Astrometric RA and Dec and Geocentric
1189
- distance with respect to the observers location (Geocentric). "Adjusted
1197
+ distance with respect to the observer's location (Geocentric). "Adjusted
1190
1198
  for light-time aberration only. With respect to the reference plane and
1191
1199
  equinox of the chosen system (ICRF or FK4/B1950). If the FK4/B1950 frame
1192
1200
  output is selected, elliptic aberration terms are added. Astrometric RA/DEC
@@ -1309,7 +1317,7 @@ class SpectrumArray:
1309
1317
 
1310
1318
  @xarray_dataarray_schema
1311
1319
  class VisibilityArray:
1312
- """Visibility data array in main dataset (interferometric data, :py:class:`VisibiiltyXds`)"""
1320
+ """Visibility data array in main dataset (interferometric data, :py:class:`VisibilityXds`)"""
1313
1321
 
1314
1322
  data: Data[
1315
1323
  tuple[Time, BaselineId, Frequency, Polarization],
@@ -1330,77 +1338,29 @@ class VisibilityArray:
1330
1338
  # Info dicts
1331
1339
 
1332
1340
 
1333
- # @dict_schema
1334
- # class PartitionInfoDict:
1335
- # # spectral_window_id: missing / remove for good?
1336
- # spectral_window_name: str
1337
- # """ Spectral window Name """
1338
- # # field_id: missing / probably remove for good?
1339
- # field_name: list[str]
1340
- # """ List of all field names """
1341
- # polarization_setup: list[str]
1342
- # """ List of polrization bases. """
1343
- # scan_name: list[str]
1344
- # """ List of scan names. """
1345
- # source_name: list[str]
1346
- # """ List of source names. """
1347
- # # source_id: mising / remove for good?
1348
- # intents: list[str]
1349
- # """ An intent string identifies one intention of the scan, such as to calibrate or observe a
1350
- # target. See :ref:`scan intents` for possible values. When converting from MSv2, the list of
1351
- # intents is derived from the OBS_MODE column of MSv2 state table (every comma separated value
1352
- # is taken as an intent). """
1353
- # taql: Optional[str]
1354
- # """ The taql query used if converted from MSv2. """
1355
- # line_name: list[str]
1356
- # """ Spectral line names """
1357
- # antenna_name: Optional[str]
1358
- # """ Name of antenna when partitioning also by antenna (single-dish). """
1359
-
1360
-
1361
1341
  @dict_schema
1362
1342
  class ObservationInfoDict:
1363
1343
  observer: list[str]
1364
1344
  """List of observer names."""
1365
- project: str
1366
- """Project Code/Project_UID"""
1367
1345
  release_date: str
1368
1346
  """Project release date. This is the date on which the data may become
1369
1347
  public. Format: YYYY-MM-DDTHH:mm:ss.SSS (ISO 8601)"""
1370
- execution_block_id: Optional[str]
1371
- """ ASDM: Indicates the position of the execution block in the project
1372
- (sequential numbering starting at 1). """
1373
- execution_block_number: Optional[int]
1374
- """ASDM: Indicates the position of the execution block in the project
1375
- (sequential numbering starting at 1)."""
1348
+ project_UID: str
1349
+ """Project UID/code. When populated from an ASDM, the entityId string of the projectUID
1350
+ attribute of the ExecBlock table."""
1376
1351
  execution_block_UID: Optional[str]
1377
- """ASDM: The archive’s UID of the execution block."""
1378
- session_reference: Optional[str]
1379
- """ASDM: The observing session reference."""
1380
- observing_script: Optional[str]
1381
- """ASDM: The text of the observation script."""
1382
- observing_script_UID: Optional[str]
1383
- """ASDM: A reference to the Entity which contains the observing script."""
1352
+ """From ASDM: The archive’s UID of the execution block. Intended to be populated with the
1353
+ entityId string of the execBlockUID attribute of the ExecBlock table."""
1354
+ session_reference_UID: Optional[str]
1355
+ """From ASDM: The observing session reference. Intended to be populated with the entityId
1356
+ string of the sessionReference attribute of the ExecBlock table"""
1384
1357
  observing_log: Optional[str]
1385
- """ASDM: Logs of the observation during this execu- tion block."""
1386
- intents: list[str]
1387
- """ An intent string identifies one intention of the scan, such as to calibrate or observe a
1388
- target. See :ref:`scan intents` for possible intent/subintent values. When converting from MSv2,
1389
- the list of intents is derived from the OBS_MODE column of MSv2 state table (every comma
1390
- separated value is taken as an intent).
1391
- A common convention used in the MSv2 OBS_MODE column is to specify multiple intents separated
1392
- by commas, each of them giving a main intent and a subintent separated by a '#' character. This
1393
- is represented in this attribute as a list of "intent#subintent" strings. These are a few
1394
- example lists:
1395
- ["CALIBRATE_DELAY#ON_SOURCE" , "CALIBRATE_PHASE#ON_SOURCE", "CALIBRATE_WVR#ON_SOURCE"],
1396
- ["CALIBRATE_FLUX#ON_SOURCE" , "CALIBRATE_WVR#ON_SOURCE"],
1397
- ["CALIBRATE_POINTING#ON_SOURCE", "CALIBRATE_WVR#ON_SOURCE", "CALIBRATE_DELAY#ON_SOURCE"],
1398
- ["CALIBRATE_ATMOSPHERE#AMBIENT", "CALIBRATE_WVR#AMBIENT"],
1399
- ["CALIBRATE_FOCUS#ON_SOURCE" , "CALIBRATE_WVR#ON_SOURCE"],
1400
- ["OBSERVE_TARGET#ON_SOURCE"], or ["OBSERVE_TARGE#UNSPECIFIED"].
1401
- The list of possible intent and subintent names (see :ref:`scan intents`) is derived from the
1402
- respective ASDM enumerations.
1403
- """
1358
+ """The observing log, as supplied by the telescope or instrument. Or also from ASDM: Logs of
1359
+ the observation during this execution block. When taken from an ASDM, it is intended to be
1360
+ populated with the values of the observingLog attribute of the ExecBlock table."""
1361
+ scheduling_block_UID: Optional[str]
1362
+ """From ASDM: The scheduling block archive’s UID. Intended to be populated with the entityId
1363
+ string of the sbSummaryUID attribute of the SBSummary table. """
1404
1364
 
1405
1365
 
1406
1366
  @dict_schema
@@ -2048,6 +2008,8 @@ class VisibilityXds:
2048
2008
  """
2049
2009
  field_name: Coordof[Coord[Time, str]]
2050
2010
  """Field name."""
2011
+ scan_name: Coordof[ScanArray]
2012
+ """Scan name to identify data taken in the same logical scan."""
2051
2013
 
2052
2014
  # --- Required data variables ---
2053
2015
 
@@ -2089,14 +2051,9 @@ class VisibilityXds:
2089
2051
  """
2090
2052
  uvw_label: Optional[Coordof[UvwLabelArray]] = None
2091
2053
  """ u,v,w """
2092
- scan_name: Optional[Coord[Time, str]] = None
2093
- """Scan name to identify data taken in the same logical scan."""
2094
2054
 
2095
2055
  # --- Optional data variables / arrays ---
2096
2056
 
2097
- # VISIBILITY_CORRECTED: Optional[Dataof[VisibilityArray]] = None
2098
- # VISIBILITY_MODEL: Optional[Dataof[VisibilityArray]] = None
2099
-
2100
2057
  FLAG: Dataof[FlagArray] = None
2101
2058
  WEIGHT: Dataof[WeightArray] = None
2102
2059
  UVW: Dataof[UvwArray] = None
@@ -2112,12 +2069,12 @@ class VisibilityXds:
2112
2069
  """
2113
2070
  The integration time, including the effects of missing data, in contrast to
2114
2071
  ``integration_time`` attribute of the ``time`` coordinate,
2115
- see :py:class:`TimeArray`. (MS v2: ``exposure``).
2072
+ see :py:class:`~xradio.measurement_set.schema.TimeArray`. (MS v2: ``exposure``).
2116
2073
  """
2117
2074
  TIME_CENTROID: Optional[Dataof[TimeSamplingArray]] = None
2118
2075
  """
2119
2076
  The time centroid of the visibility, includes the effects of missing data
2120
- unlike the ``time`` coordinate, see :py:class:`TimeArray`.
2077
+ unlike the ``time`` coordinate, see :py:class:`~xradio.measurement_set.schema.TimeArray`.
2121
2078
  """
2122
2079
  TIME_CENTROID_EXTRA_PRECISION: Optional[Dataof[TimeSamplingArray]] = None
2123
2080
  """Additional precision for ``TIME_CENTROID``"""
@@ -2149,6 +2106,8 @@ class SpectrumXds:
2149
2106
  """
2150
2107
  field_name: Coordof[Coord[Time, str]]
2151
2108
  """Field name."""
2109
+ scan_name: Coordof[ScanArray]
2110
+ """Arbitary scan name to identify data taken in the same logical scan."""
2152
2111
 
2153
2112
  # --- Required data variables ---
2154
2113
  SPECTRUM: Dataof[SpectrumArray]
@@ -2182,8 +2141,6 @@ class SpectrumXds:
2182
2141
  actual polarization basis for each antenna using labels from the set of
2183
2142
  combinations of 'X', 'Y', 'R' and 'L'.
2184
2143
  """
2185
- scan_name: Optional[Coord[Time, str]] = None
2186
- """Arbitary scan name to identify data taken in the same logical scan."""
2187
2144
 
2188
2145
  # SPECTRUM_CORRECTED: Optional[Dataof[SpectrumArray]] = None
2189
2146
 
@@ -2203,12 +2160,12 @@ class SpectrumXds:
2203
2160
  """
2204
2161
  The integration time, including the effects of missing data, in contrast to
2205
2162
  ``integration_time`` attribute of the ``time`` coordinate,
2206
- see :py:class:`TimeArray`. (MS v2: ``exposure``).
2163
+ see :py:class:`~xradio.measurement_set.schema.TimeArray`. (MS v2: ``exposure``).
2207
2164
  """
2208
2165
  TIME_CENTROID: Optional[Dataof[TimeSamplingArray]] = None
2209
2166
  """
2210
2167
  The time centroid of the visibility, includes the effects of missing data
2211
- unlike the ``time`` coordinate, see :py:class:`TimeArray`.
2168
+ unlike the ``time`` coordinate, see :py:class:`~xradio.measurement_set.schema.TimeArray`.
2212
2169
  """
2213
2170
  TIME_CENTROID_EXTRA_PRECISION: Optional[Dataof[TimeSamplingArray]] = None
2214
2171
  """Additional precision for ``TIME_CENTROID``"""
xradio/schema/__init__.py CHANGED
@@ -21,9 +21,6 @@ __all__ = [
21
21
  "xarray_dataclass_to_array_schema",
22
22
  "xarray_dataclass_to_dataset_schema",
23
23
  "xarray_dataclass_to_dict_schema",
24
- "AsDataArray",
25
- "AsDataset",
26
- "AsDict",
27
24
  "xarray_dataarray_schema",
28
25
  "xarray_dataset_schema",
29
26
  "SchemaIssue",