cf_xarray
¶
This notebook is a brief introduction to cf_xarray
’s current capabilities.
import numpy as np import xarray as xr import cf_xarray as cfxr # For this notebooks, it's nicer if we don't show the array values by default xr.set_options(display_expand_data=False)
<xarray.core.options.set_options at 0x7f37d0a15fd0>
cf_xarray
works best when xarray
keeps attributes by default.
xr.set_options(keep_attrs=True)
<xarray.core.options.set_options at 0x7f37d08db890>
Lets read two datasets.
ds = xr.tutorial.load_dataset("air_temperature") ds.air.attrs["standard_name"] = "air_temperature" ds
<xarray.Dataset> Size: 31MB Dimensions: (time: 2920, lat: 25, lon: 53) Coordinates: * lat (lat) float32 100B 75.0 72.5 70.0 67.5 65.0 ... 22.5 20.0 17.5 15.0 * lon (lon) float32 212B 200.0 202.5 205.0 207.5 ... 325.0 327.5 330.0 * time (time) datetime64[ns] 23kB 2013-01-01 ... 2014-12-31T18:00:00 Data variables: air (time, lat, lon) float64 31MB 241.2 242.5 243.5 ... 296.2 295.7 Attributes: Conventions: COARDS title: 4x daily NMC reanalysis (1948) description: Data is from NMC initialized reanalysis\n(4x/day). These a... platform: Model references: http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanaly...
lat
(lat)
float32
75.0 72.5 70.0 ... 20.0 17.5 15.0
array([75. , 72.5, 70. , 67.5, 65. , 62.5, 60. , 57.5, 55. , 52.5, 50. , 47.5, 45. , 42.5, 40. , 37.5, 35. , 32.5, 30. , 27.5, 25. , 22.5, 20. , 17.5, 15. ], dtype=float32)
lon
(lon)
float32
200.0 202.5 205.0 ... 327.5 330.0
array([200. , 202.5, 205. , 207.5, 210. , 212.5, 215. , 217.5, 220. , 222.5, 225. , 227.5, 230. , 232.5, 235. , 237.5, 240. , 242.5, 245. , 247.5, 250. , 252.5, 255. , 257.5, 260. , 262.5, 265. , 267.5, 270. , 272.5, 275. , 277.5, 280. , 282.5, 285. , 287.5, 290. , 292.5, 295. , 297.5, 300. , 302.5, 305. , 307.5, 310. , 312.5, 315. , 317.5, 320. , 322.5, 325. , 327.5, 330. ], dtype=float32)
time
(time)
datetime64[ns]
2013-01-01 ... 2014-12-31T18:00:00
array(['2013-01-01T00:00:00.000000000', '2013-01-01T06:00:00.000000000', '2013-01-01T12:00:00.000000000', ..., '2014-12-31T06:00:00.000000000', '2014-12-31T12:00:00.000000000', '2014-12-31T18:00:00.000000000'], shape=(2920,), dtype='datetime64[ns]')
air
(time, lat, lon)
float64
241.2 242.5 243.5 ... 296.2 295.7
array([[[241.2 , 242.5 , 243.5 , ..., 232.8 , 235.5 , 238.6 ], [243.8 , 244.5 , 244.7 , ..., 232.8 , 235.3 , 239.3 ], [250. , 249.8 , 248.89, ..., 233.2 , 236.39, 241.7 ], ..., [296.6 , 296.2 , 296.4 , ..., 295.4 , 295.1 , 294.7 ], [295.9 , 296.2 , 296.79, ..., 295.9 , 295.9 , 295.2 ], [296.29, 296.79, 297.1 , ..., 296.9 , 296.79, 296.6 ]], [[242.1 , 242.7 , 243.1 , ..., 232. , 233.6 , 235.8 ], [243.6 , 244.1 , 244.2 , ..., 231. , 232.5 , 235.7 ], [253.2 , 252.89, 252.1 , ..., 230.8 , 233.39, 238.5 ], ..., [296.4 , 295.9 , 296.2 , ..., 295.4 , 295.1 , 294.79], [296.2 , 296.7 , 296.79, ..., 295.6 , 295.5 , 295.1 ], [296.29, 297.2 , 297.4 , ..., 296.4 , 296.4 , 296.6 ]], [[242.3 , 242.2 , 242.3 , ..., 234.3 , 236.1 , 238.7 ], [244.6 , 244.39, 244. , ..., 230.3 , 232. , 235.7 ], [256.2 , 255.5 , 254.2 , ..., 231.2 , 233.2 , 238.2 ], ..., ... [294.79, 295.29, 297.49, ..., 295.49, 295.39, 294.69], [296.79, 297.89, 298.29, ..., 295.49, 295.49, 294.79], [298.19, 299.19, 298.79, ..., 296.09, 295.79, 295.79]], [[245.79, 244.79, 243.49, ..., 243.29, 243.99, 244.79], [249.89, 249.29, 248.49, ..., 241.29, 242.49, 244.29], [262.39, 261.79, 261.29, ..., 240.49, 243.09, 246.89], ..., [293.69, 293.89, 295.39, ..., 295.09, 294.69, 294.29], [296.29, 297.19, 297.59, ..., 295.29, 295.09, 294.39], [297.79, 298.39, 298.49, ..., 295.69, 295.49, 295.19]], [[245.09, 244.29, 243.29, ..., 241.69, 241.49, 241.79], [249.89, 249.29, 248.39, ..., 239.59, 240.29, 241.69], [262.99, 262.19, 261.39, ..., 239.89, 242.59, 246.29], ..., [293.79, 293.69, 295.09, ..., 295.29, 295.09, 294.69], [296.09, 296.89, 297.19, ..., 295.69, 295.69, 295.19], [297.69, 298.09, 298.09, ..., 296.49, 296.19, 295.69]]], shape=(2920, 25, 53))
PandasIndex
PandasIndex(Index([75.0, 72.5, 70.0, 67.5, 65.0, 62.5, 60.0, 57.5, 55.0, 52.5, 50.0, 47.5, 45.0, 42.5, 40.0, 37.5, 35.0, 32.5, 30.0, 27.5, 25.0, 22.5, 20.0, 17.5, 15.0], dtype='float32', name='lat'))
PandasIndex
PandasIndex(Index([200.0, 202.5, 205.0, 207.5, 210.0, 212.5, 215.0, 217.5, 220.0, 222.5, 225.0, 227.5, 230.0, 232.5, 235.0, 237.5, 240.0, 242.5, 245.0, 247.5, 250.0, 252.5, 255.0, 257.5, 260.0, 262.5, 265.0, 267.5, 270.0, 272.5, 275.0, 277.5, 280.0, 282.5, 285.0, 287.5, 290.0, 292.5, 295.0, 297.5, 300.0, 302.5, 305.0, 307.5, 310.0, 312.5, 315.0, 317.5, 320.0, 322.5, 325.0, 327.5, 330.0], dtype='float32', name='lon'))
PandasIndex
PandasIndex(DatetimeIndex(['2013-01-01 00:00:00', '2013-01-01 06:00:00', '2013-01-01 12:00:00', '2013-01-01 18:00:00', '2013-01-02 00:00:00', '2013-01-02 06:00:00', '2013-01-02 12:00:00', '2013-01-02 18:00:00', '2013-01-03 00:00:00', '2013-01-03 06:00:00', ... '2014-12-29 12:00:00', '2014-12-29 18:00:00', '2014-12-30 00:00:00', '2014-12-30 06:00:00', '2014-12-30 12:00:00', '2014-12-30 18:00:00', '2014-12-31 00:00:00', '2014-12-31 06:00:00', '2014-12-31 12:00:00', '2014-12-31 18:00:00'], dtype='datetime64[ns]', name='time', length=2920, freq=None))
This one is inspired by POP model output and illustrates how the coordinates attribute is interpreted. It also illustrates one way of tagging curvilinear grids for convenient use of cf_xarray
from cf_xarray.datasets import popds as pop pop
<xarray.Dataset> Size: 29kB Dimensions: (nlat: 20, nlon: 30) Coordinates: TLONG (nlat, nlon) float64 5kB 1.0 1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0 TLAT (nlat, nlon) float64 5kB 2.0 2.0 2.0 2.0 2.0 ... 2.0 2.0 2.0 2.0 ULONG (nlat, nlon) float64 5kB 0.5 0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5 ULAT (nlat, nlon) float64 5kB 2.5 2.5 2.5 2.5 2.5 ... 2.5 2.5 2.5 2.5 * nlon (nlon) int64 240B 0 1 2 3 4 5 6 7 8 ... 21 22 23 24 25 26 27 28 29 * nlat (nlat) int64 160B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Data variables: UVEL (nlat, nlon) float64 5kB 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0 TEMP (nlat, nlon) float64 5kB 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0
TLONG
(nlat, nlon)
float64
1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
array([[1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]])
TLAT
(nlat, nlon)
float64
2.0 2.0 2.0 2.0 ... 2.0 2.0 2.0 2.0
array([[2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.]])
ULONG
(nlat, nlon)
float64
0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5
array([[0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, ... 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]])
ULAT
(nlat, nlon)
float64
2.5 2.5 2.5 2.5 ... 2.5 2.5 2.5 2.5
array([[2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, ... 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5]])
nlon
(nlon)
int64
0 1 2 3 4 5 6 ... 24 25 26 27 28 29
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29])
nlat
(nlat)
int64
0 1 2 3 4 5 6 ... 14 15 16 17 18 19
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
UVEL
(nlat, nlon)
float64
15.0 15.0 15.0 ... 15.0 15.0 15.0
array([[15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., ... 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.]])
TEMP
(nlat, nlon)
float64
15.0 15.0 15.0 ... 15.0 15.0 15.0
array([[15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., ... 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.]])
PandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], dtype='int64', name='nlon'))
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], dtype='int64', name='nlat'))
This synthetic dataset has multiple X
and Y
coords. An example would be model output on a staggered grid.
from cf_xarray.datasets import multiple multiple
<xarray.Dataset> Size: 6kB Dimensions: (x1: 30, y1: 20, x2: 10, y2: 5) Coordinates: * x1 (x1) int64 240B 0 1 2 3 4 5 6 7 8 9 ... 21 22 23 24 25 26 27 28 29 * y1 (y1) int64 160B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 * x2 (x2) int64 80B 0 1 2 3 4 5 6 7 8 9 * y2 (y2) int64 40B 0 1 2 3 4 Data variables: v1 (x1, y1) float64 5kB 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0 15.0 v2 (x2, y2) float64 400B 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0 15.0
x1
(x1)
int64
0 1 2 3 4 5 6 ... 24 25 26 27 28 29
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29])
y1
(y1)
int64
0 1 2 3 4 5 6 ... 14 15 16 17 18 19
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
x2
(x2)
int64
0 1 2 3 4 5 6 7 8 9
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
y2
(y2)
int64
0 1 2 3 4
v1
(x1, y1)
float64
15.0 15.0 15.0 ... 15.0 15.0 15.0
array([[15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], ... [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.]])
v2
(x2, y2)
float64
15.0 15.0 15.0 ... 15.0 15.0 15.0
array([[15., 15., 15., 15., 15.], [15., 15., 15., 15., 15.], [15., 15., 15., 15., 15.], [15., 15., 15., 15., 15.], [15., 15., 15., 15., 15.], [15., 15., 15., 15., 15.], [15., 15., 15., 15., 15.], [15., 15., 15., 15., 15.], [15., 15., 15., 15., 15.], [15., 15., 15., 15., 15.]])
PandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], dtype='int64', name='x1'))
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], dtype='int64', name='y1'))
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype='int64', name='x2'))
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4], dtype='int64', name='y2'))
This dataset has ancillary variables
from cf_xarray.datasets import anc anc
<xarray.Dataset> Size: 3kB Dimensions: (x: 10, y: 20) Dimensions without coordinates: x, y Data variables: q (x, y) float64 2kB 0.7175 -0.686 0.6431 ... 0.9862 2.348 q_error_limit (x, y) float64 2kB -2.502 0.3523 ... -0.586 0.7297 q_detection_limit float64 8B 0.001
q
(x, y)
float64
0.7175 -0.686 ... 0.9862 2.348
array([[ 7.17530423e-01, -6.86025948e-01, 6.43093109e-01, 4.97776730e-01, -8.71888164e-01, 3.53710232e-01, -3.25339346e-01, 1.27343102e+00, -5.89768326e-01, -6.29210849e-02, 3.77091422e-01, -1.00970136e+00, 9.53824269e-01, -1.29146284e+00, -1.64808667e+00, 2.59596830e+00, -6.10732604e-01, 2.05742513e+00, 1.18476549e+00, -1.53874515e-01], [-8.06884830e-01, 1.73937872e+00, -6.80595237e-01, 9.19918583e-01, -5.99323517e-02, -2.96883179e-01, 3.52616678e-01, 6.86444747e-01, 7.92382718e-01, -1.58338024e+00, -8.47025507e-01, -4.54856449e-01, -2.84725005e-01, -1.07362362e+00, 1.28238756e-01, 1.70931061e-01, 3.93062104e-02, 2.52285222e-04, 2.68503459e-01, -2.79392530e-01], [-2.38106606e+00, 7.31034518e-01, 7.84144935e-02, 2.38171621e-01, 1.31616108e+00, -3.28405909e-01, -5.47528349e-01, 1.73920635e-01, 5.00220507e-01, 2.61692785e-01, 7.82718888e-01, 1.25744425e+00, -1.04832796e+00, -4.22098924e-01, 6.38943295e-01, -6.14789030e-01, 3.29312941e+00, 5.81304251e-01, ... -1.12639381e+00, -6.13134716e-01, -2.98490402e-01, 1.01151776e+00, -3.27468450e-01, -1.16720368e+00, 7.36414260e-01, 8.78583414e-01, -1.76489632e+00, 7.61012549e-01, 1.16024243e-01, -1.75528005e-01, 6.04042858e-01, 1.41174847e+00, -9.80282792e-01, 1.09585231e+00, 3.84653187e-01], [-1.56715124e+00, 5.78161358e-01, -2.30967545e+00, -4.32031184e-01, 1.19386083e+00, -4.85161479e-01, 4.72224605e-01, 1.32886198e-01, 7.67331551e-01, 6.50302938e-01, 7.10153173e-01, -7.87072410e-02, -1.90072932e+00, -7.03897279e-02, 1.23635748e-01, 1.36828406e+00, 3.11072696e-01, -3.68720061e-01, 2.09899820e+00, 1.39887493e-01], [ 7.38272057e-01, 1.29559995e+00, 2.36447391e+00, 1.73784500e-01, 5.32155248e-03, -4.46820988e-01, 1.74798584e+00, -9.83448319e-01, -1.82832453e+00, -3.18872886e-01, 8.99457529e-01, -4.94075078e-01, -2.91822398e-01, -5.73741070e-01, 3.29946957e+00, -4.57127922e-01, 4.96782290e-03, 1.06661603e+00, 9.86247333e-01, 2.34774557e+00]])
q_error_limit
(x, y)
float64
-2.502 0.3523 ... -0.586 0.7297
array([[-2.50224206, 0.35232373, -0.97352721, -0.86872347, 1.41245853, -0.2849635 , 0.15205042, -0.60635598, 0.38912931, 0.85879076, -0.49486064, -1.42130134, -1.0834387 , 1.46582438, 0.39175791, -1.21868543, 1.35401689, -0.91967987, 0.35449301, 1.72198533], [ 0.7082123 , -1.19995763, -0.42551317, 0.86355397, -0.38098025, -0.71256655, -1.02145442, 0.80606519, -0.11932373, 2.52985168, 0.26718911, 0.31354614, -0.13277143, 0.6851192 , -0.75186696, 0.36166639, -1.33353915, 1.17991824, -0.10342666, 0.77766448], [ 0.41260585, -0.74074657, 1.52468513, 0.42363175, 0.76146027, -0.86504051, -0.63669881, -0.40064762, -0.25372764, 0.78128715, -0.2045039 , -0.24063064, 0.51458565, -0.01097885, -0.1319296 , -1.04620866, 0.33646233, -0.29087218, -1.67885723, -2.14670112], [-0.05636732, -1.1507952 , 1.87035051, -1.80361095, 0.18098883, -2.47388752, 0.9590963 , -0.3490936 , -0.04653165, 0.64460372, -1.63569454, 1.01312537, 0.2234348 , 1.19013653, 0.04014389, -0.38943932, -1.03364867, 0.73624117, -0.7065577 , 2.26281196], [ 0.03642304, -0.66634789, -0.51809345, 0.57653173, -0.86724322, -0.79850433, -0.18888399, -0.34152547, 0.18167322, 0.1979436 , -0.61855368, 0.83561808, -0.37143018, 1.65650844, 1.45678227, -0.39486908, 0.48725947, -1.26839983, -0.93259679, 0.03757077], [-0.6193842 , -0.66888456, -0.69213649, -0.42447704, 0.0701928 , 0.27568415, 0.91675731, 0.04826052, 0.30204279, 0.0216165 , 0.38513832, -0.85633964, 1.96294331, 0.60232717, 0.39816094, -0.1177825 , -2.58567944, 0.45381439, -1.13162907, 0.42124046], [-1.07992374, 0.01007522, -1.17068933, -1.4760275 , -2.34894053, -0.06047959, 0.29957322, 2.22709775, 1.69595459, 1.18475842, -0.17892275, -2.07629717, -0.2775207 , 0.0725117 , 1.13484635, -0.56740809, -0.29908087, 0.16804319, -0.20952395, 1.12319732], [ 1.26585658, -0.89973344, 0.15984539, 0.30198885, -0.3840629 , -0.53307776, 0.03374999, -0.86896936, -0.91365232, 0.90652926, -1.27320952, 1.11409591, -0.72744653, 1.33200532, -0.24701978, 0.19925302, 0.49881116, 0.83653879, 0.25883027, 1.75751872], [ 0.28531322, -0.25822711, 0.12951506, 0.54706233, -0.90342031, 0.4637241 , 0.35202341, 0.55351709, -1.08409603, -1.39078548, -1.15771499, 0.78874481, -0.88970337, 0.18483368, -0.34375032, -0.25731003, 0.62245538, -0.05252685, 1.27763311, 0.22170535], [-0.91553222, -1.40706823, 0.21830881, -0.17507419, -1.20424656, 1.24990247, -0.41648654, -1.0698897 , -0.03205941, 0.14471593, -1.2536303 , 0.46791459, -1.41565101, 0.3107811 , 0.04476836, 1.10272488, -1.2084635 , 0.25687411, -0.58598058, 0.72972389]])
q_detection_limit
()
float64
0.001
The criteria for identifying variables using CF attributes are listed here.
<xarray.DataArray 'lon' (lon: 53)> Size: 212B 200.0 202.5 205.0 207.5 210.0 212.5 ... 317.5 320.0 322.5 325.0 327.5 330.0 Coordinates: * lon (lon) float32 212B 200.0 202.5 205.0 207.5 ... 325.0 327.5 330.0 Attributes: standard_name: longitude long_name: Longitude units: degrees_east axis: X
200.0 202.5 205.0 207.5 210.0 212.5 ... 320.0 322.5 325.0 327.5 330.0
array([200. , 202.5, 205. , 207.5, 210. , 212.5, 215. , 217.5, 220. , 222.5, 225. , 227.5, 230. , 232.5, 235. , 237.5, 240. , 242.5, 245. , 247.5, 250. , 252.5, 255. , 257.5, 260. , 262.5, 265. , 267.5, 270. , 272.5, 275. , 277.5, 280. , 282.5, 285. , 287.5, 290. , 292.5, 295. , 297.5, 300. , 302.5, 305. , 307.5, 310. , 312.5, 315. , 317.5, 320. , 322.5, 325. , 327.5, 330. ], dtype=float32)
lon
(lon)
float32
200.0 202.5 205.0 ... 327.5 330.0
array([200. , 202.5, 205. , 207.5, 210. , 212.5, 215. , 217.5, 220. , 222.5, 225. , 227.5, 230. , 232.5, 235. , 237.5, 240. , 242.5, 245. , 247.5, 250. , 252.5, 255. , 257.5, 260. , 262.5, 265. , 267.5, 270. , 272.5, 275. , 277.5, 280. , 282.5, 285. , 287.5, 290. , 292.5, 295. , 297.5, 300. , 302.5, 305. , 307.5, 310. , 312.5, 315. , 317.5, 320. , 322.5, 325. , 327.5, 330. ], dtype=float32)
PandasIndex
PandasIndex(Index([200.0, 202.5, 205.0, 207.5, 210.0, 212.5, 215.0, 217.5, 220.0, 222.5, 225.0, 227.5, 230.0, 232.5, 235.0, 237.5, 240.0, 242.5, 245.0, 247.5, 250.0, 252.5, 255.0, 257.5, 260.0, 262.5, 265.0, 267.5, 270.0, 272.5, 275.0, 277.5, 280.0, 282.5, 285.0, 287.5, 290.0, 292.5, 295.0, 297.5, 300.0, 302.5, 305.0, 307.5, 310.0, 312.5, 315.0, 317.5, 320.0, 322.5, 325.0, 327.5, 330.0], dtype='float32', name='lon'))
ds.lon
has attributes axis: X
. This means that cf_xarray
can identify the 'X'
axis as being represented by the lon
variable.
It can also use the standard_name
and units
attributes to infer that lon
is “Longitude”. To see variable names that cf_xarray
can infer, use ds.cf
Coordinates: CF Axes: * X: ['lon'] * Y: ['lat'] * T: ['time'] Z: n/a CF Coordinates: * longitude: ['lon'] * latitude: ['lat'] * time: ['time'] vertical: n/a Cell Measures: area, volume: n/a Standard Names: * latitude: ['lat'] * longitude: ['lon'] * time: ['time'] Bounds: n/a Grid Mappings: n/a Data Variables: Cell Measures: area, volume: n/a Standard Names: air_temperature: ['air'] Bounds: n/a Grid Mappings: n/a
For pop
, only latitude
and longitude
are detected, not X
or Y
. Please comment here: https://github.com/xarray-contrib/cf-xarray/issues/23 if you have opinions about this behaviour.
Coordinates: CF Axes: * X: ['nlon'] * Y: ['nlat'] Z, T: n/a CF Coordinates: longitude: ['TLONG', 'ULONG'] latitude: ['TLAT', 'ULAT'] vertical, time: n/a Cell Measures: area, volume: n/a Standard Names: n/a Bounds: n/a Grid Mappings: n/a Data Variables: Cell Measures: area, volume: n/a Standard Names: sea_water_potential_temperature: ['TEMP'] sea_water_x_velocity: ['UVEL'] Bounds: n/a Grid Mappings: n/a
For multiple
, multiple X
and Y
coordinates are detected
Coordinates: CF Axes: * X: ['x1', 'x2'] * Y: ['y1', 'y2'] Z, T: n/a CF Coordinates: longitude, latitude, vertical, time: n/a Cell Measures: area, volume: n/a Standard Names: n/a Bounds: n/a Grid Mappings: n/a Data Variables: Cell Measures: area, volume: n/a Standard Names: n/a Bounds: n/a Grid Mappings: n/aFeature: Accessing coordinate variables¶
.cf
implements __getitem__
to allow easy access to coordinate and axis variables.
<xarray.DataArray 'lon' (lon: 53)> Size: 212B 200.0 202.5 205.0 207.5 210.0 212.5 ... 317.5 320.0 322.5 325.0 327.5 330.0 Coordinates: * lon (lon) float32 212B 200.0 202.5 205.0 207.5 ... 325.0 327.5 330.0 Attributes: standard_name: longitude long_name: Longitude units: degrees_east axis: X
200.0 202.5 205.0 207.5 210.0 212.5 ... 320.0 322.5 325.0 327.5 330.0
array([200. , 202.5, 205. , 207.5, 210. , 212.5, 215. , 217.5, 220. , 222.5, 225. , 227.5, 230. , 232.5, 235. , 237.5, 240. , 242.5, 245. , 247.5, 250. , 252.5, 255. , 257.5, 260. , 262.5, 265. , 267.5, 270. , 272.5, 275. , 277.5, 280. , 282.5, 285. , 287.5, 290. , 292.5, 295. , 297.5, 300. , 302.5, 305. , 307.5, 310. , 312.5, 315. , 317.5, 320. , 322.5, 325. , 327.5, 330. ], dtype=float32)
lon
(lon)
float32
200.0 202.5 205.0 ... 327.5 330.0
array([200. , 202.5, 205. , 207.5, 210. , 212.5, 215. , 217.5, 220. , 222.5, 225. , 227.5, 230. , 232.5, 235. , 237.5, 240. , 242.5, 245. , 247.5, 250. , 252.5, 255. , 257.5, 260. , 262.5, 265. , 267.5, 270. , 272.5, 275. , 277.5, 280. , 282.5, 285. , 287.5, 290. , 292.5, 295. , 297.5, 300. , 302.5, 305. , 307.5, 310. , 312.5, 315. , 317.5, 320. , 322.5, 325. , 327.5, 330. ], dtype=float32)
PandasIndex
PandasIndex(Index([200.0, 202.5, 205.0, 207.5, 210.0, 212.5, 215.0, 217.5, 220.0, 222.5, 225.0, 227.5, 230.0, 232.5, 235.0, 237.5, 240.0, 242.5, 245.0, 247.5, 250.0, 252.5, 255.0, 257.5, 260.0, 262.5, 265.0, 267.5, 270.0, 272.5, 275.0, 277.5, 280.0, 282.5, 285.0, 287.5, 290.0, 292.5, 295.0, 297.5, 300.0, 302.5, 305.0, 307.5, 310.0, 312.5, 315.0, 317.5, 320.0, 322.5, 325.0, 327.5, 330.0], dtype='float32', name='lon'))
Indexing with a scalar key raises an error if the key maps to multiple variables names
--------------------------------------------------------------------------- KeyError Traceback (most recent call last) Cell In[12], line 1 ----> 1 multiple.cf["X"] File ~/checkouts/readthedocs.org/user_builds/cf-xarray/checkouts/latest/cf_xarray/accessor.py:2375, in CFDatasetAccessor.__getitem__(self, key) 2343 def __getitem__(self, key: Hashable | Iterable[Hashable]) -> DataArray | Dataset: 2344 """ 2345 Index into a Dataset making use of CF attributes. 2346 (...) 2373 Add additional keys by specifying "custom criteria". See :ref:`custom_criteria` for more. 2374 """ -> 2375 return _getitem(self, key) File ~/checkouts/readthedocs.org/user_builds/cf-xarray/checkouts/latest/cf_xarray/accessor.py:856, in _getitem(accessor, key, skip) 854 names = _get_all(obj, k) 855 names = drop_bounds(names) --> 856 check_results(names, k) 857 successful[k] = bool(names) 858 coords.extend(names) File ~/checkouts/readthedocs.org/user_builds/cf-xarray/checkouts/latest/cf_xarray/accessor.py:826, in _getitem.<locals>.check_results(names, key) 824 def check_results(names, key): 825 if scalar_key and len(names) > 1: --> 826 raise KeyError( 827 f"Receive multiple variables for key {key!r}: {names}. " 828 f"Expected only one. Please pass a list [{key!r}] " 829 f"instead to get all variables matching {key!r}." 830 ) KeyError: "Receive multiple variables for key 'X': {'x1', 'x2'}. Expected only one. Please pass a list ['X'] instead to get all variables matching 'X'."
--------------------------------------------------------------------------- KeyError Traceback (most recent call last) Cell In[13], line 1 ----> 1 pop.cf["longitude"] File ~/checkouts/readthedocs.org/user_builds/cf-xarray/checkouts/latest/cf_xarray/accessor.py:2375, in CFDatasetAccessor.__getitem__(self, key) 2343 def __getitem__(self, key: Hashable | Iterable[Hashable]) -> DataArray | Dataset: 2344 """ 2345 Index into a Dataset making use of CF attributes. 2346 (...) 2373 Add additional keys by specifying "custom criteria". See :ref:`custom_criteria` for more. 2374 """ -> 2375 return _getitem(self, key) File ~/checkouts/readthedocs.org/user_builds/cf-xarray/checkouts/latest/cf_xarray/accessor.py:856, in _getitem(accessor, key, skip) 854 names = _get_all(obj, k) 855 names = drop_bounds(names) --> 856 check_results(names, k) 857 successful[k] = bool(names) 858 coords.extend(names) File ~/checkouts/readthedocs.org/user_builds/cf-xarray/checkouts/latest/cf_xarray/accessor.py:826, in _getitem.<locals>.check_results(names, key) 824 def check_results(names, key): 825 if scalar_key and len(names) > 1: --> 826 raise KeyError( 827 f"Receive multiple variables for key {key!r}: {names}. " 828 f"Expected only one. Please pass a list [{key!r}] " 829 f"instead to get all variables matching {key!r}." 830 ) KeyError: "Receive multiple variables for key 'longitude': {'TLONG', 'ULONG'}. Expected only one. Please pass a list ['longitude'] instead to get all variables matching 'longitude'."
To get back all variables associated with that key, pass a single element list instead.
<xarray.Dataset> Size: 320B Dimensions: (x1: 30, x2: 10) Coordinates: * x1 (x1) int64 240B 0 1 2 3 4 5 6 7 8 9 ... 21 22 23 24 25 26 27 28 29 * x2 (x2) int64 80B 0 1 2 3 4 5 6 7 8 9 Data variables: *empty*
x1
(x1)
int64
0 1 2 3 4 5 6 ... 24 25 26 27 28 29
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29])
x2
(x2)
int64
0 1 2 3 4 5 6 7 8 9
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
PandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], dtype='int64', name='x1'))
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype='int64', name='x2'))
<xarray.Dataset> Size: 10kB Dimensions: (nlat: 20, nlon: 30) Coordinates: TLONG (nlat, nlon) float64 5kB 1.0 1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0 ULONG (nlat, nlon) float64 5kB 0.5 0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5 * nlon (nlon) int64 240B 0 1 2 3 4 5 6 7 8 ... 21 22 23 24 25 26 27 28 29 * nlat (nlat) int64 160B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Data variables: *empty*
TLONG
(nlat, nlon)
float64
1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
array([[1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]])
ULONG
(nlat, nlon)
float64
0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5
array([[0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, ... 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]])
nlon
(nlon)
int64
0 1 2 3 4 5 6 ... 24 25 26 27 28 29
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29])
nlat
(nlat)
int64
0 1 2 3 4 5 6 ... 14 15 16 17 18 19
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
PandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], dtype='int64', name='nlon'))
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], dtype='int64', name='nlat'))
DataArrays return DataArrays
<xarray.DataArray 'ULONG' (nlat: 20, nlon: 30)> Size: 5kB 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 Coordinates: * nlon (nlon) int64 240B 0 1 2 3 4 5 6 7 8 ... 21 22 23 24 25 26 27 28 29 * nlat (nlat) int64 160B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Attributes: units: degrees_east
0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
array([[0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, ... 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]])
nlon
(nlon)
int64
0 1 2 3 4 5 6 ... 24 25 26 27 28 29
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29])
nlat
(nlat)
int64
0 1 2 3 4 5 6 ... 14 15 16 17 18 19
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
PandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], dtype='int64', name='nlon'))
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], dtype='int64', name='nlat'))
Dataset.cf[...]
returns a single DataArray
, parsing the coordinates
attribute if present, so we correctly get the TLONG
variable and not the ULONG
variable
<xarray.DataArray 'TEMP' (nlat: 20, nlon: 30)> Size: 5kB 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0 15.0 15.0 15.0 15.0 Coordinates: * nlon (nlon) int64 240B 0 1 2 3 4 5 6 7 8 ... 21 22 23 24 25 26 27 28 29 * nlat (nlat) int64 160B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 TLONG (nlat, nlon) float64 5kB 1.0 1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0 TLAT (nlat, nlon) float64 5kB 2.0 2.0 2.0 2.0 2.0 ... 2.0 2.0 2.0 2.0 Attributes: coordinates: TLONG TLAT standard_name: sea_water_potential_temperature
15.0 15.0 15.0 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0 15.0 15.0 15.0
array([[15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., ... 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.]])
nlon
(nlon)
int64
0 1 2 3 4 5 6 ... 24 25 26 27 28 29
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29])
nlat
(nlat)
int64
0 1 2 3 4 5 6 ... 14 15 16 17 18 19
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
TLONG
(nlat, nlon)
float64
1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
array([[1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]])
TLAT
(nlat, nlon)
float64
2.0 2.0 2.0 2.0 ... 2.0 2.0 2.0 2.0
array([[2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.]])
PandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], dtype='int64', name='nlon'))
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], dtype='int64', name='nlat'))
Dataset.cf[...]
also interprets the ancillary_variables
attribute. The ancillary variables are returned as coordinates of a DataArray
<xarray.DataArray 'q' (x: 10, y: 20)> Size: 2kB 0.7175 -0.686 0.6431 0.4978 -0.8719 ... -0.4571 0.004968 1.067 0.9862 2.348 Coordinates: q_error_limit (x, y) float64 2kB -2.502 0.3523 ... -0.586 0.7297 q_detection_limit float64 8B 0.001 Dimensions without coordinates: x, y Attributes: standard_name: specific_humidity units: g/g ancillary_variables: q_error_limit q_detection_limit
0.7175 -0.686 0.6431 0.4978 -0.8719 ... 0.004968 1.067 0.9862 2.348
array([[ 7.17530423e-01, -6.86025948e-01, 6.43093109e-01, 4.97776730e-01, -8.71888164e-01, 3.53710232e-01, -3.25339346e-01, 1.27343102e+00, -5.89768326e-01, -6.29210849e-02, 3.77091422e-01, -1.00970136e+00, 9.53824269e-01, -1.29146284e+00, -1.64808667e+00, 2.59596830e+00, -6.10732604e-01, 2.05742513e+00, 1.18476549e+00, -1.53874515e-01], [-8.06884830e-01, 1.73937872e+00, -6.80595237e-01, 9.19918583e-01, -5.99323517e-02, -2.96883179e-01, 3.52616678e-01, 6.86444747e-01, 7.92382718e-01, -1.58338024e+00, -8.47025507e-01, -4.54856449e-01, -2.84725005e-01, -1.07362362e+00, 1.28238756e-01, 1.70931061e-01, 3.93062104e-02, 2.52285222e-04, 2.68503459e-01, -2.79392530e-01], [-2.38106606e+00, 7.31034518e-01, 7.84144935e-02, 2.38171621e-01, 1.31616108e+00, -3.28405909e-01, -5.47528349e-01, 1.73920635e-01, 5.00220507e-01, 2.61692785e-01, 7.82718888e-01, 1.25744425e+00, -1.04832796e+00, -4.22098924e-01, 6.38943295e-01, -6.14789030e-01, 3.29312941e+00, 5.81304251e-01, ... -1.12639381e+00, -6.13134716e-01, -2.98490402e-01, 1.01151776e+00, -3.27468450e-01, -1.16720368e+00, 7.36414260e-01, 8.78583414e-01, -1.76489632e+00, 7.61012549e-01, 1.16024243e-01, -1.75528005e-01, 6.04042858e-01, 1.41174847e+00, -9.80282792e-01, 1.09585231e+00, 3.84653187e-01], [-1.56715124e+00, 5.78161358e-01, -2.30967545e+00, -4.32031184e-01, 1.19386083e+00, -4.85161479e-01, 4.72224605e-01, 1.32886198e-01, 7.67331551e-01, 6.50302938e-01, 7.10153173e-01, -7.87072410e-02, -1.90072932e+00, -7.03897279e-02, 1.23635748e-01, 1.36828406e+00, 3.11072696e-01, -3.68720061e-01, 2.09899820e+00, 1.39887493e-01], [ 7.38272057e-01, 1.29559995e+00, 2.36447391e+00, 1.73784500e-01, 5.32155248e-03, -4.46820988e-01, 1.74798584e+00, -9.83448319e-01, -1.82832453e+00, -3.18872886e-01, 8.99457529e-01, -4.94075078e-01, -2.91822398e-01, -5.73741070e-01, 3.29946957e+00, -4.57127922e-01, 4.96782290e-03, 1.06661603e+00, 9.86247333e-01, 2.34774557e+00]])
q_error_limit
(x, y)
float64
-2.502 0.3523 ... -0.586 0.7297
array([[-2.50224206, 0.35232373, -0.97352721, -0.86872347, 1.41245853, -0.2849635 , 0.15205042, -0.60635598, 0.38912931, 0.85879076, -0.49486064, -1.42130134, -1.0834387 , 1.46582438, 0.39175791, -1.21868543, 1.35401689, -0.91967987, 0.35449301, 1.72198533], [ 0.7082123 , -1.19995763, -0.42551317, 0.86355397, -0.38098025, -0.71256655, -1.02145442, 0.80606519, -0.11932373, 2.52985168, 0.26718911, 0.31354614, -0.13277143, 0.6851192 , -0.75186696, 0.36166639, -1.33353915, 1.17991824, -0.10342666, 0.77766448], [ 0.41260585, -0.74074657, 1.52468513, 0.42363175, 0.76146027, -0.86504051, -0.63669881, -0.40064762, -0.25372764, 0.78128715, -0.2045039 , -0.24063064, 0.51458565, -0.01097885, -0.1319296 , -1.04620866, 0.33646233, -0.29087218, -1.67885723, -2.14670112], [-0.05636732, -1.1507952 , 1.87035051, -1.80361095, 0.18098883, -2.47388752, 0.9590963 , -0.3490936 , -0.04653165, 0.64460372, -1.63569454, 1.01312537, 0.2234348 , 1.19013653, 0.04014389, -0.38943932, -1.03364867, 0.73624117, -0.7065577 , 2.26281196], [ 0.03642304, -0.66634789, -0.51809345, 0.57653173, -0.86724322, -0.79850433, -0.18888399, -0.34152547, 0.18167322, 0.1979436 , -0.61855368, 0.83561808, -0.37143018, 1.65650844, 1.45678227, -0.39486908, 0.48725947, -1.26839983, -0.93259679, 0.03757077], [-0.6193842 , -0.66888456, -0.69213649, -0.42447704, 0.0701928 , 0.27568415, 0.91675731, 0.04826052, 0.30204279, 0.0216165 , 0.38513832, -0.85633964, 1.96294331, 0.60232717, 0.39816094, -0.1177825 , -2.58567944, 0.45381439, -1.13162907, 0.42124046], [-1.07992374, 0.01007522, -1.17068933, -1.4760275 , -2.34894053, -0.06047959, 0.29957322, 2.22709775, 1.69595459, 1.18475842, -0.17892275, -2.07629717, -0.2775207 , 0.0725117 , 1.13484635, -0.56740809, -0.29908087, 0.16804319, -0.20952395, 1.12319732], [ 1.26585658, -0.89973344, 0.15984539, 0.30198885, -0.3840629 , -0.53307776, 0.03374999, -0.86896936, -0.91365232, 0.90652926, -1.27320952, 1.11409591, -0.72744653, 1.33200532, -0.24701978, 0.19925302, 0.49881116, 0.83653879, 0.25883027, 1.75751872], [ 0.28531322, -0.25822711, 0.12951506, 0.54706233, -0.90342031, 0.4637241 , 0.35202341, 0.55351709, -1.08409603, -1.39078548, -1.15771499, 0.78874481, -0.88970337, 0.18483368, -0.34375032, -0.25731003, 0.62245538, -0.05252685, 1.27763311, 0.22170535], [-0.91553222, -1.40706823, 0.21830881, -0.17507419, -1.20424656, 1.24990247, -0.41648654, -1.0698897 , -0.03205941, 0.14471593, -1.2536303 , 0.46791459, -1.41565101, 0.3107811 , 0.04476836, 1.10272488, -1.2084635 , 0.25687411, -0.58598058, 0.72972389]])
q_detection_limit
()
float64
0.001
pop.cf[["sea_water_potential_temperature", "UVEL"]]
<xarray.Dataset> Size: 29kB Dimensions: (nlat: 20, nlon: 30) Coordinates: TLONG (nlat, nlon) float64 5kB 1.0 1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0 TLAT (nlat, nlon) float64 5kB 2.0 2.0 2.0 2.0 2.0 ... 2.0 2.0 2.0 2.0 ULONG (nlat, nlon) float64 5kB 0.5 0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5 ULAT (nlat, nlon) float64 5kB 2.5 2.5 2.5 2.5 2.5 ... 2.5 2.5 2.5 2.5 * nlon (nlon) int64 240B 0 1 2 3 4 5 6 7 8 ... 21 22 23 24 25 26 27 28 29 * nlat (nlat) int64 160B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Data variables: TEMP (nlat, nlon) float64 5kB 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0 UVEL (nlat, nlon) float64 5kB 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0
TLONG
(nlat, nlon)
float64
1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
array([[1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]])
TLAT
(nlat, nlon)
float64
2.0 2.0 2.0 2.0 ... 2.0 2.0 2.0 2.0
array([[2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.]])
ULONG
(nlat, nlon)
float64
0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5
array([[0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, ... 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]])
ULAT
(nlat, nlon)
float64
2.5 2.5 2.5 2.5 ... 2.5 2.5 2.5 2.5
array([[2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, ... 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5], [2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5]])
nlon
(nlon)
int64
0 1 2 3 4 5 6 ... 24 25 26 27 28 29
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29])
nlat
(nlat)
int64
0 1 2 3 4 5 6 ... 14 15 16 17 18 19
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
TEMP
(nlat, nlon)
float64
15.0 15.0 15.0 ... 15.0 15.0 15.0
array([[15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., ... 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.]])
UVEL
(nlat, nlon)
float64
15.0 15.0 15.0 ... 15.0 15.0 15.0
array([[15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., ... 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.]])
PandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], dtype='int64', name='nlon'))
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], dtype='int64', name='nlat'))
Note that ancillary variables are included as coordinate variables
anc.cf["specific_humidity"]
<xarray.DataArray 'q' (x: 10, y: 20)> Size: 2kB 0.7175 -0.686 0.6431 0.4978 -0.8719 ... -0.4571 0.004968 1.067 0.9862 2.348 Coordinates: q_error_limit (x, y) float64 2kB -2.502 0.3523 ... -0.586 0.7297 q_detection_limit float64 8B 0.001 Dimensions without coordinates: x, y Attributes: standard_name: specific_humidity units: g/g ancillary_variables: q_error_limit q_detection_limit
0.7175 -0.686 0.6431 0.4978 -0.8719 ... 0.004968 1.067 0.9862 2.348
array([[ 7.17530423e-01, -6.86025948e-01, 6.43093109e-01, 4.97776730e-01, -8.71888164e-01, 3.53710232e-01, -3.25339346e-01, 1.27343102e+00, -5.89768326e-01, -6.29210849e-02, 3.77091422e-01, -1.00970136e+00, 9.53824269e-01, -1.29146284e+00, -1.64808667e+00, 2.59596830e+00, -6.10732604e-01, 2.05742513e+00, 1.18476549e+00, -1.53874515e-01], [-8.06884830e-01, 1.73937872e+00, -6.80595237e-01, 9.19918583e-01, -5.99323517e-02, -2.96883179e-01, 3.52616678e-01, 6.86444747e-01, 7.92382718e-01, -1.58338024e+00, -8.47025507e-01, -4.54856449e-01, -2.84725005e-01, -1.07362362e+00, 1.28238756e-01, 1.70931061e-01, 3.93062104e-02, 2.52285222e-04, 2.68503459e-01, -2.79392530e-01], [-2.38106606e+00, 7.31034518e-01, 7.84144935e-02, 2.38171621e-01, 1.31616108e+00, -3.28405909e-01, -5.47528349e-01, 1.73920635e-01, 5.00220507e-01, 2.61692785e-01, 7.82718888e-01, 1.25744425e+00, -1.04832796e+00, -4.22098924e-01, 6.38943295e-01, -6.14789030e-01, 3.29312941e+00, 5.81304251e-01, ... -1.12639381e+00, -6.13134716e-01, -2.98490402e-01, 1.01151776e+00, -3.27468450e-01, -1.16720368e+00, 7.36414260e-01, 8.78583414e-01, -1.76489632e+00, 7.61012549e-01, 1.16024243e-01, -1.75528005e-01, 6.04042858e-01, 1.41174847e+00, -9.80282792e-01, 1.09585231e+00, 3.84653187e-01], [-1.56715124e+00, 5.78161358e-01, -2.30967545e+00, -4.32031184e-01, 1.19386083e+00, -4.85161479e-01, 4.72224605e-01, 1.32886198e-01, 7.67331551e-01, 6.50302938e-01, 7.10153173e-01, -7.87072410e-02, -1.90072932e+00, -7.03897279e-02, 1.23635748e-01, 1.36828406e+00, 3.11072696e-01, -3.68720061e-01, 2.09899820e+00, 1.39887493e-01], [ 7.38272057e-01, 1.29559995e+00, 2.36447391e+00, 1.73784500e-01, 5.32155248e-03, -4.46820988e-01, 1.74798584e+00, -9.83448319e-01, -1.82832453e+00, -3.18872886e-01, 8.99457529e-01, -4.94075078e-01, -2.91822398e-01, -5.73741070e-01, 3.29946957e+00, -4.57127922e-01, 4.96782290e-03, 1.06661603e+00, 9.86247333e-01, 2.34774557e+00]])
q_error_limit
(x, y)
float64
-2.502 0.3523 ... -0.586 0.7297
array([[-2.50224206, 0.35232373, -0.97352721, -0.86872347, 1.41245853, -0.2849635 , 0.15205042, -0.60635598, 0.38912931, 0.85879076, -0.49486064, -1.42130134, -1.0834387 , 1.46582438, 0.39175791, -1.21868543, 1.35401689, -0.91967987, 0.35449301, 1.72198533], [ 0.7082123 , -1.19995763, -0.42551317, 0.86355397, -0.38098025, -0.71256655, -1.02145442, 0.80606519, -0.11932373, 2.52985168, 0.26718911, 0.31354614, -0.13277143, 0.6851192 , -0.75186696, 0.36166639, -1.33353915, 1.17991824, -0.10342666, 0.77766448], [ 0.41260585, -0.74074657, 1.52468513, 0.42363175, 0.76146027, -0.86504051, -0.63669881, -0.40064762, -0.25372764, 0.78128715, -0.2045039 , -0.24063064, 0.51458565, -0.01097885, -0.1319296 , -1.04620866, 0.33646233, -0.29087218, -1.67885723, -2.14670112], [-0.05636732, -1.1507952 , 1.87035051, -1.80361095, 0.18098883, -2.47388752, 0.9590963 , -0.3490936 , -0.04653165, 0.64460372, -1.63569454, 1.01312537, 0.2234348 , 1.19013653, 0.04014389, -0.38943932, -1.03364867, 0.73624117, -0.7065577 , 2.26281196], [ 0.03642304, -0.66634789, -0.51809345, 0.57653173, -0.86724322, -0.79850433, -0.18888399, -0.34152547, 0.18167322, 0.1979436 , -0.61855368, 0.83561808, -0.37143018, 1.65650844, 1.45678227, -0.39486908, 0.48725947, -1.26839983, -0.93259679, 0.03757077], [-0.6193842 , -0.66888456, -0.69213649, -0.42447704, 0.0701928 , 0.27568415, 0.91675731, 0.04826052, 0.30204279, 0.0216165 , 0.38513832, -0.85633964, 1.96294331, 0.60232717, 0.39816094, -0.1177825 , -2.58567944, 0.45381439, -1.13162907, 0.42124046], [-1.07992374, 0.01007522, -1.17068933, -1.4760275 , -2.34894053, -0.06047959, 0.29957322, 2.22709775, 1.69595459, 1.18475842, -0.17892275, -2.07629717, -0.2775207 , 0.0725117 , 1.13484635, -0.56740809, -0.29908087, 0.16804319, -0.20952395, 1.12319732], [ 1.26585658, -0.89973344, 0.15984539, 0.30198885, -0.3840629 , -0.53307776, 0.03374999, -0.86896936, -0.91365232, 0.90652926, -1.27320952, 1.11409591, -0.72744653, 1.33200532, -0.24701978, 0.19925302, 0.49881116, 0.83653879, 0.25883027, 1.75751872], [ 0.28531322, -0.25822711, 0.12951506, 0.54706233, -0.90342031, 0.4637241 , 0.35202341, 0.55351709, -1.08409603, -1.39078548, -1.15771499, 0.78874481, -0.88970337, 0.18483368, -0.34375032, -0.25731003, 0.62245538, -0.05252685, 1.27763311, 0.22170535], [-0.91553222, -1.40706823, 0.21830881, -0.17507419, -1.20424656, 1.24990247, -0.41648654, -1.0698897 , -0.03205941, 0.14471593, -1.2536303 , 0.46791459, -1.41565101, 0.3107811 , 0.04476836, 1.10272488, -1.2084635 , 0.25687411, -0.58598058, 0.72972389]])
q_detection_limit
()
float64
0.001
There are some utility functions to allow use by downstream libraries
{'X', 'Y', 'latitude', 'longitude', 'sea_water_potential_temperature', 'sea_water_x_velocity'}
You can test for presence of these keys
"sea_water_x_velocity" in pop.cf
You can also get out the available Axis names
{'X': ['nlon'], 'Y': ['nlat']}
or available Coordinate names. Same for cell measures (.cf.cell_measures
) and standard names (.cf.standard_names
).
{'longitude': ['TLONG', 'ULONG'], 'latitude': ['TLAT', 'ULAT']}
Note: Although it is possible to assign additional coordinates, .cf.coordinates
only returns a subset of ("longitude", "latitude", "vertical", "time")
.
cf_xarray
will rewrite the .sizes
and .chunks
dictionaries so that one can index by a special CF axis or coordinate name
{'time': 2920, 'T': 2920, 'latitude': 25, 'Y': 25, 'X': 53, 'longitude': 53}
Note the duplicate entries above:
One for X
, Y
, T
and one for longitude
, latitude
and time
.
An error is raised if there are multiple 'X'
variables (for example)
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[26], line 1 ----> 1 multiple.cf.sizes File ~/checkouts/readthedocs.org/user_builds/cf-xarray/checkouts/latest/cf_xarray/accessor.py:1576, in CFAccessor.__getattr__(self, attr) 1575 def __getattr__(self, attr): -> 1576 return _getattr( 1577 obj=self._obj, 1578 attr=attr, 1579 accessor=self, 1580 key_mappers=_DEFAULT_KEY_MAPPERS, 1581 wrap_classes=True, 1582 ) File ~/checkouts/readthedocs.org/user_builds/cf-xarray/checkouts/latest/cf_xarray/accessor.py:722, in _getattr(obj, attr, accessor, key_mappers, wrap_classes, extra_decorator) 720 for name in inverted[key]: 721 if name in newmap: --> 722 raise AttributeError( 723 f"cf_xarray can't wrap attribute {attr!r} because there are multiple values for {name!r}. " 724 f"There is no unique mapping from {name!r} to a value in {attr!r}." 725 ) 726 newmap.update(dict.fromkeys(inverted[key], value)) 727 newmap.update({key: attribute[key] for key in unused_keys}) AttributeError: cf_xarray can't wrap attribute 'sizes' because there are multiple values for 'X'. There is no unique mapping from 'X' to a value in 'sizes'.Feature: Renaming variables¶
cf_xarray
lets you rewrite variables in one dataset to like variables in another dataset.
In this example, a one-to-one mapping is not possible and the coordinate variables are not renamed.
da = pop.cf["TEMP"] da.cf.rename_like(ds)
/tmp/ipykernel_3146/2327264871.py:2: UserWarning: Conflicting variables skipped: ['TLAT']: ['lat'] (latitude) ['TLONG']: ['lon'] (longitude) ['nlat']: ['lat'] (Y) ['nlon']: ['lon'] (X) da.cf.rename_like(ds)
<xarray.DataArray 'TEMP' (nlat: 20, nlon: 30)> Size: 5kB 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0 15.0 15.0 15.0 15.0 Coordinates: * nlon (nlon) int64 240B 0 1 2 3 4 5 6 7 8 ... 21 22 23 24 25 26 27 28 29 * nlat (nlat) int64 160B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 TLONG (nlat, nlon) float64 5kB 1.0 1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0 TLAT (nlat, nlon) float64 5kB 2.0 2.0 2.0 2.0 2.0 ... 2.0 2.0 2.0 2.0 Attributes: coordinates: TLONG TLAT standard_name: sea_water_potential_temperature
15.0 15.0 15.0 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0 15.0 15.0 15.0
array([[15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., ... 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.]])
nlon
(nlon)
int64
0 1 2 3 4 5 6 ... 24 25 26 27 28 29
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29])
nlat
(nlat)
int64
0 1 2 3 4 5 6 ... 14 15 16 17 18 19
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
TLONG
(nlat, nlon)
float64
1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
array([[1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]])
TLAT
(nlat, nlon)
float64
2.0 2.0 2.0 2.0 ... 2.0 2.0 2.0 2.0
array([[2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.]])
PandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], dtype='int64', name='nlon'))
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], dtype='int64', name='nlat'))
If we exclude all axes (variables with axis
attribute), a one-to-one mapping is possible. In this example, TLONG
and TLAT
are renamed to lon
and lat
i.e. their counterparts in ds
. Note the the coordinates
attribute is appropriately changed.
da.cf.rename_like(ds, skip="axes")
<xarray.DataArray 'TEMP' (nlat: 20, nlon: 30)> Size: 5kB 15.0 15.0 15.0 15.0 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0 15.0 15.0 15.0 15.0 Coordinates: * nlon (nlon) int64 240B 0 1 2 3 4 5 6 7 8 ... 21 22 23 24 25 26 27 28 29 * nlat (nlat) int64 160B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 lon (nlat, nlon) float64 5kB 1.0 1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0 lat (nlat, nlon) float64 5kB 2.0 2.0 2.0 2.0 2.0 ... 2.0 2.0 2.0 2.0 Attributes: coordinates: lon lat standard_name: sea_water_potential_temperature
15.0 15.0 15.0 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0 15.0 15.0 15.0
array([[15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., ... 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.], [15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.]])
nlon
(nlon)
int64
0 1 2 3 4 5 6 ... 24 25 26 27 28 29
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29])
nlat
(nlat)
int64
0 1 2 3 4 5 6 ... 14 15 16 17 18 19
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
lon
(nlat, nlon)
float64
1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
array([[1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]])
lat
(nlat, nlon)
float64
2.0 2.0 2.0 2.0 ... 2.0 2.0 2.0 2.0
array([[2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.], [2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.]])
PandasIndex
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], dtype='int64', name='nlon'))
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], dtype='int64', name='nlat'))
cf_xarray
can rewrite arguments for a large number of xarray functions. By this I mean that instead of specifying say dim="lon"
, you can pass dim="X"
or dim="longitude"
and cf_xarray
will rewrite that to dim="lon"
based on the attributes present in the dataset.
Here are a few examples
Slicing¶<xarray.DataArray 'air' (lat: 25, lon: 53)> Size: 11kB 242.1 242.7 243.1 243.4 243.6 243.8 ... 297.5 297.1 296.9 296.4 296.4 296.6 Coordinates: * lat (lat) float32 100B 75.0 72.5 70.0 67.5 65.0 ... 22.5 20.0 17.5 15.0 * lon (lon) float32 212B 200.0 202.5 205.0 207.5 ... 325.0 327.5 330.0 time datetime64[ns] 8B 2013-01-01T06:00:00 Attributes: long_name: 4xDaily Air temperature at sigma level 995 units: degK precision: 2 GRIB_id: 11 GRIB_name: TMP var_desc: Air temperature dataset: NMC Reanalysis level_desc: Surface statistic: Individual Obs parent_stat: Other actual_range: [185.16 322.1 ] standard_name: air_temperature
242.1 242.7 243.1 243.4 243.6 243.8 ... 297.1 296.9 296.4 296.4 296.6
array([[242.1 , 242.7 , 243.1 , ..., 232. , 233.6 , 235.8 ], [243.6 , 244.1 , 244.2 , ..., 231. , 232.5 , 235.7 ], [253.2 , 252.89, 252.1 , ..., 230.8 , 233.39, 238.5 ], ..., [296.4 , 295.9 , 296.2 , ..., 295.4 , 295.1 , 294.79], [296.2 , 296.7 , 296.79, ..., 295.6 , 295.5 , 295.1 ], [296.29, 297.2 , 297.4 , ..., 296.4 , 296.4 , 296.6 ]], shape=(25, 53))
lat
(lat)
float32
75.0 72.5 70.0 ... 20.0 17.5 15.0
array([75. , 72.5, 70. , 67.5, 65. , 62.5, 60. , 57.5, 55. , 52.5, 50. , 47.5, 45. , 42.5, 40. , 37.5, 35. , 32.5, 30. , 27.5, 25. , 22.5, 20. , 17.5, 15. ], dtype=float32)
lon
(lon)
float32
200.0 202.5 205.0 ... 327.5 330.0
array([200. , 202.5, 205. , 207.5, 210. , 212.5, 215. , 217.5, 220. , 222.5, 225. , 227.5, 230. , 232.5, 235. , 237.5, 240. , 242.5, 245. , 247.5, 250. , 252.5, 255. , 257.5, 260. , 262.5, 265. , 267.5, 270. , 272.5, 275. , 277.5, 280. , 282.5, 285. , 287.5, 290. , 292.5, 295. , 297.5, 300. , 302.5, 305. , 307.5, 310. , 312.5, 315. , 317.5, 320. , 322.5, 325. , 327.5, 330. ], dtype=float32)
time
()
datetime64[ns]
2013-01-01T06:00:00
array('2013-01-01T06:00:00.000000000', dtype='datetime64[ns]')
PandasIndex
PandasIndex(Index([75.0, 72.5, 70.0, 67.5, 65.0, 62.5, 60.0, 57.5, 55.0, 52.5, 50.0, 47.5, 45.0, 42.5, 40.0, 37.5, 35.0, 32.5, 30.0, 27.5, 25.0, 22.5, 20.0, 17.5, 15.0], dtype='float32', name='lat'))
PandasIndex
PandasIndex(Index([200.0, 202.5, 205.0, 207.5, 210.0, 212.5, 215.0, 217.5, 220.0, 222.5, 225.0, 227.5, 230.0, 232.5, 235.0, 237.5, 240.0, 242.5, 245.0, 247.5, 250.0, 252.5, 255.0, 257.5, 260.0, 262.5, 265.0, 267.5, 270.0, 272.5, 275.0, 277.5, 280.0, 282.5, 285.0, 287.5, 290.0, 292.5, 295.0, 297.5, 300.0, 302.5, 305.0, 307.5, 310.0, 312.5, 315.0, 317.5, 320.0, 322.5, 325.0, 327.5, 330.0], dtype='float32', name='lon'))
Slicing works will expand a single key like X
to multiple dimensions if those dimensions are tagged with axis: X
multiple.cf.isel(X=1, Y=1)
<xarray.Dataset> Size: 48B Dimensions: () Coordinates: x1 int64 8B 1 y1 int64 8B 1 x2 int64 8B 1 y2 int64 8B 1 Data variables: v1 float64 8B 15.0 v2 float64 8B 15.0
x1
()
int64
1
y1
()
int64
1
x2
()
int64
1
y2
()
int64
1
v1
()
float64
15.0
v2
()
float64
15.0
<xarray.DataArray 'air' (time: 2920, lat: 25)> Size: 584kB 242.0 242.0 243.7 251.2 257.2 260.8 ... 292.3 294.4 295.8 297.0 297.9 298.8 Coordinates: * lat (lat) float32 100B 75.0 72.5 70.0 67.5 65.0 ... 22.5 20.0 17.5 15.0 * time (time) datetime64[ns] 23kB 2013-01-01 ... 2014-12-31T18:00:00 Attributes: long_name: 4xDaily Air temperature at sigma level 995 units: degK precision: 2 GRIB_id: 11 GRIB_name: TMP var_desc: Air temperature dataset: NMC Reanalysis level_desc: Surface statistic: Individual Obs parent_stat: Other actual_range: [185.16 322.1 ] standard_name: air_temperature
242.0 242.0 243.7 251.2 257.2 260.8 ... 294.4 295.8 297.0 297.9 298.8
array([[242.04603774, 241.95867925, 243.72641509, ..., 295.65867925, 296.70924528, 297.91716981], [241.71301887, 241.64018868, 243.40415094, ..., 295.31150943, 296.39226415, 297.61867925], [241.98339623, 241.08849057, 243.24735849, ..., 295.15226415, 296.14716981, 297.31245283], ..., [244.40886792, 243.10132075, 246.49377358, ..., 296.44471698, 297.27113208, 298.25415094], [244.75415094, 243.04849057, 246.21264151, ..., 296.1409434 , 297.15981132, 298.26358491], [245.48622642, 242.95415094, 245.45603774, ..., 296.99188679, 297.94660377, 298.77113208]], shape=(2920, 25))
lat
(lat)
float32
75.0 72.5 70.0 ... 20.0 17.5 15.0
array([75. , 72.5, 70. , 67.5, 65. , 62.5, 60. , 57.5, 55. , 52.5, 50. , 47.5, 45. , 42.5, 40. , 37.5, 35. , 32.5, 30. , 27.5, 25. , 22.5, 20. , 17.5, 15. ], dtype=float32)
time
(time)
datetime64[ns]
2013-01-01 ... 2014-12-31T18:00:00
array(['2013-01-01T00:00:00.000000000', '2013-01-01T06:00:00.000000000', '2013-01-01T12:00:00.000000000', ..., '2014-12-31T06:00:00.000000000', '2014-12-31T12:00:00.000000000', '2014-12-31T18:00:00.000000000'], shape=(2920,), dtype='datetime64[ns]')
PandasIndex
PandasIndex(Index([75.0, 72.5, 70.0, 67.5, 65.0, 62.5, 60.0, 57.5, 55.0, 52.5, 50.0, 47.5, 45.0, 42.5, 40.0, 37.5, 35.0, 32.5, 30.0, 27.5, 25.0, 22.5, 20.0, 17.5, 15.0], dtype='float32', name='lat'))
PandasIndex
PandasIndex(DatetimeIndex(['2013-01-01 00:00:00', '2013-01-01 06:00:00', '2013-01-01 12:00:00', '2013-01-01 18:00:00', '2013-01-02 00:00:00', '2013-01-02 06:00:00', '2013-01-02 12:00:00', '2013-01-02 18:00:00', '2013-01-03 00:00:00', '2013-01-03 06:00:00', ... '2014-12-29 12:00:00', '2014-12-29 18:00:00', '2014-12-30 00:00:00', '2014-12-30 06:00:00', '2014-12-30 12:00:00', '2014-12-30 18:00:00', '2014-12-31 00:00:00', '2014-12-31 06:00:00', '2014-12-31 12:00:00', '2014-12-31 18:00:00'], dtype='datetime64[ns]', name='time', length=2920, freq=None))
Expanding to multiple dimensions is also supported
# takes the mean along ["x1", "x2"] multiple.cf.mean("X")
<xarray.Dataset> Size: 400B Dimensions: (y1: 20, y2: 5) Coordinates: * y1 (y1) int64 160B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 * y2 (y2) int64 40B 0 1 2 3 4 Data variables: v1 (y1) float64 160B 15.0 15.0 15.0 15.0 15.0 ... 15.0 15.0 15.0 15.0 v2 (y2) float64 40B 15.0 15.0 15.0 15.0 15.0
y1
(y1)
int64
0 1 2 3 4 5 6 ... 14 15 16 17 18 19
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
y2
(y2)
int64
0 1 2 3 4
v1
(y1)
float64
15.0 15.0 15.0 ... 15.0 15.0 15.0
array([15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15., 15.])
v2
(y2)
float64
15.0 15.0 15.0 15.0 15.0
array([15., 15., 15., 15., 15.])
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], dtype='int64', name='y1'))
PandasIndex
PandasIndex(Index([0, 1, 2, 3, 4], dtype='int64', name='y2'))
ds.air.cf.isel(time=1).cf.plot(x="X", y="Y")
<matplotlib.collections.QuadMesh at 0x7f37b77ba3c0>
ds.air.cf.isel(T=1, Y=[0, 1, 2]).cf.plot(x="longitude", hue="latitude")
[<matplotlib.lines.Line2D at 0x7f37af55bed0>, <matplotlib.lines.Line2D at 0x7f37af5cc050>, <matplotlib.lines.Line2D at 0x7f37af5cc190>]
cf_xarray
can facet
seasonal = ( ds.air.groupby("time.season").mean().reindex(season=["DJF", "MAM", "JJA", "SON"]) ) seasonal.cf.plot(x="longitude", y="latitude", col="season")
<xarray.plot.facetgrid.FacetGrid at 0x7f37af5e0830>Resample & groupby¶
ds.cf.resample(T="D").mean()
<xarray.Dataset> Size: 8MB Dimensions: (time: 730, lat: 25, lon: 53) Coordinates: * lat (lat) float32 100B 75.0 72.5 70.0 67.5 65.0 ... 22.5 20.0 17.5 15.0 * lon (lon) float32 212B 200.0 202.5 205.0 207.5 ... 325.0 327.5 330.0 * time (time) datetime64[ns] 6kB 2013-01-01 2013-01-02 ... 2014-12-31 Data variables: air (time, lat, lon) float64 8MB 241.9 242.3 242.7 ... 295.9 295.5 Attributes: Conventions: COARDS title: 4x daily NMC reanalysis (1948) description: Data is from NMC initialized reanalysis\n(4x/day). These a... platform: Model references: http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanaly...
lat
(lat)
float32
75.0 72.5 70.0 ... 20.0 17.5 15.0
array([75. , 72.5, 70. , 67.5, 65. , 62.5, 60. , 57.5, 55. , 52.5, 50. , 47.5, 45. , 42.5, 40. , 37.5, 35. , 32.5, 30. , 27.5, 25. , 22.5, 20. , 17.5, 15. ], dtype=float32)
lon
(lon)
float32
200.0 202.5 205.0 ... 327.5 330.0
array([200. , 202.5, 205. , 207.5, 210. , 212.5, 215. , 217.5, 220. , 222.5, 225. , 227.5, 230. , 232.5, 235. , 237.5, 240. , 242.5, 245. , 247.5, 250. , 252.5, 255. , 257.5, 260. , 262.5, 265. , 267.5, 270. , 272.5, 275. , 277.5, 280. , 282.5, 285. , 287.5, 290. , 292.5, 295. , 297.5, 300. , 302.5, 305. , 307.5, 310. , 312.5, 315. , 317.5, 320. , 322.5, 325. , 327.5, 330. ], dtype=float32)
time
(time)
datetime64[ns]
2013-01-01 ... 2014-12-31
array(['2013-01-01T00:00:00.000000000', '2013-01-02T00:00:00.000000000', '2013-01-03T00:00:00.000000000', ..., '2014-12-29T00:00:00.000000000', '2014-12-30T00:00:00.000000000', '2014-12-31T00:00:00.000000000'], shape=(730,), dtype='datetime64[ns]')
air
(time, lat, lon)
float64
241.9 242.3 242.7 ... 295.9 295.5
array([[[241.8725, 242.3 , 242.675 , ..., 233.3725, 235.175 , 237.675 ], [244.575 , 244.5725, 244.275 , ..., 231.2475, 232.825 , 236.3 ], [254. , 253.2225, 251.8225, ..., 231.475 , 233.695 , 238.625 ], ..., [296.3 , 295.975 , 296. , ..., 295.8975, 295.32 , 294.945 ], [296.325 , 296.725 , 296.7425, ..., 296.1725, 296. , 295.5475], [296.62 , 296.995 , 297.1 , ..., 297.0225, 297.0475, 296.9725]], [[243.6 , 243.5 , 243.3 , ..., 238.9725, 240.7975, 243.0725], [247.8225, 247.2 , 246.2225, ..., 235.925 , 236.5975, 238.6 ], [253.5225, 252.0725, 250.2975, ..., 237.6975, 238.8725, 241.9 ], ... [296.365 , 295.415 , 295.165 , ..., 296.89 , 296.345 , 295.345 ], [297.5175, 297.665 , 297.045 , ..., 296.565 , 296.145 , 295.42 ], [298.5675, 298.7425, 298.3425, ..., 296.7925, 296.34 , 295.87 ]], [[244.215 , 243.615 , 242.765 , ..., 243.74 , 244.19 , 244.69 ], [249.315 , 249.09 , 248.59 , ..., 240.565 , 241.515 , 243.115 ], [262.94 , 262.365 , 261.715 , ..., 239.465 , 242.115 , 246.015 ], ..., [294.84 , 295.14 , 296.64 , ..., 295.415 , 295.165 , 294.565 ], [296.54 , 297.59 , 298.09 , ..., 295.565 , 295.465 , 294.79 ], [297.99 , 298.74 , 298.69 , ..., 296.215 , 295.865 , 295.54 ]]], shape=(730, 25, 53))
PandasIndex
PandasIndex(Index([75.0, 72.5, 70.0, 67.5, 65.0, 62.5, 60.0, 57.5, 55.0, 52.5, 50.0, 47.5, 45.0, 42.5, 40.0, 37.5, 35.0, 32.5, 30.0, 27.5, 25.0, 22.5, 20.0, 17.5, 15.0], dtype='float32', name='lat'))
PandasIndex
PandasIndex(Index([200.0, 202.5, 205.0, 207.5, 210.0, 212.5, 215.0, 217.5, 220.0, 222.5, 225.0, 227.5, 230.0, 232.5, 235.0, 237.5, 240.0, 242.5, 245.0, 247.5, 250.0, 252.5, 255.0, 257.5, 260.0, 262.5, 265.0, 267.5, 270.0, 272.5, 275.0, 277.5, 280.0, 282.5, 285.0, 287.5, 290.0, 292.5, 295.0, 297.5, 300.0, 302.5, 305.0, 307.5, 310.0, 312.5, 315.0, 317.5, 320.0, 322.5, 325.0, 327.5, 330.0], dtype='float32', name='lon'))
PandasIndex
PandasIndex(DatetimeIndex(['2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04', '2013-01-05', '2013-01-06', '2013-01-07', '2013-01-08', '2013-01-09', '2013-01-10', ... '2014-12-22', '2014-12-23', '2014-12-24', '2014-12-25', '2014-12-26', '2014-12-27', '2014-12-28', '2014-12-29', '2014-12-30', '2014-12-31'], dtype='datetime64[ns]', name='time', length=730, freq='D'))
cf_xarray
also understands the “datetime accessor” syntax for groupby
ds.cf.groupby("T.month").mean("longitude")
<xarray.Dataset> Size: 607kB Dimensions: (time: 2920, lat: 25) Coordinates: * lat (lat) float32 100B 75.0 72.5 70.0 67.5 65.0 ... 22.5 20.0 17.5 15.0 * time (time) datetime64[ns] 23kB 2013-01-01 ... 2014-12-31T18:00:00 Data variables: air (time, lat) float64 584kB 242.0 242.0 243.7 ... 297.0 297.9 298.8 Attributes: Conventions: COARDS title: 4x daily NMC reanalysis (1948) description: Data is from NMC initialized reanalysis\n(4x/day). These a... platform: Model references: http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanaly...
lat
(lat)
float32
75.0 72.5 70.0 ... 20.0 17.5 15.0
array([75. , 72.5, 70. , 67.5, 65. , 62.5, 60. , 57.5, 55. , 52.5, 50. , 47.5, 45. , 42.5, 40. , 37.5, 35. , 32.5, 30. , 27.5, 25. , 22.5, 20. , 17.5, 15. ], dtype=float32)
time
(time)
datetime64[ns]
2013-01-01 ... 2014-12-31T18:00:00
array(['2013-01-01T00:00:00.000000000', '2013-01-01T06:00:00.000000000', '2013-01-01T12:00:00.000000000', ..., '2014-12-31T06:00:00.000000000', '2014-12-31T12:00:00.000000000', '2014-12-31T18:00:00.000000000'], shape=(2920,), dtype='datetime64[ns]')
air
(time, lat)
float64
242.0 242.0 243.7 ... 297.9 298.8
array([[242.04603774, 241.95867925, 243.72641509, ..., 295.65867925, 296.70924528, 297.91716981], [241.71301887, 241.64018868, 243.40415094, ..., 295.31150943, 296.39226415, 297.61867925], [241.98339623, 241.08849057, 243.24735849, ..., 295.15226415, 296.14716981, 297.31245283], ..., [244.40886792, 243.10132075, 246.49377358, ..., 296.44471698, 297.27113208, 298.25415094], [244.75415094, 243.04849057, 246.21264151, ..., 296.1409434 , 297.15981132, 298.26358491], [245.48622642, 242.95415094, 245.45603774, ..., 296.99188679, 297.94660377, 298.77113208]], shape=(2920, 25))
PandasIndex
PandasIndex(Index([75.0, 72.5, 70.0, 67.5, 65.0, 62.5, 60.0, 57.5, 55.0, 52.5, 50.0, 47.5, 45.0, 42.5, 40.0, 37.5, 35.0, 32.5, 30.0, 27.5, 25.0, 22.5, 20.0, 17.5, 15.0], dtype='float32', name='lat'))
PandasIndex
PandasIndex(DatetimeIndex(['2013-01-01 00:00:00', '2013-01-01 06:00:00', '2013-01-01 12:00:00', '2013-01-01 18:00:00', '2013-01-02 00:00:00', '2013-01-02 06:00:00', '2013-01-02 12:00:00', '2013-01-02 18:00:00', '2013-01-03 00:00:00', '2013-01-03 06:00:00', ... '2014-12-29 12:00:00', '2014-12-29 18:00:00', '2014-12-30 00:00:00', '2014-12-30 06:00:00', '2014-12-30 12:00:00', '2014-12-30 18:00:00', '2014-12-31 00:00:00', '2014-12-31 06:00:00', '2014-12-31 12:00:00', '2014-12-31 18:00:00'], dtype='datetime64[ns]', name='time', length=2920, freq=None))
ds.cf.rolling(X=5).mean()
<xarray.Dataset> Size: 31MB Dimensions: (lat: 25, lon: 53, time: 2920) Coordinates: * lat (lat) float32 100B 75.0 72.5 70.0 67.5 65.0 ... 22.5 20.0 17.5 15.0 * lon (lon) float32 212B 200.0 202.5 205.0 207.5 ... 325.0 327.5 330.0 * time (time) datetime64[ns] 23kB 2013-01-01 ... 2014-12-31T18:00:00 Data variables: air (time, lat, lon) float64 31MB nan nan nan nan ... 297.6 297.0 296.6 Attributes: Conventions: COARDS title: 4x daily NMC reanalysis (1948) description: Data is from NMC initialized reanalysis\n(4x/day). These a... platform: Model references: http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanaly...
lat
(lat)
float32
75.0 72.5 70.0 ... 20.0 17.5 15.0
array([75. , 72.5, 70. , 67.5, 65. , 62.5, 60. , 57.5, 55. , 52.5, 50. , 47.5, 45. , 42.5, 40. , 37.5, 35. , 32.5, 30. , 27.5, 25. , 22.5, 20. , 17.5, 15. ], dtype=float32)
lon
(lon)
float32
200.0 202.5 205.0 ... 327.5 330.0
array([200. , 202.5, 205. , 207.5, 210. , 212.5, 215. , 217.5, 220. , 222.5, 225. , 227.5, 230. , 232.5, 235. , 237.5, 240. , 242.5, 245. , 247.5, 250. , 252.5, 255. , 257.5, 260. , 262.5, 265. , 267.5, 270. , 272.5, 275. , 277.5, 280. , 282.5, 285. , 287.5, 290. , 292.5, 295. , 297.5, 300. , 302.5, 305. , 307.5, 310. , 312.5, 315. , 317.5, 320. , 322.5, 325. , 327.5, 330. ], dtype=float32)
time
(time)
datetime64[ns]
2013-01-01 ... 2014-12-31T18:00:00
array(['2013-01-01T00:00:00.000000000', '2013-01-01T06:00:00.000000000', '2013-01-01T12:00:00.000000000', ..., '2014-12-31T06:00:00.000000000', '2014-12-31T12:00:00.000000000', '2014-12-31T18:00:00.000000000'], shape=(2920,), dtype='datetime64[ns]')
air
(time, lat, lon)
float64
nan nan nan ... 297.6 297.0 296.6
array([[[ nan, nan, nan, ..., 229.34 , 231.04 , 233.26 ], [ nan, nan, nan, ..., 232.96 , 233.02 , 234.24 ], [ nan, nan, nan, ..., 234.056, 233.674, 235.114], ..., [ nan, nan, nan, ..., 296.476, 296.038, 295.538], [ nan, nan, nan, ..., 296.878, 296.478, 296.038], [ nan, nan, nan, ..., 297.778, 297.416, 297.136]], [[ nan, nan, nan, ..., 229.936, 230.978, 232.36 ], [ nan, nan, nan, ..., 232.458, 231.938, 232.418], [ nan, nan, nan, ..., 232.898, 232.036, 232.936], ..., [ nan, nan, nan, ..., 296.52 , 296.06 , 295.618], [ nan, nan, nan, ..., 296.8 , 296.36 , 295.94 ], [ nan, nan, nan, ..., 297.2 , 296.86 , 296.68 ]], [[ nan, nan, nan, ..., 232.678, 233.498, 234.86 ], [ nan, nan, nan, ..., 232.876, 231.816, 232.078], [ nan, nan, nan, ..., 235.58 , 233.7 , 233.74 ], ..., ... [ nan, nan, nan, ..., 296.21 , 295.91 , 295.49 ], [ nan, nan, nan, ..., 296.51 , 296.25 , 295.85 ], [ nan, nan, nan, ..., 297.07 , 296.69 , 296.39 ]], [[ nan, nan, nan, ..., 243.37 , 243.29 , 243.57 ], [ nan, nan, nan, ..., 242.49 , 241.81 , 242.05 ], [ nan, nan, nan, ..., 241.49 , 240.85 , 241.85 ], ..., [ nan, nan, nan, ..., 295.63 , 295.29 , 294.89 ], [ nan, nan, nan, ..., 296.29 , 295.91 , 295.49 ], [ nan, nan, nan, ..., 296.79 , 296.29 , 295.97 ]], [[ nan, nan, nan, ..., 243.91 , 242.85 , 242.19 ], [ nan, nan, nan, ..., 242.35 , 241.01 , 240.59 ], [ nan, nan, nan, ..., 241.87 , 240.85 , 241.53 ], ..., [ nan, nan, nan, ..., 296.01 , 295.61 , 295.21 ], [ nan, nan, nan, ..., 297.01 , 296.51 , 296.07 ], [ nan, nan, nan, ..., 297.65 , 297.03 , 296.59 ]]], shape=(2920, 25, 53))
PandasIndex
PandasIndex(Index([75.0, 72.5, 70.0, 67.5, 65.0, 62.5, 60.0, 57.5, 55.0, 52.5, 50.0, 47.5, 45.0, 42.5, 40.0, 37.5, 35.0, 32.5, 30.0, 27.5, 25.0, 22.5, 20.0, 17.5, 15.0], dtype='float32', name='lat'))
PandasIndex
PandasIndex(Index([200.0, 202.5, 205.0, 207.5, 210.0, 212.5, 215.0, 217.5, 220.0, 222.5, 225.0, 227.5, 230.0, 232.5, 235.0, 237.5, 240.0, 242.5, 245.0, 247.5, 250.0, 252.5, 255.0, 257.5, 260.0, 262.5, 265.0, 267.5, 270.0, 272.5, 275.0, 277.5, 280.0, 282.5, 285.0, 287.5, 290.0, 292.5, 295.0, 297.5, 300.0, 302.5, 305.0, 307.5, 310.0, 312.5, 315.0, 317.5, 320.0, 322.5, 325.0, 327.5, 330.0], dtype='float32', name='lon'))
PandasIndex
PandasIndex(DatetimeIndex(['2013-01-01 00:00:00', '2013-01-01 06:00:00', '2013-01-01 12:00:00', '2013-01-01 18:00:00', '2013-01-02 00:00:00', '2013-01-02 06:00:00', '2013-01-02 12:00:00', '2013-01-02 18:00:00', '2013-01-03 00:00:00', '2013-01-03 06:00:00', ... '2014-12-29 12:00:00', '2014-12-29 18:00:00', '2014-12-30 00:00:00', '2014-12-30 06:00:00', '2014-12-30 12:00:00', '2014-12-30 18:00:00', '2014-12-31 00:00:00', '2014-12-31 06:00:00', '2014-12-31 12:00:00', '2014-12-31 18:00:00'], dtype='datetime64[ns]', name='time', length=2920, freq=None))
coarsen
works but everything later will break because of xarray bug https://github.com/pydata/xarray/issues/4120
ds.isel(lon=slice(50)).cf.coarsen(Y=5, X=10).mean()
ds.cf.groupby("T.month").mean(["lat", "X"])
<xarray.Dataset> Size: 47kB Dimensions: (time: 2920) Coordinates: * time (time) datetime64[ns] 23kB 2013-01-01 ... 2014-12-31T18:00:00 Data variables: air (time) float64 23kB 274.2 273.5 273.2 273.6 ... 273.0 273.0 273.4 Attributes: Conventions: COARDS title: 4x daily NMC reanalysis (1948) description: Data is from NMC initialized reanalysis\n(4x/day). These a... platform: Model references: http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanaly...
time
(time)
datetime64[ns]
2013-01-01 ... 2014-12-31T18:00:00
array(['2013-01-01T00:00:00.000000000', '2013-01-01T06:00:00.000000000', '2013-01-01T12:00:00.000000000', ..., '2014-12-31T06:00:00.000000000', '2014-12-31T12:00:00.000000000', '2014-12-31T18:00:00.000000000'], shape=(2920,), dtype='datetime64[ns]')
air
(time)
float64
274.2 273.5 273.2 ... 273.0 273.4
array([274.1662717 , 273.52021887, 273.23350943, ..., 272.99996226, 273.04449057, 273.41498113], shape=(2920,))
PandasIndex
PandasIndex(DatetimeIndex(['2013-01-01 00:00:00', '2013-01-01 06:00:00', '2013-01-01 12:00:00', '2013-01-01 18:00:00', '2013-01-02 00:00:00', '2013-01-02 06:00:00', '2013-01-02 12:00:00', '2013-01-02 18:00:00', '2013-01-03 00:00:00', '2013-01-03 06:00:00', ... '2014-12-29 12:00:00', '2014-12-29 18:00:00', '2014-12-30 00:00:00', '2014-12-30 06:00:00', '2014-12-30 12:00:00', '2014-12-30 18:00:00', '2014-12-31 00:00:00', '2014-12-31 06:00:00', '2014-12-31 12:00:00', '2014-12-31 18:00:00'], dtype='datetime64[ns]', name='time', length=2920, freq=None))
cf_xarray
can weight by cell measure variables if the appropriate attribute is set
# Lets make some weights (not sure if this is right) ds.coords["cell_area"] = ( np.cos(ds.air.cf["latitude"] * np.pi / 180) * xr.ones_like(ds.air.cf["longitude"]) * 105e3 * 110e3 ) # and set proper attributes ds["cell_area"].attrs = dict(standard_name="cell_area", units="m2") ds.air.attrs["cell_measures"] = "area: cell_area"
ds.air.cf.weighted("area").mean(["latitude", "time"]).cf.plot(x="longitude") ds.air.mean(["lat", "time"]).cf.plot(x="longitude")
[<matplotlib.lines.Line2D at 0x7f37ada30cd0>]Feature: Cell boundaries and vertices¶
cf_xarray
can infer cell boundaries (for rectilinear grids) and convert CF-standard bounds variables to vertices.
ds_bnds = ds.cf.add_bounds(["lat", "lon"]) ds_bnds
<xarray.Dataset> Size: 31MB Dimensions: (time: 2920, lat: 25, lon: 53, bounds: 2) Coordinates: * lat (lat) float32 100B 75.0 72.5 70.0 67.5 ... 22.5 20.0 17.5 15.0 * lon (lon) float32 212B 200.0 202.5 205.0 207.5 ... 325.0 327.5 330.0 * time (time) datetime64[ns] 23kB 2013-01-01 ... 2014-12-31T18:00:00 cell_area (lat, lon) float32 5kB 2.989e+09 2.989e+09 ... 1.116e+10 lat_bounds (lat, bounds) float32 200B 76.25 73.75 73.75 ... 16.25 13.75 lon_bounds (lon, bounds) float32 424B 198.8 201.2 201.2 ... 328.8 331.2 Dimensions without coordinates: bounds Data variables: air (time, lat, lon) float64 31MB 241.2 242.5 243.5 ... 296.2 295.7 Attributes: Conventions: COARDS title: 4x daily NMC reanalysis (1948) description: Data is from NMC initialized reanalysis\n(4x/day). These a... platform: Model references: http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanaly...
lat
(lat)
float32
75.0 72.5 70.0 ... 20.0 17.5 15.0
array([75. , 72.5, 70. , 67.5, 65. , 62.5, 60. , 57.5, 55. , 52.5, 50. , 47.5, 45. , 42.5, 40. , 37.5, 35. , 32.5, 30. , 27.5, 25. , 22.5, 20. , 17.5, 15. ], dtype=float32)
lon
(lon)
float32
200.0 202.5 205.0 ... 327.5 330.0
array([200. , 202.5, 205. , 207.5, 210. , 212.5, 215. , 217.5, 220. , 222.5, 225. , 227.5, 230. , 232.5, 235. , 237.5, 240. , 242.5, 245. , 247.5, 250. , 252.5, 255. , 257.5, 260. , 262.5, 265. , 267.5, 270. , 272.5, 275. , 277.5, 280. , 282.5, 285. , 287.5, 290. , 292.5, 295. , 297.5, 300. , 302.5, 305. , 307.5, 310. , 312.5, 315. , 317.5, 320. , 322.5, 325. , 327.5, 330. ], dtype=float32)
time
(time)
datetime64[ns]
2013-01-01 ... 2014-12-31T18:00:00
array(['2013-01-01T00:00:00.000000000', '2013-01-01T06:00:00.000000000', '2013-01-01T12:00:00.000000000', ..., '2014-12-31T06:00:00.000000000', '2014-12-31T12:00:00.000000000', '2014-12-31T18:00:00.000000000'], shape=(2920,), dtype='datetime64[ns]')
cell_area
(lat, lon)
float32
2.989e+09 2.989e+09 ... 1.116e+10
array([[2.9893588e+09, 2.9893588e+09, 2.9893588e+09, ..., 2.9893588e+09, 2.9893588e+09, 2.9893588e+09], [3.4731523e+09, 3.4731523e+09, 3.4731523e+09, ..., 3.4731523e+09, 3.4731523e+09, 3.4731523e+09], [3.9503316e+09, 3.9503316e+09, 3.9503316e+09, ..., 3.9503316e+09, 3.9503316e+09, 3.9503316e+09], ..., [1.0853450e+10, 1.0853450e+10, 1.0853450e+10, ..., 1.0853450e+10, 1.0853450e+10, 1.0853450e+10], [1.1015431e+10, 1.1015431e+10, 1.1015431e+10, ..., 1.1015431e+10, 1.1015431e+10, 1.1015431e+10], [1.1156443e+10, 1.1156443e+10, 1.1156443e+10, ..., 1.1156443e+10, 1.1156443e+10, 1.1156443e+10]], shape=(25, 53), dtype=float32)
lat_bounds
(lat, bounds)
float32
76.25 73.75 73.75 ... 16.25 13.75
array([[76.25, 73.75], [73.75, 71.25], [71.25, 68.75], [68.75, 66.25], [66.25, 63.75], [63.75, 61.25], [61.25, 58.75], [58.75, 56.25], [56.25, 53.75], [53.75, 51.25], [51.25, 48.75], [48.75, 46.25], [46.25, 43.75], [43.75, 41.25], [41.25, 38.75], [38.75, 36.25], [36.25, 33.75], [33.75, 31.25], [31.25, 28.75], [28.75, 26.25], [26.25, 23.75], [23.75, 21.25], [21.25, 18.75], [18.75, 16.25], [16.25, 13.75]], dtype=float32)
lon_bounds
(lon, bounds)
float32
198.8 201.2 201.2 ... 328.8 331.2
array([[198.75, 201.25], [201.25, 203.75], [203.75, 206.25], [206.25, 208.75], [208.75, 211.25], [211.25, 213.75], [213.75, 216.25], [216.25, 218.75], [218.75, 221.25], [221.25, 223.75], [223.75, 226.25], [226.25, 228.75], [228.75, 231.25], [231.25, 233.75], [233.75, 236.25], [236.25, 238.75], [238.75, 241.25], [241.25, 243.75], [243.75, 246.25], [246.25, 248.75], ... [281.25, 283.75], [283.75, 286.25], [286.25, 288.75], [288.75, 291.25], [291.25, 293.75], [293.75, 296.25], [296.25, 298.75], [298.75, 301.25], [301.25, 303.75], [303.75, 306.25], [306.25, 308.75], [308.75, 311.25], [311.25, 313.75], [313.75, 316.25], [316.25, 318.75], [318.75, 321.25], [321.25, 323.75], [323.75, 326.25], [326.25, 328.75], [328.75, 331.25]], dtype=float32)
air
(time, lat, lon)
float64
241.2 242.5 243.5 ... 296.2 295.7
array([[[241.2 , 242.5 , 243.5 , ..., 232.8 , 235.5 , 238.6 ], [243.8 , 244.5 , 244.7 , ..., 232.8 , 235.3 , 239.3 ], [250. , 249.8 , 248.89, ..., 233.2 , 236.39, 241.7 ], ..., [296.6 , 296.2 , 296.4 , ..., 295.4 , 295.1 , 294.7 ], [295.9 , 296.2 , 296.79, ..., 295.9 , 295.9 , 295.2 ], [296.29, 296.79, 297.1 , ..., 296.9 , 296.79, 296.6 ]], [[242.1 , 242.7 , 243.1 , ..., 232. , 233.6 , 235.8 ], [243.6 , 244.1 , 244.2 , ..., 231. , 232.5 , 235.7 ], [253.2 , 252.89, 252.1 , ..., 230.8 , 233.39, 238.5 ], ..., [296.4 , 295.9 , 296.2 , ..., 295.4 , 295.1 , 294.79], [296.2 , 296.7 , 296.79, ..., 295.6 , 295.5 , 295.1 ], [296.29, 297.2 , 297.4 , ..., 296.4 , 296.4 , 296.6 ]], [[242.3 , 242.2 , 242.3 , ..., 234.3 , 236.1 , 238.7 ], [244.6 , 244.39, 244. , ..., 230.3 , 232. , 235.7 ], [256.2 , 255.5 , 254.2 , ..., 231.2 , 233.2 , 238.2 ], ..., ... [294.79, 295.29, 297.49, ..., 295.49, 295.39, 294.69], [296.79, 297.89, 298.29, ..., 295.49, 295.49, 294.79], [298.19, 299.19, 298.79, ..., 296.09, 295.79, 295.79]], [[245.79, 244.79, 243.49, ..., 243.29, 243.99, 244.79], [249.89, 249.29, 248.49, ..., 241.29, 242.49, 244.29], [262.39, 261.79, 261.29, ..., 240.49, 243.09, 246.89], ..., [293.69, 293.89, 295.39, ..., 295.09, 294.69, 294.29], [296.29, 297.19, 297.59, ..., 295.29, 295.09, 294.39], [297.79, 298.39, 298.49, ..., 295.69, 295.49, 295.19]], [[245.09, 244.29, 243.29, ..., 241.69, 241.49, 241.79], [249.89, 249.29, 248.39, ..., 239.59, 240.29, 241.69], [262.99, 262.19, 261.39, ..., 239.89, 242.59, 246.29], ..., [293.79, 293.69, 295.09, ..., 295.29, 295.09, 294.69], [296.09, 296.89, 297.19, ..., 295.69, 295.69, 295.19], [297.69, 298.09, 298.09, ..., 296.49, 296.19, 295.69]]], shape=(2920, 25, 53))
PandasIndex
PandasIndex(Index([75.0, 72.5, 70.0, 67.5, 65.0, 62.5, 60.0, 57.5, 55.0, 52.5, 50.0, 47.5, 45.0, 42.5, 40.0, 37.5, 35.0, 32.5, 30.0, 27.5, 25.0, 22.5, 20.0, 17.5, 15.0], dtype='float32', name='lat'))
PandasIndex
PandasIndex(Index([200.0, 202.5, 205.0, 207.5, 210.0, 212.5, 215.0, 217.5, 220.0, 222.5, 225.0, 227.5, 230.0, 232.5, 235.0, 237.5, 240.0, 242.5, 245.0, 247.5, 250.0, 252.5, 255.0, 257.5, 260.0, 262.5, 265.0, 267.5, 270.0, 272.5, 275.0, 277.5, 280.0, 282.5, 285.0, 287.5, 290.0, 292.5, 295.0, 297.5, 300.0, 302.5, 305.0, 307.5, 310.0, 312.5, 315.0, 317.5, 320.0, 322.5, 325.0, 327.5, 330.0], dtype='float32', name='lon'))
PandasIndex
PandasIndex(DatetimeIndex(['2013-01-01 00:00:00', '2013-01-01 06:00:00', '2013-01-01 12:00:00', '2013-01-01 18:00:00', '2013-01-02 00:00:00', '2013-01-02 06:00:00', '2013-01-02 12:00:00', '2013-01-02 18:00:00', '2013-01-03 00:00:00', '2013-01-03 06:00:00', ... '2014-12-29 12:00:00', '2014-12-29 18:00:00', '2014-12-30 00:00:00', '2014-12-30 06:00:00', '2014-12-30 12:00:00', '2014-12-30 18:00:00', '2014-12-31 00:00:00', '2014-12-31 06:00:00', '2014-12-31 12:00:00', '2014-12-31 18:00:00'], dtype='datetime64[ns]', name='time', length=2920, freq=None))
We can also convert each bounds variable independently with the top-level functions
lat_bounds = ds_bnds.cf.get_bounds("latitude") lat_vertices = cfxr.bounds_to_vertices(lat_bounds, bounds_dim="bounds") lat_vertices
<xarray.DataArray 'lat_bounds' (lat_vertices: 26)> Size: 104B 76.25 73.75 71.25 68.75 66.25 63.75 ... 26.25 23.75 21.25 18.75 16.25 13.75 Dimensions without coordinates: lat_vertices Attributes: standard_name: latitude long_name: Latitude units: degrees_north axis: Y
76.25 73.75 71.25 68.75 66.25 63.75 ... 23.75 21.25 18.75 16.25 13.75
array([76.25, 73.75, 71.25, 68.75, 66.25, 63.75, 61.25, 58.75, 56.25, 53.75, 51.25, 48.75, 46.25, 43.75, 41.25, 38.75, 36.25, 33.75, 31.25, 28.75, 26.25, 23.75, 21.25, 18.75, 16.25, 13.75], dtype=float32)
# Or we can convert _all_ bounds variables on a dataset ds_crns = ds_bnds.cf.bounds_to_vertices() ds_crns
<xarray.Dataset> Size: 31MB Dimensions: (time: 2920, lat: 25, lon: 53, bounds: 2, lat_vertices: 26, lon_vertices: 54) Coordinates: * lat (lat) float32 100B 75.0 72.5 70.0 67.5 ... 22.5 20.0 17.5 15.0 * lon (lon) float32 212B 200.0 202.5 205.0 ... 325.0 327.5 330.0 * time (time) datetime64[ns] 23kB 2013-01-01 ... 2014-12-31T18:00:00 cell_area (lat, lon) float32 5kB 2.989e+09 2.989e+09 ... 1.116e+10 lat_bounds (lat, bounds) float32 200B 76.25 73.75 73.75 ... 16.25 13.75 lon_bounds (lon, bounds) float32 424B 198.8 201.2 201.2 ... 328.8 331.2 * lat_vertices (lat_vertices) float32 104B 76.25 73.75 71.25 ... 16.25 13.75 * lon_vertices (lon_vertices) float32 216B 198.8 201.2 203.8 ... 328.8 331.2 Dimensions without coordinates: bounds Data variables: air (time, lat, lon) float64 31MB 241.2 242.5 ... 296.2 295.7 Attributes: Conventions: COARDS title: 4x daily NMC reanalysis (1948) description: Data is from NMC initialized reanalysis\n(4x/day). These a... platform: Model references: http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanaly...
lat
(lat)
float32
75.0 72.5 70.0 ... 20.0 17.5 15.0
array([75. , 72.5, 70. , 67.5, 65. , 62.5, 60. , 57.5, 55. , 52.5, 50. , 47.5, 45. , 42.5, 40. , 37.5, 35. , 32.5, 30. , 27.5, 25. , 22.5, 20. , 17.5, 15. ], dtype=float32)
lon
(lon)
float32
200.0 202.5 205.0 ... 327.5 330.0
array([200. , 202.5, 205. , 207.5, 210. , 212.5, 215. , 217.5, 220. , 222.5, 225. , 227.5, 230. , 232.5, 235. , 237.5, 240. , 242.5, 245. , 247.5, 250. , 252.5, 255. , 257.5, 260. , 262.5, 265. , 267.5, 270. , 272.5, 275. , 277.5, 280. , 282.5, 285. , 287.5, 290. , 292.5, 295. , 297.5, 300. , 302.5, 305. , 307.5, 310. , 312.5, 315. , 317.5, 320. , 322.5, 325. , 327.5, 330. ], dtype=float32)
time
(time)
datetime64[ns]
2013-01-01 ... 2014-12-31T18:00:00
array(['2013-01-01T00:00:00.000000000', '2013-01-01T06:00:00.000000000', '2013-01-01T12:00:00.000000000', ..., '2014-12-31T06:00:00.000000000', '2014-12-31T12:00:00.000000000', '2014-12-31T18:00:00.000000000'], shape=(2920,), dtype='datetime64[ns]')
cell_area
(lat, lon)
float32
2.989e+09 2.989e+09 ... 1.116e+10
array([[2.9893588e+09, 2.9893588e+09, 2.9893588e+09, ..., 2.9893588e+09, 2.9893588e+09, 2.9893588e+09], [3.4731523e+09, 3.4731523e+09, 3.4731523e+09, ..., 3.4731523e+09, 3.4731523e+09, 3.4731523e+09], [3.9503316e+09, 3.9503316e+09, 3.9503316e+09, ..., 3.9503316e+09, 3.9503316e+09, 3.9503316e+09], ..., [1.0853450e+10, 1.0853450e+10, 1.0853450e+10, ..., 1.0853450e+10, 1.0853450e+10, 1.0853450e+10], [1.1015431e+10, 1.1015431e+10, 1.1015431e+10, ..., 1.1015431e+10, 1.1015431e+10, 1.1015431e+10], [1.1156443e+10, 1.1156443e+10, 1.1156443e+10, ..., 1.1156443e+10, 1.1156443e+10, 1.1156443e+10]], shape=(25, 53), dtype=float32)
lat_bounds
(lat, bounds)
float32
76.25 73.75 73.75 ... 16.25 13.75
array([[76.25, 73.75], [73.75, 71.25], [71.25, 68.75], [68.75, 66.25], [66.25, 63.75], [63.75, 61.25], [61.25, 58.75], [58.75, 56.25], [56.25, 53.75], [53.75, 51.25], [51.25, 48.75], [48.75, 46.25], [46.25, 43.75], [43.75, 41.25], [41.25, 38.75], [38.75, 36.25], [36.25, 33.75], [33.75, 31.25], [31.25, 28.75], [28.75, 26.25], [26.25, 23.75], [23.75, 21.25], [21.25, 18.75], [18.75, 16.25], [16.25, 13.75]], dtype=float32)
lon_bounds
(lon, bounds)
float32
198.8 201.2 201.2 ... 328.8 331.2
array([[198.75, 201.25], [201.25, 203.75], [203.75, 206.25], [206.25, 208.75], [208.75, 211.25], [211.25, 213.75], [213.75, 216.25], [216.25, 218.75], [218.75, 221.25], [221.25, 223.75], [223.75, 226.25], [226.25, 228.75], [228.75, 231.25], [231.25, 233.75], [233.75, 236.25], [236.25, 238.75], [238.75, 241.25], [241.25, 243.75], [243.75, 246.25], [246.25, 248.75], ... [281.25, 283.75], [283.75, 286.25], [286.25, 288.75], [288.75, 291.25], [291.25, 293.75], [293.75, 296.25], [296.25, 298.75], [298.75, 301.25], [301.25, 303.75], [303.75, 306.25], [306.25, 308.75], [308.75, 311.25], [311.25, 313.75], [313.75, 316.25], [316.25, 318.75], [318.75, 321.25], [321.25, 323.75], [323.75, 326.25], [326.25, 328.75], [328.75, 331.25]], dtype=float32)
lat_vertices
(lat_vertices)
float32
76.25 73.75 71.25 ... 16.25 13.75
array([76.25, 73.75, 71.25, 68.75, 66.25, 63.75, 61.25, 58.75, 56.25, 53.75, 51.25, 48.75, 46.25, 43.75, 41.25, 38.75, 36.25, 33.75, 31.25, 28.75, 26.25, 23.75, 21.25, 18.75, 16.25, 13.75], dtype=float32)
lon_vertices
(lon_vertices)
float32
198.8 201.2 203.8 ... 328.8 331.2
array([198.75, 201.25, 203.75, 206.25, 208.75, 211.25, 213.75, 216.25, 218.75, 221.25, 223.75, 226.25, 228.75, 231.25, 233.75, 236.25, 238.75, 241.25, 243.75, 246.25, 248.75, 251.25, 253.75, 256.25, 258.75, 261.25, 263.75, 266.25, 268.75, 271.25, 273.75, 276.25, 278.75, 281.25, 283.75, 286.25, 288.75, 291.25, 293.75, 296.25, 298.75, 301.25, 303.75, 306.25, 308.75, 311.25, 313.75, 316.25, 318.75, 321.25, 323.75, 326.25, 328.75, 331.25], dtype=float32)
air
(time, lat, lon)
float64
241.2 242.5 243.5 ... 296.2 295.7
array([[[241.2 , 242.5 , 243.5 , ..., 232.8 , 235.5 , 238.6 ], [243.8 , 244.5 , 244.7 , ..., 232.8 , 235.3 , 239.3 ], [250. , 249.8 , 248.89, ..., 233.2 , 236.39, 241.7 ], ..., [296.6 , 296.2 , 296.4 , ..., 295.4 , 295.1 , 294.7 ], [295.9 , 296.2 , 296.79, ..., 295.9 , 295.9 , 295.2 ], [296.29, 296.79, 297.1 , ..., 296.9 , 296.79, 296.6 ]], [[242.1 , 242.7 , 243.1 , ..., 232. , 233.6 , 235.8 ], [243.6 , 244.1 , 244.2 , ..., 231. , 232.5 , 235.7 ], [253.2 , 252.89, 252.1 , ..., 230.8 , 233.39, 238.5 ], ..., [296.4 , 295.9 , 296.2 , ..., 295.4 , 295.1 , 294.79], [296.2 , 296.7 , 296.79, ..., 295.6 , 295.5 , 295.1 ], [296.29, 297.2 , 297.4 , ..., 296.4 , 296.4 , 296.6 ]], [[242.3 , 242.2 , 242.3 , ..., 234.3 , 236.1 , 238.7 ], [244.6 , 244.39, 244. , ..., 230.3 , 232. , 235.7 ], [256.2 , 255.5 , 254.2 , ..., 231.2 , 233.2 , 238.2 ], ..., ... [294.79, 295.29, 297.49, ..., 295.49, 295.39, 294.69], [296.79, 297.89, 298.29, ..., 295.49, 295.49, 294.79], [298.19, 299.19, 298.79, ..., 296.09, 295.79, 295.79]], [[245.79, 244.79, 243.49, ..., 243.29, 243.99, 244.79], [249.89, 249.29, 248.49, ..., 241.29, 242.49, 244.29], [262.39, 261.79, 261.29, ..., 240.49, 243.09, 246.89], ..., [293.69, 293.89, 295.39, ..., 295.09, 294.69, 294.29], [296.29, 297.19, 297.59, ..., 295.29, 295.09, 294.39], [297.79, 298.39, 298.49, ..., 295.69, 295.49, 295.19]], [[245.09, 244.29, 243.29, ..., 241.69, 241.49, 241.79], [249.89, 249.29, 248.39, ..., 239.59, 240.29, 241.69], [262.99, 262.19, 261.39, ..., 239.89, 242.59, 246.29], ..., [293.79, 293.69, 295.09, ..., 295.29, 295.09, 294.69], [296.09, 296.89, 297.19, ..., 295.69, 295.69, 295.19], [297.69, 298.09, 298.09, ..., 296.49, 296.19, 295.69]]], shape=(2920, 25, 53))
PandasIndex
PandasIndex(Index([75.0, 72.5, 70.0, 67.5, 65.0, 62.5, 60.0, 57.5, 55.0, 52.5, 50.0, 47.5, 45.0, 42.5, 40.0, 37.5, 35.0, 32.5, 30.0, 27.5, 25.0, 22.5, 20.0, 17.5, 15.0], dtype='float32', name='lat'))
PandasIndex
PandasIndex(Index([200.0, 202.5, 205.0, 207.5, 210.0, 212.5, 215.0, 217.5, 220.0, 222.5, 225.0, 227.5, 230.0, 232.5, 235.0, 237.5, 240.0, 242.5, 245.0, 247.5, 250.0, 252.5, 255.0, 257.5, 260.0, 262.5, 265.0, 267.5, 270.0, 272.5, 275.0, 277.5, 280.0, 282.5, 285.0, 287.5, 290.0, 292.5, 295.0, 297.5, 300.0, 302.5, 305.0, 307.5, 310.0, 312.5, 315.0, 317.5, 320.0, 322.5, 325.0, 327.5, 330.0], dtype='float32', name='lon'))
PandasIndex
PandasIndex(DatetimeIndex(['2013-01-01 00:00:00', '2013-01-01 06:00:00', '2013-01-01 12:00:00', '2013-01-01 18:00:00', '2013-01-02 00:00:00', '2013-01-02 06:00:00', '2013-01-02 12:00:00', '2013-01-02 18:00:00', '2013-01-03 00:00:00', '2013-01-03 06:00:00', ... '2014-12-29 12:00:00', '2014-12-29 18:00:00', '2014-12-30 00:00:00', '2014-12-30 06:00:00', '2014-12-30 12:00:00', '2014-12-30 18:00:00', '2014-12-31 00:00:00', '2014-12-31 06:00:00', '2014-12-31 12:00:00', '2014-12-31 18:00:00'], dtype='datetime64[ns]', name='time', length=2920, freq=None))
PandasIndex
PandasIndex(Index([76.25, 73.75, 71.25, 68.75, 66.25, 63.75, 61.25, 58.75, 56.25, 53.75, 51.25, 48.75, 46.25, 43.75, 41.25, 38.75, 36.25, 33.75, 31.25, 28.75, 26.25, 23.75, 21.25, 18.75, 16.25, 13.75], dtype='float32', name='lat_vertices'))
PandasIndex
PandasIndex(Index([198.75, 201.25, 203.75, 206.25, 208.75, 211.25, 213.75, 216.25, 218.75, 221.25, 223.75, 226.25, 228.75, 231.25, 233.75, 236.25, 238.75, 241.25, 243.75, 246.25, 248.75, 251.25, 253.75, 256.25, 258.75, 261.25, 263.75, 266.25, 268.75, 271.25, 273.75, 276.25, 278.75, 281.25, 283.75, 286.25, 288.75, 291.25, 293.75, 296.25, 298.75, 301.25, 303.75, 306.25, 308.75, 311.25, 313.75, 316.25, 318.75, 321.25, 323.75, 326.25, 328.75, 331.25], dtype='float32', name='lon_vertices'))
cf_xarray
can add missing canonical CF attributes consistent with the official CF standard name table.
ds_canonical = ds.cf.add_canonical_attributes(verbose=True) ds_canonical
CF Standard Name Table info: - version_number: 92 - conventions: CF-StandardNameTable-92 - first_published: 2025-07-24T14:20:46Z - last_modified: 2025-07-24T14:20:46Z - institution: Centre for Environmental Data Analysis - contact: support@ceda.ac.uk Attributes added: - air: * description: Air temperature is the bulk temperature of the air, not the surface (skin) temperature. It is strongly recommended that a variable with this standard name should have a units_metadata attribute, with one of the values "on-scale" or "difference", whichever is appropriate for the data, because it is essential to know whether the temperature is on-scale (meaning relative to the origin of the scale indicated by the units) or refers to temperature differences (implying that the origin of the temperature scale is irrevelant), in order to convert the units correctly (cf. https://cfconventions.org/cf-conventions/cf-conventions.html#temperature-units). - lat: * description: Latitude is positive northward; its units of degree_north (or equivalent) indicate this explicitly. In a latitude-longitude system defined with respect to a rotated North Pole, the standard name of grid_latitude should be used instead of latitude. Grid latitude is positive in the grid-northward direction, but its units should be plain degree. - lon: * description: Longitude is positive eastward; its units of degree_east (or equivalent) indicate this explicitly. In a latitude-longitude system defined with respect to a rotated North Pole, the standard name of grid_longitude should be used instead of longitude. Grid longitude is positive in the grid-eastward direction, but its units should be plain degree. - cell_area: * description: "Cell_area" is the horizontal area of a gridcell.
<xarray.Dataset> Size: 31MB Dimensions: (time: 2920, lat: 25, lon: 53) Coordinates: * lat (lat) float32 100B 75.0 72.5 70.0 67.5 ... 22.5 20.0 17.5 15.0 * lon (lon) float32 212B 200.0 202.5 205.0 207.5 ... 325.0 327.5 330.0 * time (time) datetime64[ns] 23kB 2013-01-01 ... 2014-12-31T18:00:00 cell_area (lat, lon) float32 5kB 2.989e+09 2.989e+09 ... 1.116e+10 Data variables: air (time, lat, lon) float64 31MB 241.2 242.5 243.5 ... 296.2 295.7 Attributes: Conventions: COARDS title: 4x daily NMC reanalysis (1948) description: Data is from NMC initialized reanalysis\n(4x/day). These a... platform: Model references: http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanaly... history: Mon Aug 11 14:48:51 2025: cf.add_canonical_attributes(overr...
lat
(lat)
float32
75.0 72.5 70.0 ... 20.0 17.5 15.0
array([75. , 72.5, 70. , 67.5, 65. , 62.5, 60. , 57.5, 55. , 52.5, 50. , 47.5, 45. , 42.5, 40. , 37.5, 35. , 32.5, 30. , 27.5, 25. , 22.5, 20. , 17.5, 15. ], dtype=float32)
lon
(lon)
float32
200.0 202.5 205.0 ... 327.5 330.0
array([200. , 202.5, 205. , 207.5, 210. , 212.5, 215. , 217.5, 220. , 222.5, 225. , 227.5, 230. , 232.5, 235. , 237.5, 240. , 242.5, 245. , 247.5, 250. , 252.5, 255. , 257.5, 260. , 262.5, 265. , 267.5, 270. , 272.5, 275. , 277.5, 280. , 282.5, 285. , 287.5, 290. , 292.5, 295. , 297.5, 300. , 302.5, 305. , 307.5, 310. , 312.5, 315. , 317.5, 320. , 322.5, 325. , 327.5, 330. ], dtype=float32)
time
(time)
datetime64[ns]
2013-01-01 ... 2014-12-31T18:00:00
array(['2013-01-01T00:00:00.000000000', '2013-01-01T06:00:00.000000000', '2013-01-01T12:00:00.000000000', ..., '2014-12-31T06:00:00.000000000', '2014-12-31T12:00:00.000000000', '2014-12-31T18:00:00.000000000'], shape=(2920,), dtype='datetime64[ns]')
cell_area
(lat, lon)
float32
2.989e+09 2.989e+09 ... 1.116e+10
array([[2.9893588e+09, 2.9893588e+09, 2.9893588e+09, ..., 2.9893588e+09, 2.9893588e+09, 2.9893588e+09], [3.4731523e+09, 3.4731523e+09, 3.4731523e+09, ..., 3.4731523e+09, 3.4731523e+09, 3.4731523e+09], [3.9503316e+09, 3.9503316e+09, 3.9503316e+09, ..., 3.9503316e+09, 3.9503316e+09, 3.9503316e+09], ..., [1.0853450e+10, 1.0853450e+10, 1.0853450e+10, ..., 1.0853450e+10, 1.0853450e+10, 1.0853450e+10], [1.1015431e+10, 1.1015431e+10, 1.1015431e+10, ..., 1.1015431e+10, 1.1015431e+10, 1.1015431e+10], [1.1156443e+10, 1.1156443e+10, 1.1156443e+10, ..., 1.1156443e+10, 1.1156443e+10, 1.1156443e+10]], shape=(25, 53), dtype=float32)
air
(time, lat, lon)
float64
241.2 242.5 243.5 ... 296.2 295.7
array([[[241.2 , 242.5 , 243.5 , ..., 232.8 , 235.5 , 238.6 ], [243.8 , 244.5 , 244.7 , ..., 232.8 , 235.3 , 239.3 ], [250. , 249.8 , 248.89, ..., 233.2 , 236.39, 241.7 ], ..., [296.6 , 296.2 , 296.4 , ..., 295.4 , 295.1 , 294.7 ], [295.9 , 296.2 , 296.79, ..., 295.9 , 295.9 , 295.2 ], [296.29, 296.79, 297.1 , ..., 296.9 , 296.79, 296.6 ]], [[242.1 , 242.7 , 243.1 , ..., 232. , 233.6 , 235.8 ], [243.6 , 244.1 , 244.2 , ..., 231. , 232.5 , 235.7 ], [253.2 , 252.89, 252.1 , ..., 230.8 , 233.39, 238.5 ], ..., [296.4 , 295.9 , 296.2 , ..., 295.4 , 295.1 , 294.79], [296.2 , 296.7 , 296.79, ..., 295.6 , 295.5 , 295.1 ], [296.29, 297.2 , 297.4 , ..., 296.4 , 296.4 , 296.6 ]], [[242.3 , 242.2 , 242.3 , ..., 234.3 , 236.1 , 238.7 ], [244.6 , 244.39, 244. , ..., 230.3 , 232. , 235.7 ], [256.2 , 255.5 , 254.2 , ..., 231.2 , 233.2 , 238.2 ], ..., ... [294.79, 295.29, 297.49, ..., 295.49, 295.39, 294.69], [296.79, 297.89, 298.29, ..., 295.49, 295.49, 294.79], [298.19, 299.19, 298.79, ..., 296.09, 295.79, 295.79]], [[245.79, 244.79, 243.49, ..., 243.29, 243.99, 244.79], [249.89, 249.29, 248.49, ..., 241.29, 242.49, 244.29], [262.39, 261.79, 261.29, ..., 240.49, 243.09, 246.89], ..., [293.69, 293.89, 295.39, ..., 295.09, 294.69, 294.29], [296.29, 297.19, 297.59, ..., 295.29, 295.09, 294.39], [297.79, 298.39, 298.49, ..., 295.69, 295.49, 295.19]], [[245.09, 244.29, 243.29, ..., 241.69, 241.49, 241.79], [249.89, 249.29, 248.39, ..., 239.59, 240.29, 241.69], [262.99, 262.19, 261.39, ..., 239.89, 242.59, 246.29], ..., [293.79, 293.69, 295.09, ..., 295.29, 295.09, 294.69], [296.09, 296.89, 297.19, ..., 295.69, 295.69, 295.19], [297.69, 298.09, 298.09, ..., 296.49, 296.19, 295.69]]], shape=(2920, 25, 53))
PandasIndex
PandasIndex(Index([75.0, 72.5, 70.0, 67.5, 65.0, 62.5, 60.0, 57.5, 55.0, 52.5, 50.0, 47.5, 45.0, 42.5, 40.0, 37.5, 35.0, 32.5, 30.0, 27.5, 25.0, 22.5, 20.0, 17.5, 15.0], dtype='float32', name='lat'))
PandasIndex
PandasIndex(Index([200.0, 202.5, 205.0, 207.5, 210.0, 212.5, 215.0, 217.5, 220.0, 222.5, 225.0, 227.5, 230.0, 232.5, 235.0, 237.5, 240.0, 242.5, 245.0, 247.5, 250.0, 252.5, 255.0, 257.5, 260.0, 262.5, 265.0, 267.5, 270.0, 272.5, 275.0, 277.5, 280.0, 282.5, 285.0, 287.5, 290.0, 292.5, 295.0, 297.5, 300.0, 302.5, 305.0, 307.5, 310.0, 312.5, 315.0, 317.5, 320.0, 322.5, 325.0, 327.5, 330.0], dtype='float32', name='lon'))
PandasIndex
PandasIndex(DatetimeIndex(['2013-01-01 00:00:00', '2013-01-01 06:00:00', '2013-01-01 12:00:00', '2013-01-01 18:00:00', '2013-01-02 00:00:00', '2013-01-02 06:00:00', '2013-01-02 12:00:00', '2013-01-02 18:00:00', '2013-01-03 00:00:00', '2013-01-03 06:00:00', ... '2014-12-29 12:00:00', '2014-12-29 18:00:00', '2014-12-30 00:00:00', '2014-12-30 06:00:00', '2014-12-30 12:00:00', '2014-12-30 18:00:00', '2014-12-31 00:00:00', '2014-12-31 06:00:00', '2014-12-31 12:00:00', '2014-12-31 18:00:00'], dtype='datetime64[ns]', name='time', length=2920, freq=None))
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4