Polytope
  • Home
  • Installation
  • Quick Start
  • Data Portfolio

Full Fields

  • Full Fields

Features

  • Overview
  • Time Series
  • Vertical Profile
  • Polygon
  • Bounding Box
  • Trajectory
  • Circle
  • Position

Examples

  • Examples
Polytope
  • Bounding Box Open Data Example

Bounding Box Open Data Example¶

In [ ]:
Copied!
import earthkit.data

request = {
    "class": "ai",
    "stream" : "oper",
    "type" : "fc",
    "date" : -1,
    "time" : "0000",
    "levtype" : "sfc",
    "expver" : "0001", 
    "model": "aifs-single",
    "domain" : "g",
    "param" : "166/167/169",
    "step" : "0",
    "feature" : {
        "type" : "boundingbox",
        "points" : [[53.55, 2.76], [50.66, 7.86]],
	},
}


ds = earthkit.data.from_source(
    "polytope",
    "ecmwf-mars",
    request,
    stream=False,
    address='polytope.ecmwf.int',
)
import earthkit.data request = { "class": "ai", "stream" : "oper", "type" : "fc", "date" : -1, "time" : "0000", "levtype" : "sfc", "expver" : "0001", "model": "aifs-single", "domain" : "g", "param" : "166/167/169", "step" : "0", "feature" : { "type" : "boundingbox", "points" : [[53.55, 2.76], [50.66, 7.86]], }, } ds = earthkit.data.from_source( "polytope", "ecmwf-mars", request, stream=False, address='polytope.ecmwf.int', )

Convert to xarray¶

In [6]:
Copied!
da = ds.to_xarray()
da
da = ds.to_xarray() da
Out[6]:
<xarray.Dataset> Size: 7kB
Dimensions:    (datetimes: 1, number: 1, steps: 1, points: 126)
Coordinates:
  * datetimes  (datetimes) <U20 80B '2025-02-24T00:00:00Z'
  * number     (number) int64 8B 0
  * steps      (steps) int64 8B 0
  * points     (points) int64 1kB 0 1 2 3 4 5 6 ... 119 120 121 122 123 124 125
    x          (points) float64 1kB 50.73 50.73 50.73 ... 53.54 53.54 53.54
    y          (points) float64 1kB 2.917 3.333 3.75 4.167 ... 6.3 6.75 7.2 7.65
    z          (points) float64 1kB 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0
Data variables:
    10v        (datetimes, number, steps, points) float64 1kB 6.599 ... 6.1
    2t         (datetimes, number, steps, points) float64 1kB 284.2 ... 283.4
    ssrd       (datetimes, number, steps, points) float64 1kB 0.0 0.0 ... 0.0
Attributes:
    class:          ai
    Forecast date:  2025-02-24T00:00:00Z
    domain:         g
    expver:         0102
    levtype:        sfc
    model:          aifs-single
    step:           0
    stream:         oper
    type:           fc
    number:         0
    date:           2025-02-24T00:00:00Z
