Schemas

Definitions not specific to a particular dataset schema.

Quantities

Quantity DataArrays encode general-purpose data that relates to certain physical quantities. They are typically associated with an SI unit.

class QuantityInSecondsArray[source]

Bases: object

Quantity with units of seconds

Dimensions Dtype Model Description
data
[]
<f8

QuantityInSecondsArray

Attributes:
units
's'

Default: None

type
'quantity'

Default: 'quantity'

class QuantityInHertzArray[source]

Bases: object

Quantity with units of Hertz

Dimensions Dtype Model Description
data
[]
<f8

QuantityInHertzArray

Attributes:
units
'Hz'

Default: None

type
'quantity'

Default: 'quantity'

class QuantityInMetersArray[source]

Bases: object

Quantity with units of meters

Dimensions Dtype Model Description
data
[]
<f8

QuantityInMetersArray

Attributes:
units
'm'

Default: None

type
'quantity'

Default: 'quantity'

class QuantityInMetersPerSecondArray[source]

Bases: object

Quantity with units of meters per second

Dimensions Dtype Model Description
data
[]
<f8

QuantityInMetersPerSecondArray

Attributes:
units
'm/s'

Default: None

type
'quantity'

Default: 'quantity'

class QuantityInRadiansArray[source]

Bases: object

Quantity with units of radians

Dimensions Dtype Model Description
data
[]
<f8

QuantityInRadiansArray

Attributes:
units
'rad'

Default: None

type
'quantity'

Default: 'quantity'

class QuantityInKelvinArray[source]

Bases: object

Quantity with units of Kelvins

Dimensions Dtype Model Description
data
[]
<f8

QuantityInKelvinArray

Attributes:
units
'K'

Default: None

type
'quantity'

Default: 'quantity'

class QuantityInKelvinPerJanskyArray[source]

Bases: object

Quantity with units of K/Jy (sensitivity in gain curve)

Dimensions Dtype Model Description
data
[]
<f8

QuantityInKelvinPerJanskyArray

Attributes:
units
'K/Jy'

Default: None

type
'quantity'

Default: 'quantity'

class QuantityInPascalArray[source]

Bases: object

Quantity with units of Pa

Dimensions Dtype Model Description
data
[]
<f8

QuantityInPascalArray

Attributes:
units
'Pa'

Default: None

type
'quantity'

Default: 'quantity'

class QuantityInPerSquareMetersArray[source]

Bases: object

Quantity with units of /m^2

Dimensions Dtype Model Description
data
[]
<f8

QuantityInPerSquareMetersArray

Attributes:
units
'/m^2'

Default: None

type
'quantity'

Default: 'quantity'

Measures

As with python-casacore measures, measures are quantities that are interpreted in relation to a specified reference frame (such as UTC for TimeArray or FK5 for SkyCoordArray). Measure definitions are aligned with astropy coordinate naming conventions as much as possible. The table below outlines the different types of XRADIO measures:

class TimeArray[source]

Representation of a time measure.

astropy.time.Time serves as the reference implementation. Data can be converted as follows:

astropy.time.Time(data * astropy.units.Unit(attrs['units'][0]),
                  format=attrs['format'], scale=attrs['scale'])

All formats that express time as floating point numbers since an epoch are permissible, so at present the realistic options are:

  • mjd (from 1858-11-17 00:00:00 UTC)

  • unix (from 1970-01-01 00:00:00 UTC)

  • unix_tai (from 1970-01-01 00:00:00 TAI)

  • cxcsec (from 1998-01-01 00:00:00 TT)

  • gps (from 1980-01-06 00:00:00 UTC)

Dimensions Dtype Model Description
data
[]
<f8

TimeArray

Time since epoch, typically in seconds (see units).

Attributes:
type
'time'

Array type. Should be "time".

Default: 'time'

units
's'

Units to associate with axis

Default: 's'

scale
'tai', 'tcb', 'tcg', 'tdb', 'tt', 'ut1' or 'utc'

