Skip to content

Commit efaa1c1

Browse files
authored
Update plotting notebooks (xarray-contrib#107)
1 parent bcc9045 commit efaa1c1

File tree

4 files changed

+3
-723
lines changed

4 files changed

+3
-723
lines changed

fundamentals/04.1_basic_plotting.ipynb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@
4646
"metadata": {},
4747
"outputs": [],
4848
"source": [
49-
"ds = xr.tutorial.open_dataset(\"air_temperature.nc\").rename({\"air\": \"Tair\"})\n",
50-
"\n",
51-
"# we will add a gradient field with appropriate attributes\n",
52-
"ds[\"dTdx\"] = ds.Tair.differentiate(\"lon\") / 110e3 / np.cos(ds.lat * np.pi / 180)\n",
53-
"ds[\"dTdy\"] = ds.Tair.differentiate(\"lat\") / 105e3\n",
54-
"ds.dTdx.attrs = {\"long_name\": \"$∂T/∂x$\", \"units\": \"°C/m\"}\n",
55-
"ds.dTdy.attrs = {\"long_name\": \"$∂T/∂y$\", \"units\": \"°C/m\"}\n",
56-
"\n",
49+
"ds = xr.tutorial.open_dataset(\"air_temperature_gradient\")\n",
5750
"ds"
5851
]
5952
},

fundamentals/04.2_faceting.ipynb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,7 @@
4040
"metadata": {},
4141
"outputs": [],
4242
"source": [
43-
"ds = xr.tutorial.open_dataset(\"air_temperature.nc\").rename({\"air\": \"Tair\"})\n",
44-
"\n",
45-
"# we will add a gradient field with appropriate attributes\n",
46-
"ds[\"dTdx\"] = ds.Tair.differentiate(\"lon\") / 110e3 / np.cos(ds.lat * np.pi / 180)\n",
47-
"ds[\"dTdy\"] = ds.Tair.differentiate(\"lat\") / 105e3\n",
48-
"ds.dTdx.attrs = {\"long_name\": \"$∂T/∂x$\", \"units\": \"°C/m\"}\n",
49-
"ds.dTdy.attrs = {\"long_name\": \"$∂T/∂y$\", \"units\": \"°C/m\"}\n",
50-
"\n",
43+
"ds = xr.tutorial.open_dataset(\"air_temperature_gradient\")\n",
5144
"monthly_means = ds.groupby(\"time.month\").mean()\n",
5245
"# xarray's groupby reductions drop attributes. Let's assign them back so we get nice labels.\n",
5346
"monthly_means.Tair.attrs = ds.Tair.attrs"

fundamentals/04.3_geographic_plotting.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"metadata": {},
4242
"outputs": [],
4343
"source": [
44-
"ds = xr.tutorial.open_dataset(\"air_temperature.nc\").rename({\"air\": \"Tair\"})\n",
44+
"ds = xr.tutorial.open_dataset(\"air_temperature_gradient\")\n",
4545
"monthly_means = ds.groupby(\"time.month\").mean()\n",
4646
"# xarray's groupby reductions drop attributes. Let's assign them back so we get nice labels.\n",
4747
"monthly_means.Tair.attrs = ds.Tair.attrs"

0 commit comments

Comments
 (0)