Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions opencharts/Download_medium_range_product_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"id": "indian-framing",
"metadata": {},
"source": [
"# Download medium range forecast product in png or pdf format\n",
"In this exmaple we will download an image of a forecast product for a specific valid and base date at a specific geographic area. \n",
"For this we will need to use libraries: \n",
"# Download a medium-range forecast product in PNG or PDF format\n",
"In this example, we will download an image of a forecast product for a specific valid and base date at a specific geographic area. \n",
"For this, we will need to use the following libraries: \n",
"- [requests](https://docs.python-requests.org/en/master/) \n",
"- [json](https://docs.python.org/3/library/json.html)\n",
"- [datetime](https://docs.python.org/3/library/datetime.html) and\n",
Expand All @@ -32,8 +32,8 @@
"id": "downtown-catalyst",
"metadata": {},
"source": [
"## Build link to download\n",
"First thing is to build the link to download from. The base of the link is the same for all the products:"
"## Build a download link\n",
"The first thing is to build a download link. The base of the link is the same for all the products:"
]
},
{
Expand All @@ -58,7 +58,7 @@
"source": [
"The minimum parameter we need to pass is the product. \n",
"\n",
"To find the name of the product we want to download, click on Download link on the [Open Charts product](https://charts.ecmwf.int/products/medium-uv-rh) and then 'More documentation can be found here' will pop up. \n",
"To find the name of the product we want to download, click the Download link on the [Open Charts product](https://charts.ecmwf.int/products/medium-uv-rh). Then, 'More documentation can be found here' will pop up. \n",
"![script_documentation.png](attachment:script_documentation.png)"
]
},
Expand All @@ -72,10 +72,10 @@
"id": "838c73ea",
"metadata": {},
"source": [
"Click on the link to open the Swagger UI documentation. For our example product it will open [this page](https://charts.ecmwf.int/opencharts-api/v1/swagger-ui/?product=medium-uv-rh&package=opencharts). \n",
"Click on the link to open the Swagger UI documentation. For our example product, it will open [this page](https://charts.ecmwf.int/opencharts-api/v1/swagger-ui/?product=medium-uv-rh&package=opencharts). \n",
"\n",
"It will contain the name of the product and all its parameters. \n",
"When you click on GET button, it will look something like this: \n",
"It will contain the product name and all its parameters. \n",
"When you click the GET button, it will look something like this: \n",
"![swagger_map.png](attachment:swagger_map.png)"
]
},
Expand All @@ -94,8 +94,8 @@
"id": "collected-diversity",
"metadata": {},
"source": [
"If we just put that, we will get the latest available forecast at default step (usually 0) at the default area. Not so exciting. \n",
"In the documentation we can see that this product has following parameters: **format**, **base_date**, **valid_date/step**, **projection** and **level** (as we can have this product on different pressure levels). \n",
"If we just put that, we will get the latest available forecast at the default step (usually 0) in the default area. Not so exciting. \n",
"In the documentation, we can see that this product has the following parameters: **format**, **base_date**, **valid_date/step**, **projection** and **level** (as we can have this product on different pressure levels). \n",
"\n",
"Let's set them."
]
Expand Down Expand Up @@ -171,7 +171,7 @@
"id": "included-terrorist",
"metadata": {},
"source": [
"Next we create the full link "
"Next, we create the full link. "
]
},
{
Expand All @@ -198,7 +198,7 @@
"id": "important-holocaust",
"metadata": {},
"source": [
"And download the content and convert to dictionary"
"And download the content and convert to dictionary."
]
},
{
Expand Down Expand Up @@ -332,9 +332,9 @@
"id": "adopted-aspect",
"metadata": {},
"source": [
"## Saving in pdf format\n",
"PNG format is default, which is why we didn't have it in our first version of the link. \n",
"To get the pdf format, all we need to do is to add format parameter and set it to pdf."
"## Saving in PDF format\n",
"PNG format is the default, which is why we didn't have it in our first version of the link. \n",
"To get the PDF format, all we need to do is to add the **format** parameter and set it to \"pdf\"."
]
},
{
Expand Down Expand Up @@ -375,7 +375,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3.13.13-01",
"language": "python",
"name": "python3"
},
Expand All @@ -389,7 +389,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.13.13"
}
},
"nbformat": 4,
Expand Down
26 changes: 13 additions & 13 deletions opencharts/Explore_the_opencharts_API.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"source": [
"# Explore the OpenCharts API\n",
"\n",
"In this notebook you will find out what information can be obtained from the OpenCharts API and the basics on how to download an image.\n",
"In this notebook, you will find out what information can be obtained from the OpenCharts API and the basics of how to download an image.\n",
"\n",
"## List all the available products\n",
"\n",
"The common part of all the links to download open charts in **api_url** variable:"
"The common part of all the links to download Open Charts is the **api_url** variable:"
]
},
{
Expand Down Expand Up @@ -56,7 +56,7 @@
"id": "entertaining-church",
"metadata": {},
"source": [
"Let's download it and print here."
"Let's download and print it here."
]
},
{
Expand All @@ -78,9 +78,9 @@
"id": "material-emerald",
"metadata": {},
"source": [
"This has returned us a big json structure with the definitions of all the products from OpenCharts. \n",
"If you click on the printed link you will get the same structure in the new tab. \n",
"Let's print first 5 elements of the list."
"This has returned a large JSON structure with the definitions of all the products from OpenCharts. \n",
"If you click on the printed link, you will get the same structure in a new tab. \n",
"Let's print the first 5 elements of the list."
]
},
{
Expand Down Expand Up @@ -164,9 +164,9 @@
"source": [
"## Individual products\n",
"\n",
"All previous exploration was on the list of all products. \n",
"The previous exploration was about the list of all products. \n",
"\n",
"However, in order to get the image we need to get the data from the API for the individual product."
"However, to get the image, we need to get the data from the API for the individual product."
]
},
{
Expand Down Expand Up @@ -220,7 +220,7 @@
"id": "theoretical-clarity",
"metadata": {},
"source": [
"We can now see that the link to the png image of the procut is under **data['data']['link']['href']**"
"Now we can see that the link to the PNG image of the product is under **data['data']['link']['href']**"
]
},
{
Expand Down Expand Up @@ -249,7 +249,7 @@
"id": "pretty-thriller",
"metadata": {},
"source": [
"Finally we can see the image in the link using display fucntion."
"Finally, we can see the image in the link using display function."
]
},
{
Expand Down Expand Up @@ -281,13 +281,13 @@
"metadata": {},
"source": [
"This has given us the image of the default time and area for this product. \n",
"Please check the other notebooks in this series to learn how to download products for a particular date and step and for specific area, or how to get the image as pdf file."
"Please check the other notebooks in this series to learn how to download products for a particular date and step and for a specific area, or how to get the image as a PDF file."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3.13.13-01",
"language": "python",
"name": "python3"
},
Expand All @@ -301,7 +301,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.13.13"
}
},
"nbformat": 4,
Expand Down
1,386 changes: 697 additions & 689 deletions opencharts/aifs_ens_cf_medium-2t-dp.ipynb

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions opencharts/aifs_ens_cf_medium-2t-wind.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"id": "bf557ecd",
"metadata": {},
"source": [
"This notebook will provide you guidance how to explore and plot ECMWF AIFS open dataset to produce the map from the ECMWF open charts web product. \n",
"The original product can be found on this link: https://charts.ecmwf.int/products/aifs_ens_cf_medium-2t-wind \n"
"This notebook will provide you with guidance on how to explore and plot the ECMWF AIFS open dataset to produce the map from the ECMWF Open Charts web product. \n",
"The original product can be found at this link: https://charts.ecmwf.int/products/aifs_ens_cf_medium-2t-wind \n"
]
},
{
Expand All @@ -46,13 +46,13 @@
"id": "d455c6bb-c1e6-4292-a1a4-da15be0172bf",
"metadata": {},
"source": [
"The full list of available AIFS Open data products can be found [here](https://www.ecmwf.int/en/forecasts/dataset/aifs-machine-learning-data), and more information can be found in the [User documentation](https://confluence.ecmwf.int/display/DAC/ECMWF+open+data%3A+real-time+forecasts+from+IFS+and+AIFS). \n",
"The full list of available AIFS Open Data products can be found [here](https://www.ecmwf.int/en/forecasts/dataset/aifs-machine-learning-data), and more information can be found in the [User documentation](https://confluence.ecmwf.int/display/DAC/ECMWF+open+data%3A+real-time+forecasts+from+IFS+and+AIFS). \n",
"\n",
"Access to ECMWF AIFS data is governed by the Creative Commons CC-BY-4.0 licence and associated [Terms of Use](https://apps.ecmwf.int/datasets/licences/general/). \n",
"\n",
"<sub> In applying this licence, ECMWF does not waive the privileges and immunities granted to it by virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction </sub>\n",
"\n",
"To find out how to obtain the access to the full forecast dataset [Access page](https://www.ecmwf.int/en/forecasts/accessing-forecasts)."
"To find out how to obtain access to the full forecast dataset at higher resolution, please visit our [Access page](https://www.ecmwf.int/en/forecasts/accessing-forecasts)."
]
},
{
Expand All @@ -61,7 +61,7 @@
"metadata": {},
"source": [
"## Retrieve Data\n",
"This product takes in input 3 parameters :\n",
"This product takes 3 parameters as input:\n",
"\n",
"* [2 metre temperature](https://codes.ecmwf.int/grib/param-db/167)\n",
"* [10 metre U wind component](https://codes.ecmwf.int/grib/param-db/165)\n",
Expand All @@ -83,12 +83,12 @@
"id": "ae3c174b-cad7-4bb9-917d-6933e60e467d",
"metadata": {},
"source": [
"First we need to install them in the current Jupyter kernel: \n",
"First, we need to install them in the current Jupyter kernel: \n",
"<div class=\"alert alert-block alert-info\">\n",
"<b>Note:</b> If you are running the notebook on MyBinder or already have the libraries installed, go directly to importing the libraries.\n",
"</div>\n",
"<div class=\"alert alert-block alert-info\">\n",
"<b>Note:</b> If you don't have these libraries installed, click on three dots below, uncomment the code and run the next two cells.\n",
"<b>Note:</b> If you don't have these libraries installed, click on the three dots below, uncomment the code and run the next two cells.\n",
"</div>"
]
},
Expand Down Expand Up @@ -179,9 +179,9 @@
"id": "3995ea9e-ca91-4799-ba08-4b8c96d5428e",
"metadata": {},
"source": [
"Setting date to 0 will download today's data. \n",
"Removing date and time altogether from the request will download the latest data. \n",
"Try commenting out date and time to download latest forecast!"
"Setting \"date\" to 0 will download today's data. \n",
"Removing \"date\" and \"time\" altogether from the request will download the latest data. \n",
"Try commenting out the date and time to download the latest forecast!"
]
},
{
Expand Down
29 changes: 15 additions & 14 deletions opencharts/aifs_ens_cf_medium-mslp-rain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"id": "72e9854b",
"metadata": {},
"source": [
"This notebook will provide you guidance how to explore and plot ECMWF open dataset to produce the map from the ECMWF open charts web product. \n",
"The original product can be found on this link: https://charts.ecmwf.int/products/aifs_ens_cf_medium-mslp-rain \n"
"This notebook will provide you with guidance on how to explore and plot the ECMWF open dataset to produce the map from the ECMWF Open Charts web product. \n",
"The original product can be found at this link: https://charts.ecmwf.int/products/aifs_ens_cf_medium-mslp-rain \n"
]
},
{
Expand All @@ -45,13 +45,13 @@
"id": "d455c6bb-c1e6-4292-a1a4-da15be0172bf",
"metadata": {},
"source": [
"The full list of available AIFS Open data products can be found [here](https://www.ecmwf.int/en/forecasts/dataset/aifs-machine-learning-data), and more information can be found in the [User documentation](https://confluence.ecmwf.int/display/DAC/ECMWF+open+data%3A+real-time+forecasts+from+IFS+and+AIFS). \n",
"The full list of available AIFS Open Data products can be found [here](https://www.ecmwf.int/en/forecasts/dataset/aifs-machine-learning-data), and more information can be found in the [User documentation](https://confluence.ecmwf.int/display/DAC/ECMWF+open+data%3A+real-time+forecasts+from+IFS+and+AIFS). \n",
"\n",
"Access to ECMWF AIFS data is governed by the Creative Commons CC-BY-4.0 licence and associated [Terms of Use](https://apps.ecmwf.int/datasets/licences/general/). \n",
"\n",
"<sub> In applying this licence, ECMWF does not waive the privileges and immunities granted to it by virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction </sub>\n",
"\n",
"To find out how to obtain the access to the full forecast dataset [Access page](https://www.ecmwf.int/en/forecasts/accessing-forecasts)."
"To find out how to obtain access to the full forecast dataset at higher resolution, please visit our [Access page](https://www.ecmwf.int/en/forecasts/accessing-forecasts)."
]
},
{
Expand All @@ -60,7 +60,7 @@
"metadata": {},
"source": [
"## Retrieve Data\n",
"This product takes in input 2 parameters :\n",
"This product takes 2 parameters as input:\n",
"\n",
"* [Mean sea level pressure](https://codes.ecmwf.int/grib/param-db/151)\n",
"* [Total precipitation](https://codes.ecmwf.int/grib/param-db/228228)\n"
Expand All @@ -81,12 +81,12 @@
"id": "5d84c0eb-32dc-4bb7-83f8-42d9c9a3e448",
"metadata": {},
"source": [
"First we need to install them in the current Jupyter kernel: \n",
"First, we need to install them in the current Jupyter kernel: \n",
"<div class=\"alert alert-block alert-info\">\n",
"<b>Note:</b> If you are running the notebook on MyBinder or already have the libraries installed, go directly to importing the libraries.\n",
"</div>\n",
"<div class=\"alert alert-block alert-info\">\n",
"<b>Note:</b> If you don't have these libraries installed, click on three dots below, uncomment the code and run the next two cells.\n",
"<b>Note:</b> If you don't have these libraries installed, click on the three dots below, uncomment the code and run the next two cells.\n",
"</div>"
]
},
Expand Down Expand Up @@ -177,9 +177,9 @@
"id": "6ccddff1-1622-477c-85fd-94771071a0a0",
"metadata": {},
"source": [
"Setting date to 0 will download today's data. \n",
"Removing date and time altogether from the request will download the latest data. \n",
"Try commenting out date and time to download latest forecast!"
"Setting \"date\" to 0 will download today's data. \n",
"Removing \"date\" and \"time\" altogether from the request will download the latest data. \n",
"Try commenting out the date and time to download the latest forecast!"
]
},
{
Expand Down Expand Up @@ -466,9 +466,10 @@
"source": [
"We can see that we have both parameters at steps 12 and 24. \n",
"\n",
"If we want to plot the total precipitation between steps 12 and 24 UTC, we need the data on both timesteps because total precipitation is parameter that is accumulated from the start of the forecast period. This means that step 12 has all accumulated precipitation from start of the forecast (00UTC) until 12 UTC, step 24 has accumulation from 00 to 24 UTC and so on. \n",
"If we want the precipitation from 12 to 24 we need to deaccumulate it, by simply substracting. \n",
"We will use the **select()** function to filter the total precipitation at different steps."
"As total precipitation is a parameter accumulated from the start of the forecast period, we need data from both time steps to plot total precipitation between 12 and 24 UTC.\n",
"This means that step 12 has all accumulated precipitation from the start of the forecast (00UTC) until 12 UTC, step 24 has accumulation from 00 to 24 UTC and so on. \n",
"If we want the precipitation from 12 to 24, we need to deaccumulate it by simply subtracting. \n",
"We will use the **select()** function to filter the total precipitation at different steps"
]
},
{
Expand Down Expand Up @@ -596,7 +597,7 @@
"id": "eb1abe27-f9c2-4a99-9e34-b5daace76ed8",
"metadata": {},
"source": [
"Mean sea level pressure data has unites Pa, but we want to plot it in hPa, therefore we need to convert it."
"Mean sea level pressure data has units Pa, but we want to plot it in hPa, therefore we need to convert it."
]
},
{
Expand Down
Loading