Skip to content
Open
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
2 changes: 1 addition & 1 deletion notebooks/02-introduction-geospatial-data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@
"source": [
"A plot with just some points can be hard to interpret without any spatial context. We have seen that we can use the `explore()` method to easily get an interactive figure that by default includes a background map. But also for the static matplotlib-based plot, it can be useful to add such a base map, and that's what we will learn in the next excercise.\n",
"\n",
"We are going to make use of the [contextily](https://github.com/darribas/contextily) package. The `add_basemap()` function of this package makes it easy to add a background web map to our plot. We begin by plotting our data first, and then pass the matplotlib axes object (returned by dataframe's `plot()` method) to the `add_basemap()` function. `contextily` will then download the web tiles needed for the geographical extent of your plot.\n",
"We are going to make use of the [contextily](https://contextily.readthedocs.io/en/latest/index.html) package. The `add_basemap()` function of this package makes it easy to add a background web map to our plot. We begin by plotting our data first, and then pass the matplotlib axes object (returned by dataframe's `plot()` method) to the `add_basemap()` function. `contextily` will then download the web tiles needed for the geographical extent of your plot.\n",
"\n",
"\n",
"<div class=\"alert alert-success\">\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/02-introduction-geospatial-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ stations.plot(figsize=(12,6)) # or .explore()

A plot with just some points can be hard to interpret without any spatial context. We have seen that we can use the `explore()` method to easily get an interactive figure that by default includes a background map. But also for the static matplotlib-based plot, it can be useful to add such a base map, and that's what we will learn in the next excercise.

We are going to make use of the [contextily](https://github.com/darribas/contextily) package. The `add_basemap()` function of this package makes it easy to add a background web map to our plot. We begin by plotting our data first, and then pass the matplotlib axes object (returned by dataframe's `plot()` method) to the `add_basemap()` function. `contextily` will then download the web tiles needed for the geographical extent of your plot.
We are going to make use of the [contextily](https://contextily.readthedocs.io/en/latest/index.html) package. The `add_basemap()` function of this package makes it easy to add a background web map to our plot. We begin by plotting our data first, and then pass the matplotlib axes object (returned by dataframe's `plot()` method) to the `add_basemap()` function. `contextily` will then download the web tiles needed for the geographical extent of your plot.


<div class="alert alert-success">
Expand Down
4 changes: 2 additions & 2 deletions notebooks/04-spatial-relationships-joins.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@
"The location of the Eiffel Tower is: x of 648237.3 and y of 6862271.9\n",
"\n",
"* Create a Shapely point object with the coordinates of the Eiffel Tower and assign it to a variable called `eiffel_tower`. Print the result.\n",
"* Check if the Eiffel Tower is located within the Montparnasse district (provided).\n",
"* Check if the Montparnasse district contains the bike station location.\n",
"* Check if the Eiffel Tower is located within the Montparnasse district (_code to get the Polygon for Montparnasse is provided_).\n",
"* Check if the Montparnasse district contains the selected bike station location (_code to get the Point for the bike station is provided_).\n",
"* Calculate the distance between the Eiffel Tower and the bike station (note: in this case, the distance is returned in meters).\n",
"\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions notebooks/04-spatial-relationships-joins.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ The Eiffel Tower is an iron lattice tower built in the 19th century, and is prob
The location of the Eiffel Tower is: x of 648237.3 and y of 6862271.9

* Create a Shapely point object with the coordinates of the Eiffel Tower and assign it to a variable called `eiffel_tower`. Print the result.
* Check if the Eiffel Tower is located within the Montparnasse district (provided).
* Check if the Montparnasse district contains the bike station location.
* Check if the Eiffel Tower is located within the Montparnasse district (_code to get the Polygon for Montparnasse is provided_).
* Check if the Montparnasse district contains the selected bike station location (_code to get the Point for the bike station is provided_).
* Calculate the distance between the Eiffel Tower and the bike station (note: in this case, the distance is returned in meters).


Expand Down
8 changes: 4 additions & 4 deletions notebooks/12-xarray-advanced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1117,9 +1117,9 @@
"\n",
"**EXERCISE**:\n",
"\n",
"Select the pressure data for the pixel closest to the center of Ghent (lat: -51.05, lon: 3.71) and assign the outcome to a new variable `ghent_pressure`.\n",
"Select the pressure data for the pixel closest to the center of Ghent (lat: 51.05, lon: 3.71) and assign the outcome to a new variable `ghent_pressure`.\n",
"\n",
"Define a Matplotlib `Figure` and `Axes` (respectively named `fig, ax`) and use it to create a plot that combines the yearly average of the pressure data in Gent with the monthly pressure data as function of time for that same pixel as line plots. Change the name of the y-label to `'Pressure (Pa)'` and the title of the plot to `'Pressure (Pa) in Ghent (at -51.05, 3.71)'` (see notebook [visualization-01-matplotlib.ipynb](./visualization-01-matplotlib.ipynb#An-small-cheat-sheet-reference-for-some-common-elements) for more information)\n",
"Define a Matplotlib `Figure` and `Axes` (respectively named `fig, ax`) and use it to create a plot that combines the yearly average of the pressure data in Gent with the monthly pressure data as function of time for that same pixel as line plots. Change the name of the y-label to `'Pressure (Pa)'` and the title of the plot to `'Pressure (Pa) in Ghent (at 51.05, 3.71)'` (see notebook [visualization-01-matplotlib.ipynb](./visualization-01-matplotlib.ipynb#An-small-cheat-sheet-reference-for-some-common-elements) for more information)\n",
"\n",
"<details><summary>Hints</summary>\n",
" \n",
Expand Down Expand Up @@ -1149,7 +1149,7 @@
"ghent_pressure.resample(time=\"YE\").mean().plot.line(ax=ax)\n",
"\n",
"ax.set_ylabel('Pressure (Pa)')\n",
"ax.set_title('Pressure (Pa) in Ghent (-51.05, 3.71)')"
"ax.set_title('Pressure (Pa) in Ghent (51.05, 3.71)')"
]
},
{
Expand All @@ -1161,7 +1161,7 @@
"\n",
"**EXERCISE**:\n",
" \n",
"Select the precipitation data for the pixel closest to the center of Ghent (lat: -51.05, lon: 3.71) and assign the outcome to a new variable `ghent_precipitation`.\n",
"Select the precipitation data for the pixel closest to the center of Ghent (lat: 51.05, lon: 3.71) and assign the outcome to a new variable `ghent_precipitation`.\n",
" \n",
"For the Ghent pixel, calculate the maximal precipitation _for each month of the year_ (1 -> 12) and convert it to mm precipitation.\n",
" \n",
Expand Down
8 changes: 4 additions & 4 deletions notebooks/12-xarray-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,9 @@ era5_renamed = era5.rename(mapping)

**EXERCISE**:

Select the pressure data for the pixel closest to the center of Ghent (lat: -51.05, lon: 3.71) and assign the outcome to a new variable `ghent_pressure`.
Select the pressure data for the pixel closest to the center of Ghent (lat: 51.05, lon: 3.71) and assign the outcome to a new variable `ghent_pressure`.

Define a Matplotlib `Figure` and `Axes` (respectively named `fig, ax`) and use it to create a plot that combines the yearly average of the pressure data in Gent with the monthly pressure data as function of time for that same pixel as line plots. Change the name of the y-label to `'Pressure (Pa)'` and the title of the plot to `'Pressure (Pa) in Ghent (at -51.05, 3.71)'` (see notebook [visualization-01-matplotlib.ipynb](./visualization-01-matplotlib.ipynb#An-small-cheat-sheet-reference-for-some-common-elements) for more information)
Define a Matplotlib `Figure` and `Axes` (respectively named `fig, ax`) and use it to create a plot that combines the yearly average of the pressure data in Gent with the monthly pressure data as function of time for that same pixel as line plots. Change the name of the y-label to `'Pressure (Pa)'` and the title of the plot to `'Pressure (Pa) in Ghent (at 51.05, 3.71)'` (see notebook [visualization-01-matplotlib.ipynb](./visualization-01-matplotlib.ipynb#An-small-cheat-sheet-reference-for-some-common-elements) for more information)

<details><summary>Hints</summary>

Expand All @@ -555,14 +555,14 @@ ghent_pressure.plot.line(ax=ax)
ghent_pressure.resample(time="YE").mean().plot.line(ax=ax)

ax.set_ylabel('Pressure (Pa)')
ax.set_title('Pressure (Pa) in Ghent (-51.05, 3.71)')
ax.set_title('Pressure (Pa) in Ghent (51.05, 3.71)')
```

<div class="alert alert-success">

**EXERCISE**:

Select the precipitation data for the pixel closest to the center of Ghent (lat: -51.05, lon: 3.71) and assign the outcome to a new variable `ghent_precipitation`.
Select the precipitation data for the pixel closest to the center of Ghent (lat: 51.05, lon: 3.71) and assign the outcome to a new variable `ghent_precipitation`.

For the Ghent pixel, calculate the maximal precipitation _for each month of the year_ (1 -> 12) and convert it to mm precipitation.

Expand Down
6 changes: 3 additions & 3 deletions notebooks/case-sea-surface-temperature.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"<summary>Hints</summary>\n",
" \n",
"- The number of elements or `size` of an array is an attribute of an xarray.DataArray and not of a xarray.Dataset\n",
"- Also the `shape` of an array is an attribute of an xarray.DataArray. A xarray.Dataset has the `dims` attribute to query dimension sizes\n",
"- Also the `shape` of an array is an attribute of an xarray.DataArray. A xarray.Dataset or DataArray has the `sizes` attribute to query dimension sizes\n",
"\n",
"</details> \n",
" \n",
Expand Down Expand Up @@ -190,8 +190,8 @@
},
"outputs": [],
"source": [
"# dims attribute of dataset object\n",
"ds.dims"
"# sizes attribute of dataset object\n",
"ds.sizes"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions notebooks/case-sea-surface-temperature.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The data contains a single data variable `sst` and has 3 dimensions: lon, lat an
<summary>Hints</summary>

- The number of elements or `size` of an array is an attribute of an xarray.DataArray and not of a xarray.Dataset
- Also the `shape` of an array is an attribute of an xarray.DataArray. A xarray.Dataset has the `dims` attribute to query dimension sizes
- Also the `shape` of an array is an attribute of an xarray.DataArray. A xarray.Dataset or DataArray has the `sizes` attribute to query dimension sizes

</details>

Expand All @@ -113,8 +113,8 @@ ds["sst"].shape
```{code-cell} ipython3
:tags: [nbtutor-solution]

# dims attribute of dataset object
ds.dims
# sizes attribute of dataset object
ds.sizes
```

```{code-cell} ipython3
Expand Down