Skip to content

Commit

Permalink
Use rst links in notebooks (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandorkertesz authored Feb 5, 2024
1 parent 8533d63 commit 689f521
Show file tree
Hide file tree
Showing 38 changed files with 2,723 additions and 747 deletions.
49 changes: 40 additions & 9 deletions docs/examples/ads.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,43 @@
{
"cell_type": "markdown",
"id": "7ec282fb-fdf9-45ba-b3f7-3d46ef212e98",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"## Retrieving CAMS data from the ADS"
]
},
{
"cell_type": "markdown",
"id": "52ed2e76-9c54-4a85-b932-6604efc7ae85",
"metadata": {},
"cell_type": "raw",
"id": "fdb1ce5a-2f75-44e4-85fb-6bd47084cadd",
"metadata": {
"editable": true,
"raw_mimetype": "text/restructuredtext",
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"The \"ads\" data source provides access to the [Copernicus Atmosphere Data Store (ADS)](https://ads.atmosphere.copernicus.eu)."
"The :ref:`ads <data-sources-ads>` data source provides access to the `Copernicus Atmosphere Data Store (ADS) <https://ads.atmosphere.copernicus.eu>`_."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "f24509e0-dd8c-4032-9a3c-5a963ad544d9",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"import earthkit.data"
Expand All @@ -29,7 +48,13 @@
{
"cell_type": "markdown",
"id": "9f4ce2c9-aaa3-4b76-aacb-1f597df3e338",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"### Getting GRIB data"
]
Expand All @@ -55,7 +80,13 @@
"cell_type": "code",
"execution_count": 3,
"id": "09210614-fad6-46cf-915d-aae4a592d2d5",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -211,7 +242,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
60 changes: 46 additions & 14 deletions docs/examples/bufr_synop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
{
"cell_type": "markdown",
"id": "102b1cf9-33a5-4310-af4d-bcd17d598d29",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"## Using BUFR SYNOP data"
]
Expand Down Expand Up @@ -60,18 +66,31 @@
]
},
{
"cell_type": "markdown",
"id": "06d99f09-8d9d-4677-8aec-275787162a27",
"metadata": {},
"cell_type": "raw",
"id": "a1f9fd95-d020-4941-b616-f01da9177b4e",
"metadata": {
"editable": true,
"raw_mimetype": "text/restructuredtext",
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"We use ls() to see metadata from the header section of the BUFR messages: "
"We use :py:meth:`~data.readers.bufr.bufr.BUFRList.ls` to see metadata from the header section of the BUFR messages: "
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "30e7749a-ea8b-43d2-90d2-31907f228513",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -318,11 +337,18 @@
]
},
{
"cell_type": "markdown",
"id": "07ca0ea4-cad9-4973-ac79-681f9140c116",
"metadata": {},
"cell_type": "raw",
"id": "ab0308f1-a43d-4713-844d-49cbfe03453a",
"metadata": {
"editable": true,
"raw_mimetype": "text/restructuredtext",
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"BUFR data can be extracted into a Pandas dataframe using [to_pandas()](https://earthkit-data.readthedocs.io/en/latest/guide/data_format/bufr.html), which passes all the arguments to the [read_bufr()](https://pdbufr.readthedocs.io/en/latest/read_bufr.html) method from [pdbufr](\"https://github.com/ecmwf/pdbufr\").\n",
"BUFR data can be extracted into a Pandas dataframe using :py:meth:`~data.readers.bufr.bufr.BUFRList.to_pandas`, which passes all the arguments to the `read_bufr() <https://pdbufr.readthedocs.io/en/latest/read_bufr.html>`_ method from :xref:`pdbufr`.\n",
"\n",
"SYNOP data can be encoded into BUFR in many different ways. For the data we have the location and the 2m temperature can be extracted in the following way into a Pandas dataframe:"
]
Expand All @@ -331,7 +357,13 @@
"cell_type": "code",
"execution_count": 5,
"id": "53ac87d6-09b9-46c3-bc54-07fd2a175b05",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -826,9 +858,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "mpy38",
"display_name": "dev_ecc",
"language": "python",
"name": "mpy38"
"name": "dev_ecc"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -840,7 +872,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.16"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
83 changes: 64 additions & 19 deletions docs/examples/bufr_temp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
{
"cell_type": "markdown",
"id": "102b1cf9-33a5-4310-af4d-bcd17d598d29",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"## Using BUFR TEMP data"
]
Expand Down Expand Up @@ -88,18 +94,31 @@
]
},
{
"cell_type": "markdown",
"id": "06d99f09-8d9d-4677-8aec-275787162a27",
"metadata": {},
"cell_type": "raw",
"id": "a05776c0-b71d-42eb-93d9-443b83342b93",
"metadata": {
"editable": true,
"raw_mimetype": "text/restructuredtext",
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"We can call *head()*, *tail()* and *ls()* to see metadata from the header section of the BUFR messages: "
"We can call :py:meth:`~data.readers.bufr.bufr.BUFRList.head`, :py:meth:`~data.readers.bufr.bufr.BUFRList.tail` and :py:meth:`~data.readers.bufr.bufr.BUFRList.ls` to see metadata from the header section of the BUFR messages: "
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "30e7749a-ea8b-43d2-90d2-31907f228513",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -256,18 +275,31 @@
]
},
{
"cell_type": "markdown",
"id": "7331e275-a157-407f-a9a0-5070db261d1d",
"metadata": {},
"cell_type": "raw",
"id": "2edde77d-4e8e-4fb4-8569-700392310fa7",
"metadata": {
"editable": true,
"raw_mimetype": "text/restructuredtext",
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"We can **dump** the contents of each message into a tree view. The dump below tells us that the message represents a given station and contains vertical profiles on a set of pressure levels (see the **data section**)."
"We can :py:meth:`~data.readers.bufr.bufr.BUFRMessage.dump` the contents of each message into a tree view. The dump below tells us that the message represents a given station and contains vertical profiles on a set of pressure levels (see the **data section**)."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "613f01a9-8d0b-4dba-b74d-643aa40083ad",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -965,11 +997,18 @@
]
},
{
"cell_type": "markdown",
"id": "07ca0ea4-cad9-4973-ac79-681f9140c116",
"metadata": {},
"cell_type": "raw",
"id": "324fa8d6-4a80-4a3c-98eb-7185c66734e4",
"metadata": {
"editable": true,
"raw_mimetype": "text/restructuredtext",
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"BUFR data can be extracted into a Pandas dataframe using [to_pandas()](https://earthkit-data.readthedocs.io/en/latest/guide/data_format/bufr.html), which passes all the arguments to the [read_bufr()](https://pdbufr.readthedocs.io/en/latest/read_bufr.html) method from [pdbufr](\"https://github.com/ecmwf/pdbufr\").\n",
"BUFR data can be extracted into a Pandas dataframe using :py:meth:`~data.readers.bufr.bufr.BUFRList.to_pandas`, which passes all the arguments to the `read_bufr() <https://pdbufr.readthedocs.io/en/latest/read_bufr.html>`_ method from :xref:`pdbufr`.\n",
"\n",
"The following example shows how the get the temperature profile for a given station. Please note that \"WMO_station_id\" and \"data_datetime\" are generated keys and not present in the BUFR messages themselves."
]
Expand All @@ -978,7 +1017,13 @@
"cell_type": "code",
"execution_count": 7,
"id": "53ac87d6-09b9-46c3-bc54-07fd2a175b05",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -1129,9 +1174,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "mpy38",
"display_name": "dev_ecc",
"language": "python",
"name": "mpy38"
"name": "dev_ecc"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1143,7 +1188,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.17"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 689f521

Please sign in to comment.