ヨーロッパの気温トレンドを計算する
ERA5 データセットを使って、1980年から現在までのヨーロッパの平均気温を計算します。このデータは Zarr 形式で、月平均の気温と降水量が緯度・経度のグリッド上に格納されています。Zarr ファイルはチャンク分割されており、ディスク上の各サブファイルは、緯度15、経度15、月12の配列になっています。
xarray は xr としてインポート済みです。
この演習はコースの一部です
Pythonで学ぶDaskによる並列プログラミング
演習の手順
xarrayを使って"data/era_eu.zarr"データセットを開きます。tempDataArray のlatとlon次元に沿って平均を計算します。time次元に対してウィンドウサイズ 12 の移動平均を適用します。- 得られた
temp_rolling_meanの時系列をプロットします。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Open the ERA5 dataset
ds = ____
# Select the temperature dataset and take the latitude and longitude mean
temp_timeseries = ds[____].____
# Calculate the 12 month rolling mean
temp_rolling_mean = temp_timeseries.____(____).____()
# Plot the result
____
plt.show()