Time scale of data. Must be one of ('tai', 'tcb', 'tcg', 'tdb', 'tt', 'ut1', 'utc'), see astropy.time.Time

Default: 'utc'

format
'unix', 'mjd', 'cxcsec' or 'gps'

Time representation and epoch, see TimeArray.

Default: 'unix'

class SpectralCoordArray[source]

Measures array for data variables and attributes that are spectral coordinates.

Dimensions Dtype Model Description
data
[]
<f8

SpectralCoordArray

Attributes:
units
'Hz'

Default: 'Hz'

observer
'REST', 'BARY', 'TOPO', 'gcrs', 'icrs', 'hcrs', 'lsrk', 'lsrd' or 'lsr'

Capitalized reference observers are from casacore. TOPO implies creating astropy earth_location. Astropy velocity reference frames are lowercase. Note that Astropy does not use the name ‘TOPO’ (telescope centric) rather it assumes if no velocity frame is given that this is the default. When converting from MSv2 and casacore frequency frames, the following translations from casacore to astropy frame names are applied: GEO=>gcrs, LSRK=>lsrk, LSRD=>lsrd

Default: 'icrs'

type
'spectral_coord'

Default: 'spectral_coord'

class SkyCoordArray[source]

Measures array for data variables that are sky coordinates, used in FieldSourceXds

Dimensions Dtype Model Description
data
[sky_dir_label]
or [sky_dis_label]
<f8

SkyCoordArray

Attributes:
units
'm' or 'rad'

Default: None

type
'sky_coord'

Default: 'sky_coord'

frame
'icrs', 'fk5', 'fk4', 'fk4noterms', 'galactic', 'galactocentric', 'supergalactic', 'altaz', 'hadec', 'gcrs', 'cirs', 'itrs', 'hcrs', 'teme', 'tete', 'precessedgeocentric', 'geocentricmeanecliptic', 'barycentricmeanecliptic', 'heliocentricmeanecliptic', 'geocentrictrueecliptic', 'barycentrictrueecliptic', 'heliocentrictrueecliptic', 'heliocentriceclipticiau76', 'custombarycentricecliptic', 'lsr', 'lsrk', 'lsrd' or 'galacticlsr'

Possible values are astropy.coordinates.SkyCoord frames. Several casacore frames found in MSv2 are translated to astropy frames as follows: * AZELGEO => altaz * J2000 => fk5 * ICRS => icrs From fixvis docs: clean and the im tool ignore the reference frame claimed by the UVW column (it is often mislabelled as ITRF when it is really FK5 or J2000) and instead assume the (u, v, w)s are in the same frame as the phase tracking center. calcuvw does not yet force the UVW column and field centers to use the same reference frame!

Default: 'icrs'

class LocationArray[source]

Measure type used for example in antenna_xds/ANTENNA_POSITION, weather_xds/STATION_POSITION, field_and_source_xds(ephemeris)/OBSERVER_POSITION.

Data dimensions can be CartesianPosLabel or EllipsoidDirLabel or EllipsoidDisLabel

Dimensions Dtype Model Description
data
[ellipsoid_dir_label]
or [ellipsoid_dis_label]
or [cartesian_pos_label]
<f8

LocationArray

Attributes:
units
'm' or 'rad'

Units of the location coordinates (typically ‘m’ or ‘rad’).

Default: None

frame
'ITRS' or 'Undefined'

Reference frame. Can be ITRS (assumed for all Earth locations) or Undefined (used in non-Earth locations).

Default: None

coordinate_system
'geocentric', 'planetcentric', 'geodetic', 'planetodetic', 'orbital' or 'topocentric'

Can be geocentric/planetcentric, geodetic/planetodetic, orbital

Default: None

origin_object_name

earth/sun/moon/etc.

Default: None

(ellipsoid)
'GRS80', 'WGS84' or 'WGS72'

Ellipsoid used in geodetic Earth locations (with EllipsoidDirLabel and EllipsoidDirLabel coordinate)

Default: None

type
'location'

Measure type. Should be "location".

Default: 'location'

class DopplerArray[source]

