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.
| Dimensions | Dtype | Model | Description | |
|---|---|---|---|---|
data |
[] |
<f8 |
||
| Attributes: | ||||
units |
's' |
Default: |
||
type |
'quantity' |
Default: |
||
| Dimensions | Dtype | Model | Description | |
|---|---|---|---|---|
data |
[] |
<f8 |
||
| Attributes: | ||||
units |
'Hz' |
Default: |
||
type |
'quantity' |
Default: |
||
| Dimensions | Dtype | Model | Description | |
|---|---|---|---|---|
data |
[] |
<f8 |
||
| Attributes: | ||||
units |
'm' |
Default: |
||
type |
'quantity' |
Default: |
||
- class QuantityInMetersPerSecondArray[source]
Bases:
objectQuantity with units of meters per second
| Dimensions | Dtype | Model | Description | |
|---|---|---|---|---|
data |
[] |
<f8 |
||
| Attributes: | ||||
units |
'm/s' |
Default: |
||
type |
'quantity' |
Default: |
||
| Dimensions | Dtype | Model | Description | |
|---|---|---|---|---|
data |
[] |
<f8 |
||
| Attributes: | ||||
units |
'rad' |
Default: |
||
type |
'quantity' |
Default: |
||
| Dimensions | Dtype | Model | Description | |
|---|---|---|---|---|
data |
[] |
<f8 |
||
| Attributes: | ||||
units |
'K' |
Default: |
||
type |
'quantity' |
Default: |
||
- class QuantityInKelvinPerJanskyArray[source]
Bases:
objectQuantity with units of K/Jy (sensitivity in gain curve)
| Dimensions | Dtype | Model | Description | |
|---|---|---|---|---|
data |
[] |
<f8 |
||
| Attributes: | ||||
units |
'K/Jy' |
Default: |
||
type |
'quantity' |
Default: |
||
| Dimensions | Dtype | Model | Description | |
|---|---|---|---|---|
data |
[] |
<f8 |
||
| Attributes: | ||||
units |
'Pa' |
Default: |
||
type |
'quantity' |
Default: |
||
| Dimensions | Dtype | Model | Description | |
|---|---|---|---|---|
data |
[] |
<f8 |
||
| Attributes: | ||||
units |
'/m^2' |
Default: |
||
type |
'quantity' |
Default: |
||
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.Timeserves 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 |
Time since epoch, typically in seconds (see |
|
| Attributes: | ||||
type |
'time' |
Array type. Should be Default: |
||
units |
's' |
Units to associate with axis Default: |
||
scale |
'tai', 'tcb', 'tcg', 'tdb', 'tt', 'ut1' or 'utc' |
Time scale of data. Must be one of Default: |
||
format |
'unix', 'mjd', 'cxcsec' or 'gps' |
Time representation and epoch, see Default: |
||
- class SpectralCoordArray[source]
Measures array for data variables and attributes that are spectral coordinates.
| Dimensions | Dtype | Model | Description | |
|---|---|---|---|---|
data |
[] |
<f8 |
||
| Attributes: | ||||
units |
'Hz' |
Default: |
||
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: |
||
type |
'spectral_coord' |
Default: |
||
- 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 |
||
| Attributes: | ||||
units |
'm' or 'rad' |
Default: |
||
type |
'sky_coord' |
Default: |
||
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 Default: |
||
- 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 |
||
| Attributes: | ||||
units |
'm' or 'rad' |
Units of the location coordinates (typically ‘m’ or ‘rad’). Default: |
||
frame |
'ITRS' or 'Undefined' |
Reference frame. Can be ITRS (assumed for all Earth locations) or Undefined (used in non-Earth locations). Default: |
||
coordinate_system |
'geocentric', 'planetcentric', 'geodetic', 'planetodetic', 'orbital' or 'topocentric' |
Can be Default: |
||
origin_object_name |
earth/sun/moon/etc. Default: |
|||
(ellipsoid) |
'GRS80', 'WGS84' or 'WGS72' |
Ellipsoid used in geodetic Earth locations (with EllipsoidDirLabel and EllipsoidDirLabel coordinate) Default: |
||
type |
'location' |
Measure type. Should be Default: |
||
| Dimensions | Dtype | Model | Description | |
|---|---|---|---|---|
data |
[] |
<f8 |
||
| Attributes: | ||||
type |
'doppler' |
Coordinate type. Should be Default: |
||
units |
'ratio' or 'm/s' |
Units to associate with axis, [ratio]/[m/s] Default: |
||
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: |
||
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)]>