xarray.Dataset
    • datetimes: 1
    • number: 1
    • steps: 1
    • points: 126
    • datetimes
      (datetimes)
      <U20
      '2025-02-24T00:00:00Z'
      array(['2025-02-24T00:00:00Z'], dtype='<U20')
    • number
      (number)
      int64
      0
      array([0])
    • steps
      (steps)
      int64
      0
      array([0])
    • points
      (points)
      int64
      0 1 2 3 4 5 ... 121 122 123 124 125
      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,  30,  31,  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,
              42,  43,  44,  45,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,
              56,  57,  58,  59,  60,  61,  62,  63,  64,  65,  66,  67,  68,  69,
              70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,  81,  82,  83,
              84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,  97,
              98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
             112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125])
    • x
      (points)
      float64
      50.73 50.73 50.73 ... 53.54 53.54
      array([50.72597397, 50.72597397, 50.72597397, 50.72597397, 50.72597397,
             50.72597397, 50.72597397, 50.72597397, 50.72597397, 50.72597397,
             50.72597397, 50.72597397, 51.0070042 , 51.0070042 , 51.0070042 ,
             51.0070042 , 51.0070042 , 51.0070042 , 51.0070042 , 51.0070042 ,
             51.0070042 , 51.0070042 , 51.0070042 , 51.0070042 , 51.28803442,
             51.28803442, 51.28803442, 51.28803442, 51.28803442, 51.28803442,
             51.28803442, 51.28803442, 51.28803442, 51.28803442, 51.28803442,
             51.28803442, 51.56906465, 51.56906465, 51.56906465, 51.56906465,
             51.56906465, 51.56906465, 51.56906465, 51.56906465, 51.56906465,
             51.56906465, 51.56906465, 51.56906465, 51.85009487, 51.85009487,
             51.85009487, 51.85009487, 51.85009487, 51.85009487, 51.85009487,
             51.85009487, 51.85009487, 51.85009487, 51.85009487, 51.85009487,
             52.13112509, 52.13112509, 52.13112509, 52.13112509, 52.13112509,
             52.13112509, 52.13112509, 52.13112509, 52.13112509, 52.13112509,
             52.13112509, 52.41215531, 52.41215531, 52.41215531, 52.41215531,
             52.41215531, 52.41215531, 52.41215531, 52.41215531, 52.41215531,
             52.41215531, 52.41215531, 52.69318552, 52.69318552, 52.69318552,
             52.69318552, 52.69318552, 52.69318552, 52.69318552, 52.69318552,
             52.69318552, 52.69318552, 52.69318552, 52.97421573, 52.97421573,
             52.97421573, 52.97421573, 52.97421573, 52.97421573, 52.97421573,
             52.97421573, 52.97421573, 52.97421573, 52.97421573, 53.25524594,
             53.25524594, 53.25524594, 53.25524594, 53.25524594, 53.25524594,
             53.25524594, 53.25524594, 53.25524594, 53.25524594, 53.25524594,
             53.53627614, 53.53627614, 53.53627614, 53.53627614, 53.53627614,
             53.53627614, 53.53627614, 53.53627614, 53.53627614, 53.53627614,
             53.53627614])
    • y
      (points)
      float64
      2.917 3.333 3.75 ... 6.75 7.2 7.65
      array([2.91666667, 3.33333333, 3.75      , 4.16666667, 4.58333333,
             5.        , 5.41666667, 5.83333333, 6.25      , 6.66666667,
             7.08333333, 7.5       , 2.91666667, 3.33333333, 3.75      ,
             4.16666667, 4.58333333, 5.        , 5.41666667, 5.83333333,
             6.25      , 6.66666667, 7.08333333, 7.5       , 2.91666667,
             3.33333333, 3.75      , 4.16666667, 4.58333333, 5.        ,
             5.41666667, 5.83333333, 6.25      , 6.66666667, 7.08333333,
             7.5       , 2.91666667, 3.33333333, 3.75      , 4.16666667,
             4.58333333, 5.        , 5.41666667, 5.83333333, 6.25      ,
             6.66666667, 7.08333333, 7.5       , 2.91666667, 3.33333333,
             3.75      , 4.16666667, 4.58333333, 5.        , 5.41666667,
             5.83333333, 6.25      , 6.66666667, 7.08333333, 7.5       ,
             3.11111111, 3.55555556, 4.        , 4.44444444, 4.88888889,
             5.33333333, 5.77777778, 6.22222222, 6.66666667, 7.11111111,
             7.55555556, 3.11111111, 3.55555556, 4.        , 4.44444444,
             4.88888889, 5.33333333, 5.77777778, 6.22222222, 6.66666667,
             7.11111111, 7.55555556, 3.15      , 3.6       , 4.05      ,
             4.5       , 4.95      , 5.4       , 5.85      , 6.3       ,
             6.75      , 7.2       , 7.65      , 3.15      , 3.6       ,
             4.05      , 4.5       , 4.95      , 5.4       , 5.85      ,
             6.3       , 6.75      , 7.2       , 7.65      , 3.15      ,
             3.6       , 4.05      , 4.5       , 4.95      , 5.4       ,
             5.85      , 6.3       , 6.75      , 7.2       , 7.65      ,
             3.15      , 3.6       , 4.05      , 4.5       , 4.95      ,
             5.4       , 5.85      , 6.3       , 6.75      , 7.2       ,
             7.65      ])
    • z
      (points)
      float64
      0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
      array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
             0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
             0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
             0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
             0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
             0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
             0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
             0., 0., 0., 0., 0., 0., 0.])
    • 10v
      (datetimes, number, steps, points)
      float64
      6.599 6.349 6.251 ... 6.654 6.1
      type :
      Parameter
      units :
      m s**-1
      long_name :
      10v
      array([[[[ 6.59854126,  6.34854126,  6.25088501,  5.77334595,
                 5.61026001,  5.96572876,  5.52627563,  5.80557251,
                 5.31240845,  4.04873657,  1.86416626,  4.5741272 ,
                 6.91201782,  6.62783813,  5.8788147 ,  5.5585022 ,
                 5.1835022 ,  5.3553772 ,  4.88858032,  4.90518188,
                 4.04190063,  2.79483032,  3.14346313,  4.17178345,
                 8.74209595,  7.02236938,  6.50772095,  5.73135376,
                 5.21670532,  5.2069397 ,  5.21865845,  5.21768188,
                 4.28604126,  3.17471313,  5.13369751,  5.68545532,
                11.40322876, 10.44815063,  7.44326782,  7.13760376,
                 5.61221313,  5.40322876,  5.45986938,  5.44522095,
                 4.83584595,  4.13565063,  3.87783813,  4.09951782,
                12.12490845, 11.62197876, 11.08682251,  7.12393188,
                 5.63858032,  6.21865845,  5.89248657,  5.17471313,
                 5.35049438,  5.27334595,  4.43838501,  4.16104126,
                12.1756897 , 11.97451782, 11.77432251,  6.06143188,
                 6.18252563,  5.60147095,  5.40029907,  5.5819397 ,
                 5.90029907,  5.34170532,  4.4491272 , 13.18643188,
                12.55752563, 11.80557251, 10.66397095,  5.22451782,
                 6.83779907,  5.68740845,  5.96182251,  5.64639282,
                 5.37979126,  5.04483032, 13.27334595, 12.66494751,
                12.2616272 , 11.41104126,  6.28311157,  9.8163147 ,
                 6.15420532,  6.14151001,  6.06143188,  5.55264282,
                 5.04971313, 13.81729126, 13.2225647 , 12.76065063,
                12.15615845,  9.47549438,  8.28701782,  7.08877563,
                 6.28604126,  5.9491272 ,  6.07803345,  5.40029907,
                13.8006897 , 13.4725647 , 13.1835022 , 12.68057251,
                11.08682251,  9.01358032,  7.22549438,  6.75283813,
                 6.04092407,  6.59170532,  5.7850647 , 13.58584595,
                13.32217407, 12.73330688, 12.50479126, 12.26455688,
                10.47842407, 10.49795532,  9.14151001,  8.6288147 ,
                 6.65420532,  6.09951782]]]])
    • 2t
      (datetimes, number, steps, points)
      float64
      284.2 284.2 284.2 ... 283.6 283.4
      type :
      Parameter
      units :
      K
      long_name :
      2t
      array([[[[284.18347168, 284.2322998 , 284.23425293, 284.58776855,
                284.84362793, 284.96081543, 284.66003418, 284.24206543,
                283.3885498 , 283.3494873 , 281.64831543, 281.26550293,
                284.47839355, 284.39831543, 284.48815918, 284.88464355,
                285.4901123 , 285.3182373 , 284.89440918, 284.99401855,
                284.5213623 , 282.0213623 , 282.16394043, 280.96862793,
                282.78112793, 284.41003418, 284.51745605, 284.8260498 ,
                285.12487793, 285.22644043, 285.1307373 , 284.95495605,
                284.67370605, 282.6619873 , 282.8651123 , 282.07800293,
                282.31237793, 281.82019043, 284.44128418, 284.72839355,
                285.0369873 , 285.2401123 , 285.28503418, 284.93737793,
                284.44519043, 283.1619873 , 283.93933105, 283.71081543,
                282.61120605, 281.91003418, 282.10534668, 284.58581543,
                284.70495605, 285.09362793, 285.02722168, 284.82409668,
                284.24206543, 283.62487793, 283.6932373 , 283.34558105,
                282.3338623 , 281.84362793, 281.56628418, 284.71862793,
                284.97644043, 284.99401855, 284.6229248 , 284.30847168,
                283.93151855, 283.6932373 , 283.29284668, 282.46081543,
                281.90222168, 281.01745605, 281.94909668, 284.86706543,
                284.68737793, 284.7401123 , 284.40222168, 284.22644043,
                284.01940918, 283.49987793, 282.36120605, 281.93933105,
                281.15808105, 281.61120605, 285.03503418, 281.22058105,
                284.6854248 , 284.3729248 , 284.13659668, 284.15612793,
                283.4901123 , 282.13269043, 281.88659668, 281.39831543,
                281.23425293, 282.37683105, 282.81237793, 284.32800293,
                284.2791748 , 284.1854248 , 284.14440918, 283.55456543,
                281.83776855, 281.67956543, 281.2713623 , 281.0838623 ,
                281.73425293, 281.38464355, 283.8651123 , 284.2401123 ,
                284.17565918, 283.84558105, 283.36901855, 281.59362793,
                281.51159668, 281.3416748 , 281.01550293, 281.2557373 ,
                280.97839355, 281.42370605, 281.59362793, 281.67565918,
                283.61706543, 283.41394043]]]])
    • ssrd
      (datetimes, number, steps, points)
      float64
      0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
      type :
      Parameter
      units :
      J m**-2
      long_name :
      ssrd
      array([[[[0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
                0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
                0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
                0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
                0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
                0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
                0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
                0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
                0., 0., 0., 0., 0., 0.]]]])
    • datetimes
      PandasIndex
      PandasIndex(Index(['2025-02-24T00:00:00Z'], dtype='object', name='datetimes'))
    • number
      PandasIndex
      PandasIndex(Index([0], dtype='int64', name='number'))
    • steps
      PandasIndex
      PandasIndex(Index([0], dtype='int64', name='steps'))
    • points
      PandasIndex
      PandasIndex(Index([  0,   1,   2,   3,   4,   5,   6,   7,   8,   9,
             ...
             116, 117, 118, 119, 120, 121, 122, 123, 124, 125],
            dtype='int64', name='points', length=126))
  • class :
    ai
    Forecast date :
    2025-02-24T00:00:00Z
    domain :
    g
    expver :
    0102
    levtype :
    sfc
    model :
    aifs-single
    step :
    0
    stream :
    oper
    type :
    fc
    number :
    0
    date :
    2025-02-24T00:00:00Z

Visualise¶

In [7]:
Copied!
da = ds.to_xarray()
import earthkit.plots
chart = earthkit.plots.Map(domain="Europe")
chart.point_cloud(da['2t'], x="y", y="x")

chart.coastlines()
chart.borders()
chart.gridlines()

chart.title("{variable_name} (number={number})")

chart.legend()

chart.show()
da = ds.to_xarray() import earthkit.plots chart = earthkit.plots.Map(domain="Europe") chart.point_cloud(da['2t'], x="y", y="x") chart.coastlines() chart.borders() chart.gridlines() chart.title("{variable_name} (number={number})") chart.legend() chart.show()
No description has been provided for this image
In [ ]:
Copied!


Built with MkDocs using a theme provided by Read the Docs.