Doppler measure information for the frequency coordinate

Dimensions Dtype Model Description
data
[]
<f8

DopplerArray

Attributes:
type
'doppler'

Coordinate type. Should be "doppler".

Default: 'doppler'

units
'ratio' or 'm/s'

Units to associate with axis, [ratio]/[m/s]

Default: 'm/s'

doppler_type
'radio', 'optical', 'z', 'ratio', 'true', 'relativistic', 'beta' or 'gamma'

Allowable values: radio, optical, z, ratio, true, relativistic, beta, gamma. Astropy only has radio and optical. Using casacore types: https://casadocs.readthedocs.io/en/stable/notebooks/memo-series.html?highlight=Spectral%20Frames#Spectral-Frames

Default: 'radio'

Coordinate Labels

For some types of measures, the data consists of values that are labeled using coordinate labels. These labels provide context for interpreting the data:

Coordinate Label Name

Values

Related Measures Type

ellipsoid_dir_label

lon, lat

location

ellipsoid_dis_label

height

location

cartesian_pos_label

x, y, z

location

cartesian_local_pos_label

p, q, r

location

galactic_sky_dir_label

lon, lat

sky_coord

local_sky_dir_label

az, alt

sky_coord

local_sky_dis_label

dist

sky_coord

sky_dir_label

ra, dec

sky_coord

sky_dist_label

dist

sky_coord

uvw_label

u, v, w

uvw

receptor_label

pol_0, pol_1

quantity

tone_label

tone_0, tone_1

spectral_coord

Measures Example

The following example illustrates how measures information is included in both a data variable (FIELD_PHASE_CENTER) and a coordinate (time). The FIELD_PHASE_CENTER data variable has the dimensions time and sky_dir_label. Note that the sky_coord measure requires only the sky_dir_label dimension, not the time dimension.

import xarray as xr
phase_center = xr.DataArray()

import numpy as np
import xarray as xr
import pandas as pd

# Create an empty Xarray Dataset.
xds = xr.Dataset()

# Create the time coordinate with time measures attributes.
time = xr.DataArray(pd.date_range('2000-01-01', periods=3).astype('datetime64[s]').astype(int), dims='time', attrs={'type': 'time', 'units': 's', 'format':'unix', 'scale':'utc'})

# Create FIELD_PHASE_CENTER data variable with coordinates time x sky_dir_label.
coords = {'time': time,
          'sky_dir_label': ['ra', 'dec']}

data = np.array([[-2.10546176, -0.29611873],
       [-2.10521098, -0.29617315],
       [-2.1050196, -0.2961987]])

xds['FIELD_PHASE_CENTER'] = xr.DataArray(data, coords=coords, dims=['time', 'sky_dir_label'])

# Add sky_coord measures attributes to FIELD_PHASE_CENTER.
xds['FIELD_PHASE_CENTER'].attrs = {
    "type": "sky_coord",
    "units": "rad",
    "frame": "icrs",
}

xds
<xarray.Dataset> Size: 96B
Dimensions:             (time: 3, sky_dir_label: 2)
Coordinates:
  * time                (time) int64 24B 946684800 946771200 946857600
  * sky_dir_label       (sky_dir_label) <U3 24B 'ra' 'dec'
Data variables:
    FIELD_PHASE_CENTER  (time, sky_dir_label) float64 48B -2.105 ... -0.2962
# Example of creating an Astropy SkyCoord object from the FIELD_PHASE_CENTER data variable.
from astropy.coordinates import SkyCoord
astropy_skycoord = SkyCoord(ra=xds.FIELD_PHASE_CENTER.sel(sky_dir_label='ra').values,dec=xds.FIELD_PHASE_CENTER.sel(sky_dir_label='dec').values,unit='rad',frame=xds.FIELD_PHASE_CENTER.attrs['frame'])
astropy_skycoord
<SkyCoord (ICRS): (ra, dec) in deg
    [(239.36592723, -16.96635346), (239.38029586, -16.9694715 ),
     (239.39126113, -16.97093541)]>