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
  • Vertical Profile Example

Vertical Profile Example¶

In [2]:
Copied!
import earthkit.data

request = {
    "class": "od",
    "stream": "enfo",
    "type": "pf",
    "date": -1,  # Note: date must be within the last two days 
    "time": "0000",
    "levtype": "pl",
    "expver": "0001",
    "domain": "g",
    "param": "203/133",
    "number": "1",
    "step": "0",
    "levelist": "1/to/1000",
    "feature": {
        "type": "verticalprofile",
        "points": [[38.9, -9.1]],
    },
}

ds = earthkit.data.from_source("polytope", "ecmwf-mars", request, stream=False, address='polytope.ecmwf.int')
import earthkit.data request = { "class": "od", "stream": "enfo", "type": "pf", "date": -1, # Note: date must be within the last two days "time": "0000", "levtype": "pl", "expver": "0001", "domain": "g", "param": "203/133", "number": "1", "step": "0", "levelist": "1/to/1000", "feature": { "type": "verticalprofile", "points": [[38.9, -9.1]], }, } ds = earthkit.data.from_source("polytope", "ecmwf-mars", request, stream=False, address='polytope.ecmwf.int')

Visualise¶

The following visualisation uses earthkit-plots.

Note: This notebook is rendered in many different ways depending on where you are viewing it (e.g. GitHub, Jupyter, readthedocs etc.). To maximise compatibility with many possible rendering methods, all interactive plots are rendered with chart.show(renderer="png"), which removes all interactivity and only shows a PNG image render.

If you are running this notebook in an interactive session yourself and would like to interact with the plots, remove the renderer="png" argument from each call to chart.show().
In [3]:
Copied!
from earthkit.plots.interactive import Chart

chart = Chart()
chart.line(ds, y="z")
chart.fig.update_layout(yaxis1={"title": "hPa"})
chart.fig.update_layout(yaxis2={"title": "hPa"})
chart.show(renderer="png")  # Replace with chart.show() in an interactive session!
from earthkit.plots.interactive import Chart chart = Chart() chart.line(ds, y="z") chart.fig.update_layout(yaxis1={"title": "hPa"}) chart.fig.update_layout(yaxis2={"title": "hPa"}) chart.show(renderer="png") # Replace with chart.show() in an interactive session!
No description has been provided for this image

Convert to Xarray¶

In [ ]:
Copied!
da = ds.to_xarray()
print(da)
da = ds.to_xarray() print(da)
In [ ]:
Copied!


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