Welcome to unseen_open’s documentation!

An open, reproducible and transferable workflow to assess and anticipate climate extremes beyond the observed record.

UNSEEN-open is an open source project using the global SEAS5 and ERA5 datasets. It makes evaluation of model simulations and extreme value analysis easy in order to anticipate climate extremes beyond the observed record. The project is developed as part of the ECMWF summer of weather code 2020 (esowc), which is funded by Copernicus.

UNSEEN-open relies on xarray for data preprocessing and uses ggplot and extRemes for the extreme value analysis. The extreme value utilities are being developed into an UNSEEN Rpackage.

Applications

In our recent NPJ Climate and Atmospheric Science paper we outline four potential applications where we believe UNSEEN might prove to be useful:

  1. Help estimate design values, especially relevant for data scarce regions

  2. Improve risk estimation of natural hazards by coupling UNSEEN to impact models

  3. Detect trends in rare climate extremes

  4. Increase our physical understanding of the drivers of (non-stationarity of) climate extremes

We hope this approach may see many applications across a range of scientific fields!

What is UNSEEN?

The UNprecedented Simulated Extreme ENsemble (UNSEEN, Thompson et al., 2017) approach is an increasingly popular method that exploits seasonal prediction systems to assess and anticipate climate extremes beyond the observed record. The approach uses pooled forecasts as plausible alternate realities. Instead of the ‘single realization’ of reality, pooled forecasts can be exploited to better assess the likelihood of infrequent events, which only have a limited chance of occurring in observed records. This method has for example been used to improve design levels of storm-surges in the river Rhine and to anticipate and understand heatwaves in China.

Recently, we applied this method to SEAS5 for the first time, with promising results for extreme precipitation over Norway and Svalbard (submitted to *NPJ Climate and Atmospheric Science*). SEAS5 is a good dataset for the UNSEEN approach because it is freely available and has a high resolution and a large ensemble compared to global climate models. To make this approach more accessible, we develop an open, reproducible and transferable workflow for the UNSEEN method using the open access SEAS5 dataset on the CDS.

UNSEEN-open

In this project, the aim is to build an open, reproducible, and transferable workflow for UNSEEN.

This means that anyone can assess any climate extreme event anywhere in the world!

The workflow consists of four steps, as illustrated below:

title

Overview

Here we provide an overview of the steps in UNSEEN-open.

Retrieve

We use global open Copernicus C3S data: the seasonal prediction system SEAS5 and the reanlysis ERA5.

The functions to retrieve all forecasts (SEAS5) and reanalysis (ERA5) are retrieve_SEAS5 and retrieve_ERA5. You can select the climate variable, the target month(s) and the area - for more explanation see retrieve.

[2]:
retrieve.retrieve_SEAS5(
    variables=['2m_temperature', '2m_dewpoint_temperature'],
    target_months=[3, 4, 5],
    area=[70, -11, 30, 120],
    years=np.arange(1981, 2021),
    folder='../Siberia_example/SEAS5/')
[3]:
retrieve.retrieve_ERA5(variables=['2m_temperature', '2m_dewpoint_temperature'],
                       target_months=[3, 4, 5],
                       area=[70, -11, 30, 120],
                       folder='../Siberia_example/ERA5/')
Preprocess

In the preprocessing step, we first merge all downloaded files into one netcdf file. Then the rest of the preprocessing depends on the definition of the extreme event. For example, for the UK case study, we want to extract the UK average precipitation while for the Siberian heatwave we will just used the defined area to spatially average over. For the MAM season, we still need to take the seasonal average, while for the UK we already have the average February precipitation.

Read the docs on preprocessing for more info.

Evaluate

The evaluation step is important to assess whether the forecasts are realistic and consistent to the observations. There are three statistical tests available through the UNSEEN R package. See the evaluation section and also this paper for more info.

Illustrate

So what can we learn from UNSEEN-open?

In this section we apply extreme value theory to illustrate the applications. Have a look at the examples!

Examples

In this project, UNSEEN-open is applied to assess two extreme events in 2020: February 2020 UK precipitation and the 2020 Siberian heatwave.

Launch in Binder Binder

Siberian Heatwave

The 2020 Siberian heatwave was a prolonged event that consistently broke monthly temperature the records. We show a gif of the temperature rank within the observations from 1979-2020, see this section for details. - Rank 1 mean highest on record - Rank 2 means second highest - etc..

Siberian Temperature records 2020

This attribution study by World Weather Attribution (WWA) has shown that the event was made much more likely (600x) because of human induced climate change but also that the event was a very rare event within our present climate.

Could such an event be anticipated with UNSEEN?

With UNSEEN-open, we can assess whether extreme events like the Siberian heatwave have been forecasted already, i.e. whether we can anticipate such an event by exploiting all forecasts over the domain.

Retrieve data

The main functions to retrieve all forecasts (SEAS5) and reanalysis (ERA5) are retrieve_SEAS5 and retrieve_ERA5. We want to download 2m temperature, for the March-May target months over the Siberian domain. By default, the hindcast years of 1981-2016 are downloaded for SEAS5. We include the years 1981-2020. The folder indicates where the files will be stored, in this case outside of the UNSEEN-open repository, in a ‘Siberia_example’ directory. For more explanation, see retrieve.

[ ]:
retrieve.retrieve_SEAS5(
    variables=['2m_temperature', '2m_dewpoint_temperature'],
    target_months=[3, 4, 5],
    area=[70, -11, 30, 120],
    years=np.arange(1981, 2021),
    folder='../Siberia_example/SEAS5/')
[ ]:
retrieve.retrieve_ERA5(variables=['2m_temperature', '2m_dewpoint_temperature'],
                       target_months=[3, 4, 5],
                       area=[70, -11, 30, 120],
                       folder='../Siberia_example/ERA5/')
Preprocess

In the preprocessing step, we first merge all downloaded files into one xarray dataset, then take the spatial average over the domain and a temporal average over the MAM season. Read the docs on preprocessing for more info.

[ ]:
SEAS5_Siberia = preprocess.merge_SEAS5(folder = '../Siberia_example/SEAS5/', target_months = [3,4,5])

And for ERA5:

[ ]:
ERA5_Siberia = xr.open_mfdataset('../Siberia_example/ERA5/ERA5_????.nc',combine='by_coords')

Then we calculate the day-in-month weighted seasonal average:

[ ]:
SEAS5_Siberia_weighted = preprocess.season_mean(SEAS5_Siberia, years = 39)
ERA5_Siberia_weighted = preprocess.season_mean(ERA5_Siberia, years = 42)

And we select the 2m temperature, and take the average over a further specified domain. This is a simple average, an area-weighed average is more appropriate, since grid cell area decreases with latitude, see preprocess.

[ ]:
SEAS5_Siberia_events_zoomed = (
    SEAS5_Siberia_weighted['t2m'].sel(
        latitude=slice(70, 50),
        longitude=slice(65, 120)).
    mean(['longitude', 'latitude']))

SEAS5_Siberia_events_zoomed_df = SEAS5_Siberia_events_zoomed.to_dataframe()
[ ]:
ERA5_Siberia_events_zoomed = (
    ERA5_Siberia_weighted['t2m'].sel(  # Select 2 metre temperature
        latitude=slice(70, 50),        # Select the latitudes
        longitude=slice(65, 120)).    # Select the longitude
    mean(['longitude', 'latitude']))

ERA5_Siberia_events_zoomed_df = ERA5_Siberia_events_zoomed.to_dataframe()
Evaluate

Note

From here onward we use R and not python!

We switch to R since we believe R has a better functionality in extreme value statistics.

Is the UNSEEN ensemble realistic?

To answer this question, we perform three statistical tests: independence, model stability and model fidelity tests.
These statistical tests are available through the UNSEEN R package. See evaluation for more info.
[12]:
require(UNSEEN)
require(ggplot2)
Loading required package: ggplot2

Timeseries

We plot the timeseries of SEAS5 (UNSEEN) and ERA5 (OBS) for the the Siberian Heatwave.

[13]:
timeseries = unseen_timeseries(
    ensemble = SEAS5_Siberia_events_zoomed_df,
    obs = ERA5_Siberia_events_zoomed,
    ensemble_yname = "t2m",
    ensemble_xname = "year",
    obs_yname = "t2m",
    obs_xname = "year",
    ylab = "MAM Siberian temperature (C)")

timeseries

# ggsave(timeseries, height = 5, width = 6,   filename = "graphs/Siberia_timeseries.png")
Warning message:
"Removed 2756 rows containing non-finite values (stat_boxplot)."
Warning message:
"Removed 2756 rows containing non-finite values (stat_boxplot)."
_images/Notebooks_examples_Siberian_Heatwave_24_1.png

The timeseries consist of hindcast (years 1982-2016) and archived forecasts (years 2017-2020). The datasets are slightly different: the hindcasts contains 25 members whereas operational forecasts contain 51 members, the native resolution is different and the dataset from which the forecasts are initialized is different.

For the evaluation of the UNSEEN ensemble we want to only use the SEAS5 hindcasts for a consistent dataset. Note, 2017 is not used in either the hindcast nor the operational dataset, since it contains forecasts both initialized in 2016 (hindcast) and 2017 (forecast), see retrieve. We split SEAS5 into hindcast and operational forecasts:

[5]:
SEAS5_Siberia_events_zoomed_hindcast <- SEAS5_Siberia_events_zoomed_df[
    SEAS5_Siberia_events_zoomed_df$year < 2017 &
    SEAS5_Siberia_events_zoomed_df$number < 25,]

SEAS5_Siberia_events_zoomed_forecasts <- SEAS5_Siberia_events_zoomed_df[
    SEAS5_Siberia_events_zoomed_df$year > 2017,]

And we select the same years for ERA5.

[6]:
ERA5_Siberia_events_zoomed_hindcast <- ERA5_Siberia_events_zoomed[
    ERA5_Siberia_events_zoomed$year < 2017 &
    ERA5_Siberia_events_zoomed$year > 1981,]

Which results in the following timeseries:

[7]:
unseen_timeseries(
    ensemble = SEAS5_Siberia_events_zoomed_hindcast,
    obs = ERA5_Siberia_events_zoomed_hindcast,
    ensemble_yname = "t2m",
    ensemble_xname = "year",
    obs_yname = "t2m",
    obs_xname = "year",
    ylab = "MAM Siberian temperature (C)")
_images/Notebooks_examples_Siberian_Heatwave_30_0.png
Evaluation tests

With the hindcast dataset we evaluate the independence, stability and fidelity. Here, we plot the results for the fidelity test, for more detail on the other tests see the evaluation section.

The fidelity test shows us how consistent the model simulations of UNSEEN (SEAS5) are with the observed (ERA5). The UNSEEN dataset is much larger than the observed – hence they cannot simply be compared. For example, what if we had faced a few more or a few less heatwaves purely by chance?

This would influence the observed mean, but not so much influence the UNSEEN ensemble because of the large data sample. Therefore we express the UNSEEN ensemble as a range of plausible means, for data samples of the same length as the observed. We do the same for higher order statistical moments.

[15]:
Eval = fidelity_test(
    obs = ERA5_Siberia_events_zoomed_hindcast$t2m,
    ensemble = SEAS5_Siberia_events_zoomed_hindcast$t2m,
    units = 'C',
    biascor = FALSE,
    fontsize = 14
)


Eval
ggsave(Eval, filename = "graphs/Siberia_fidelity.png")
Saving 6.67 x 6.67 in image

_images/Notebooks_examples_Siberian_Heatwave_32_1.png

The fidelity test shows that the mean of the UNSEEN ensemble is too low compared to the observed – the blue line falls outside of the model range in a. To correct for this low bias, we can apply an additive bias correction, which only corrects the mean of the simulations.

Lets apply the additive biascor:

[9]:
obs = ERA5_Siberia_events_zoomed_hindcast$t2m
ensemble = SEAS5_Siberia_events_zoomed_hindcast$t2m
ensemble_biascor = ensemble + (mean(obs) - mean(ensemble))

fidelity_test(
    obs = obs,
    ensemble = ensemble_biascor,
    units = 'C',
    biascor = FALSE
)
_images/Notebooks_examples_Siberian_Heatwave_34_0.png

This shows us what we expected: the mean bias is corrected because the model simulations are shifted up (the blue line is still the same, the axis has just shifted along with the histogram), but the other statistical moments are the same.

Illustrate
[10]:
source('src/evt_plot.r')
Loading required package: Lmoments

Loading required package: distillery


Attaching package: 'extRemes'


The following objects are masked from 'package:stats':

    qqnorm, qqplot


First, we fit a Gumbel and a GEV distribution (including shape parameter) to the observed extremes. The Gumbel distribution best describes the data because the p-value of 0.65 is much above 0.05 (based on the likelihood ratio test).

[11]:
fit_obs_Gumbel <- fevd(x = ERA5_Siberia_events_zoomed_hindcast$t2m,
                    type = "Gumbel"
                   )
fit_obs_GEV <- fevd(x = ERA5_Siberia_events_zoomed_hindcast$t2m,
                    type = "GEV"
                   )
lr.test(fit_obs_Gumbel, fit_obs_GEV)

        Likelihood-ratio Test

data:  ERA5_Siberia_events_zoomed_hindcast$t2mERA5_Siberia_events_zoomed_hindcast$t2m
Likelihood-ratio = 0.21004, chi-square critical value = 3.8415, alpha =
0.0500, Degrees of Freedom = 1.0000, p-value = 0.6467
alternative hypothesis: greater

We show the gumbel plot for the observed (ERA5) and UNSEEN (SEAS5 hindcast data). This shows that the UNSEEN simulations are not within the uncertainty range of the observations. This has likely two reasons, illustrated in the evaluation section: there is some dependence between the events and there is too little variability within the UNSEEN ensemble.

[12]:
options(repr.plot.width = 12)
GEV_hindcast <- EVT_plot(ensemble = SEAS5_Siberia_events_zoomed_hindcast$t2m,
                         obs = ERA5_Siberia_events_zoomed_hindcast$t2m,
                         main = "Gumbel fit",
                         GEV_type = "Gumbel",
                         ylim = 3,
                         y_lab = 'MAM Siberian temperature (C)'
                        )
GEV_hindcast_corrected <- EVT_plot(ensemble = ensemble_biascor, #SEAS5_Siberia_events_zoomed_hindcast$t2m,
                                   obs = ERA5_Siberia_events_zoomed_hindcast$t2m,
                                   main = "Additive correction",
                                   GEV_type = "Gumbel",
                                   ylim = 3,
                                   y_lab = 'MAM Siberian temperature (C)'
                                  )

ggarrange(GEV_hindcast, GEV_hindcast_corrected,
  labels = c("a", "b"), # ,"c","d"),
  common.legend = T,
  font.label = list(size = 10, color = "black", face = "bold", family = NULL),
  ncol = 2, nrow = 1
)
_images/Notebooks_examples_Siberian_Heatwave_41_0.png

So what can we get out of it? What if we look at the operational forecast? Even if we cannot use the dataset as a whole to estimate the likelihood of occurrence, have events similar to the 2020 event occurred?

We select 2018-2020 archived SEAS5 forecasts as UNSEEN events, check out the timeseries section for more info on the difference between the hindcast data and the archived forecasts. We furthermore select all ERA5 (observed) events except for the 2020 event as reference to estimate the likelihood of the 2020 event.

[13]:
ERA5_Siberia_events_zoomed_min1 <- ERA5_Siberia_events_zoomed[1:length(ERA5_Siberia_events_zoomed$t2m)-1,]
ERA5_Siberia_events_zoomed_2020 <- ERA5_Siberia_events_zoomed[length(ERA5_Siberia_events_zoomed$t2m),]
[14]:
GEV_forecasts <- EVT_plot(ensemble = SEAS5_Siberia_events_zoomed_forecasts$t2m,
                          obs = ERA5_Siberia_events_zoomed$t2m,
                          main = "",
                          GEV_type = "Gumbel",
                          ylim = 3,
                          y_lab = 'MAM Siberian temperature (C)'
                         ) # %>%
GEV_forecasts + geom_hline(yintercept = ERA5_Siberia_events_zoomed_2020$t2m)
_images/Notebooks_examples_Siberian_Heatwave_44_0.png

Applications:

Prolonged heat events with an average temperature above 0 degrees over Siberia can have enormous impacts on the local environment, such as wildfires, invasion of pests and infrastructure failure, and on the global environment, through the release of greenhouse gasses during permafrost thawing.

With UNSEEN-open, we can: 1. Assess the drivers of the most severe events. The 2020 event seemed to be caused by a very anomalous Indian Ocean Dipole (IOD). What can we learn from the highest UNSEEN events? To what extent are these also driven by an anomalous IOD or are there other drivers of such severe heat events? 2. Perform nonstationary analysis in rare extremes, such as the 100-year event. There seems to be a trend over the hindcast period in the severe heatwaves. We can perform non-stationary analysis to estimate the change in the magnitude and frequency of the heatwaves and, if we find a change, we could explore the drivers of this change. 3. Evaluate forecasts. Since we are using seasonal forecasts in this setup, we could explore the forecast skill in simulating heatwaves over Siberia.

Launch in Binder Binder

California fires

In August 2020 in California, wildfires have burned more than a million acres of land. This years’ fire season was also unique in the number of houses destroyed.

Here we retrieve average august temperatures over California within ERA5 1979-2020 and show anomalous August 2020 was. California Temperature August 2020

We furthermore create an UNSEEN ensemble and show that these kind of fire seasons can be expected to occur more often in our present climate since we find a clear trend in temperature extremes over the last decades.

Retrieve data

The main functions to retrieve all forecasts (SEAS5) and reanalysis (ERA5) are retrieve_SEAS5 and retrieve_ERA5. We want to download 2m temperature for August over California. By default, the hindcast years of 1981-2016 are downloaded for SEAS5. We include the years 1981-2020. The folder indicates where the files will be stored, in this case outside of the UNSEEN-open repository, in a ‘California_example’ directory. For more explanation, see retrieve.

[1]:
import os
import sys
sys.path.insert(0, os.path.abspath('../../../'))
os.chdir(os.path.abspath('../../../'))

import src.cdsretrieve as retrieve
import src.preprocess as preprocess

import numpy as np
import xarray as xr
[2]:
retrieve.retrieve_SEAS5(
    variables=['2m_temperature', '2m_dewpoint_temperature'],
    target_months=[8],
    area=[70, -130, 20, -70],
    years=np.arange(1981, 2021),
    folder='E:/PhD/California_example/SEAS5/')
[3]:
retrieve.retrieve_ERA5(variables=['2m_temperature', '2m_dewpoint_temperature'],
                       target_months=[8],
                       area=[70, -130, 20, -70],
                       folder='E:/PhD/California_example/ERA5/')
Preprocess

In the preprocessing step, we first merge all downloaded files into one xarray dataset, then take the spatial average over the domain and a temporal average over the MAM season. Read the docs on preprocessing for more info.

[4]:
SEAS5_California = preprocess.merge_SEAS5(folder ='E:/PhD/California_example/SEAS5/', target_months = [8])
Lead time: 07
6
5
4
3

And for ERA5:

[5]:
ERA5_California = xr.open_mfdataset('E:/PhD/California_example/ERA5/ERA5_????.nc',combine='by_coords')

We calculate the standardized anomaly of the 2020 event and select the 2m temperature over the region where 2 standard deviations from the 1979-2010 average was exceeded. This is a simple average, an area-weighed average is more appropriate, since grid cell area decreases with latitude, see preprocess.

[6]:
ERA5_anomaly = ERA5_California['t2m'] - ERA5_California['t2m'].sel(time=slice('1979','2010')).mean('time')
ERA5_sd_anomaly = ERA5_anomaly / ERA5_California['t2m'].std('time')
[7]:
ERA5_California_events = (
    ERA5_California['t2m'].sel(  # Select 2 metre temperature
        longitude = slice(-125,-100),    # Select the longitude
        latitude = slice(45,20)).        # And the latitude
    where(ERA5_sd_anomaly.sel(time = '2020').squeeze('time') > 2). ##Mask the region where 2020 sd >2.
    mean(['longitude', 'latitude'])) #And take the mean

Plot the August temperatures over the defined California domain:

[8]:
ERA5_California_events.plot()
[8]:
[<matplotlib.lines.Line2D at 0x1dc77e84910>]
_images/Notebooks_examples_California_Fires_17_1.png

Select the same domain for SEAS5 and extract the events.

[9]:
SEAS5_California_events = (
    SEAS5_California['t2m'].sel(
        longitude = slice(-125,-100),    # Select the longitude
        latitude = slice(45,20)).
    where(ERA5_sd_anomaly.sel(time = '2020').squeeze('time') > 2).
    mean(['longitude', 'latitude']))

And here we store the data in the Data section so the rest of the analysis in R can be reproduced.

[10]:
SEAS5_California_events.to_dataframe().to_csv('Data/SEAS5_California_events.csv')
ERA5_California_events.to_dataframe().to_csv('Data/ERA5_California_events.csv')
C:\anaconda3\envs\unseen\lib\site-packages\dask\array\numpy_compat.py:41: RuntimeWarning: invalid value encountered in true_divide
  x = np.divide(x1, x2, out)
Evaluate

Note

From here onward we use R and not python!

We switch to R since we believe R has a better functionality in extreme value statistics.

Is the UNSEEN ensemble realistic?

To answer this question, we perform three statistical tests: independence, model stability and model fidelity tests.
These statistical tests are available through the UNSEEN R package. See evaluation for more info.
[2]:
require(UNSEEN)
Loading required package: UNSEEN

Timeseries

We plot the timeseries of SEAS5 (UNSEEN) and ERA5 (OBS) for the the Siberian Heatwave.

[3]:
timeseries = unseen_timeseries(
    ensemble = SEAS5_California_events,
    obs = ERA5_California_events,
    ensemble_yname = "t2m",
    ensemble_xname = "time",
    obs_yname = "t2m",
    obs_xname = "time",
    ylab = "August California temperature (C)")


timeseries

ggsave(timeseries, height = 5, width = 6,   filename = "graphs/Calif_timeseries.png")

Warning message:
"Removed 4680 rows containing non-finite values (stat_boxplot)."
Error in ggsave(timeseries, height = 5, width = 6, filename = "graphs/Calif_timeseries.png"): could not find function "ggsave"
Traceback:

_images/Notebooks_examples_California_Fires_29_2.png

The timeseries consist of hindcast (years 1982-2016) and archived forecasts (years 2017-2020). The datasets are slightly different: the hindcasts contains 25 members whereas operational forecasts contain 51 members, the native resolution is different and the dataset from which the forecasts are initialized is different.

For the evaluation of the UNSEEN ensemble we want to only use the SEAS5 hindcasts for a consistent dataset. Note, 2017 is not used in either the hindcast nor the operational dataset, since it contains forecasts both initialized in 2016 (hindcast) and 2017 (forecast), see retrieve. We split SEAS5 into hindcast and operational forecasts:

[4]:
SEAS5_California_events_hindcast <- SEAS5_California_events[
    SEAS5_California_events$time < '2017-02-01' &
    SEAS5_California_events$number < 25,]

SEAS5_California_events_forecasts <- SEAS5_California_events[
    SEAS5_California_events$time > '2017-02-01',]

And we select the same years for ERA5.

[5]:
ERA5_California_events_hindcast <- ERA5_California_events[
    ERA5_California_events$time > '1981-02-01' &
    ERA5_California_events$time < '2017-02-01',]

Which results in the following timeseries:

[6]:
unseen_timeseries(
    ensemble = SEAS5_California_events_hindcast,
    obs = ERA5_California_events_hindcast,
    ensemble_yname = "t2m",
    ensemble_xname = "time",
    obs_yname = "t2m",
    obs_xname = "time",
    ylab = "August California temperature (C)")


_images/Notebooks_examples_California_Fires_35_0.png
Evaluation tests

With the hindcast dataset we evaluate the independence, stability and fidelity. Here, we plot the results for the fidelity test, for more detail on the other tests see the evaluation section.

The fidelity test shows us how consistent the model simulations of UNSEEN (SEAS5) are with the observed (ERA5). The UNSEEN dataset is much larger than the observed – hence they cannot simply be compared. For example, what if we had faced a few more or a few less heatwaves purely by chance?

This would influence the observed mean, but not so much influence the UNSEEN ensemble because of the large data sample. Therefore we express the UNSEEN ensemble as a range of plausible means, for data samples of the same length as the observed. We do the same for higher order statistical moments.

[7]:
Eval = fidelity_test(
    obs = ERA5_California_events_hindcast$t2m,
    ensemble = SEAS5_California_events_hindcast$t2m,
    units = 'C',
    biascor = FALSE,
    fontsize = 14
)

Eval
ggsave(Eval, filename = "graphs/Calif_fidelity.png")

Error in ggsave(Eval, filename = "graphs/Calif_fidelity.png"): could not find function "ggsave"
Traceback:

_images/Notebooks_examples_California_Fires_37_1.png

The fidelity test shows that the mean of the UNSEEN ensemble is too low compared to the observed – the blue line falls outside of the model range in a. To correct for this low bias, we can apply an additive bias correction, which only corrects the mean of the simulations.

Lets apply the additive biascor:

[10]:
obs = ERA5_California_events_hindcast$t2m
ensemble = SEAS5_California_events_hindcast$t2m
ensemble_biascor = ensemble + (mean(obs) - mean(ensemble))

fidelity_test(
    obs = obs,
    ensemble = ensemble_biascor,
    units = 'C',
    biascor = FALSE
)
_images/Notebooks_examples_California_Fires_39_0.png

This shows us what we expected: the mean bias is corrected because the model simulations are shifted up (the blue line is still the same, the axis has just shifted along with the histogram), but the other statistical moments are the same.

Illustrate
[8]:
source('src/evt_plot.r')
Loading required package: Lmoments

Loading required package: distillery


Attaching package: 'extRemes'


The following objects are masked from 'package:stats':

    qqnorm, qqplot


We apply extreme value theory to analyze the trend in 100-year temperature extremes. There are different extreme value distributions that can be used to fit to the data. First, we fit a stationary Gumbel and a GEV distribution (including shape parameter) to the observed extremes. Then we fit a nonstationary GEV distribution to the observed temperatures and show that this better describes the data because the p-value of 0.006 and 0.002 are very small (much below 0.05 based on 5% significance with the likelihood ratio test).

[11]:
## Fit stationary distributions
fit_obs_Gumbel <- fevd(x = obs,
                    type = "Gumbel"
                   )
fit_obs_GEV <- fevd(x = obs,
                    type = "GEV"
                   )
## And the nonstationary distribution
fit_obs_GEV_nonstat <- fevd(x = obs,
                            type = "GEV",
                            location.fun = ~ c(1:36), ##Fitting the gev with a location and scale parameter linearly correlated to the covariate (years)
                            scale.fun = ~ c(1:36),
                            use.phi = TRUE
                           )
#And test the fit
##1. Stationary Gumbel vs stationary GEV
lr.test(fit_obs_Gumbel, fit_obs_GEV_nonstat)
##2. Stationary GEV vs Nonstationary GEV
lr.test(fit_obs_GEV, fit_obs_GEV_nonstat)

        Likelihood-ratio Test

data:  obsobs
Likelihood-ratio = 12.617, chi-square critical value = 7.8147, alpha =
0.0500, Degrees of Freedom = 3.0000, p-value = 0.005542
alternative hypothesis: greater


        Likelihood-ratio Test

data:  obsobs
Likelihood-ratio = 12.013, chi-square critical value = 5.9915, alpha =
0.0500, Degrees of Freedom = 2.0000, p-value = 0.002463
alternative hypothesis: greater

For the unseen ensemble this analysis is slightly more complicated since we need a covariate that has the same length as the ensemble:

[12]:
#Create the ensemble covariate
year_vector = as.integer(format(SEAS5_California_events_hindcast$time, format="%Y"))
covariate_ens = year_vector - 1980

# Fit the stationary distribution
fit_unseen_GEV <- fevd(x = ensemble_biascor,
                       type = 'GEV',
                       use.phi = TRUE)

fit_unseen_Gumbel <- fevd(x = ensemble_biascor,
                          type = 'Gumbel',
                          use.phi = TRUE)

# Fit the nonstationary distribution
fit_unseen_GEV_nonstat <- fevd(x = ensemble_biascor,
                               type = 'GEV',
                               location.fun = ~ covariate_ens, ##Fitting the gev with a location and scale parameter linearly correlated to the covariate (years)
                               scale.fun = ~ covariate_ens,
                               use.phi = TRUE)

And the likelihood ratio test tells us that the nonstationary GEV distribution is the best fit, both p-values < 2.2e-16:

[13]:
#And test the fit
##1. Stationary Gumbel vs stationary GEV
lr.test(fit_unseen_Gumbel,fit_unseen_GEV)
##2. Stationary GEV vs Nonstationary GEV
lr.test(fit_unseen_GEV, fit_unseen_GEV_nonstat)

        Likelihood-ratio Test

data:  ensemble_biascorensemble_biascor
Likelihood-ratio = 577.13, chi-square critical value = 3.8415, alpha =
0.0500, Degrees of Freedom = 1.0000, p-value < 2.2e-16
alternative hypothesis: greater


        Likelihood-ratio Test

data:  ensemble_biascorensemble_biascor
Likelihood-ratio = 956.98, chi-square critical value = 5.9915, alpha =
0.0500, Degrees of Freedom = 2.0000, p-value < 2.2e-16
alternative hypothesis: greater

We plot unseen trends in 100-year extremes. For more info on the methods see this paper

[14]:
p1 <- unseen_trends1(ensemble = ensemble_biascor,
                     x_ens = year_vector,
                     x_obs = 1981:2016,
                     rp = 100,
                     obs = obs,
                     covariate_ens = covariate_ens,
                     covariate_obs = c(1:36),
                     GEV_type = 'GEV',
                     ylab = 'August temperature (c)')
p1
_images/Notebooks_examples_California_Fires_50_0.png
[15]:
p2 <- unseen_trends2(ensemble = ensemble_biascor,
                    obs = obs,
                    covariate_ens = covariate_ens,
                    covariate_obs = c(1:36),
                    GEV_type = 'GEV',
                    ylab = 'August temperature (c)')

p2
_images/Notebooks_examples_California_Fires_51_0.png

Applications:

We have seen the worst fire season over California this year. Such fires are likely part of a chain of impacts, from droughts to heatwaves to fires, with feedbacks between them. Here we assess August temperatures and show that the 2020 August average temperature was very anomalous. We furthermore use SEAS5 forecasts to analyze the trend in rare extremes. Evaluation metrics show that the model simulations have a high bias, which we correct for using an additive bias correction. UNSEEN trend analysis shows a clear trend over time, both in the model and in the observed temperatures. Based on this analysis, temperature extremes that you would expect to occur once in 100 years in 1981 might occur once in 10 years in 2015 – and even more frequently now!

Note

Our analysis shows the results of a linear trend analysis of August temperature averages over 1981-2015. Other time windows, different trends than linear, and spatial domains could (should?) be investigated, as well as drought estimates in addition to temperature extremes.

Launch in Binder Binder

UK Precipitation

February 2020 case study

February 2020 was the wettest February on record in the UK (since 1862), according to the Met Office. The UK faced three official storms during February, and this exceptional phenomena attracted media attention, such as an article from the BBC on increased climate concerns among the population. A Carbon Brief post explained why the UK saw such record-breaking rainfall and put this rare event into perspective, citing, amongst other approaches, the UNSEEN method. The UNSEEN study by Thompson et al., 2017 assessed monthly precipitation over the UK. They showed that the monthly precipitation records for south east England have a 7% chance of being exceeded in at least one month in any given winter. They did not use SEAS5 but the Met Office model ensemble. This work was taken up in the National Flood Resilience Review (2016), showing the high relevance and applicability of the method.

Here, the aim is to build an open, reproducible and transferable workflow, that will be tested for this well-studied region of the world and can be transferred to other regions and climate variables of interest, such as the 2020 Siberian heat and California fires.

Retrieve data

The main functions to retrieve all forecasts (SEAS5) is retrieve_SEAS5. We want to download February average precipitation over the UK. By default, the hindcast years of 1981-2016 are downloaded for SEAS5. The folder indicates where the files will be stored, in this case outside of the UNSEEN-open repository, in a ‘UK_example’ directory. For more explanation, see retrieve.

[ ]:
retrieve.retrieve_SEAS5(variables = 'total_precipitation',
                        target_months = [2],
                        area = [60, -11, 50, 2],
                        folder = '../UK_example/SEAS5/')

We use the EOBS observational dataset to evaluate the UNSEEN ensemble. I tried to download EOBS through the Copernicus Climate Data Store, but the Product is temporally disabled for maintenance purposes. As workaround I downloaded EOBS (from 1950 - 2019) and the most recent EOBS data (2020) here. Note, you have to register as E-OBS user.

Preprocess

In the preprocessing step, we first merge all downloaded files into one xarray dataset, see preprocessing.

[ ]:
SEAS5 = xr.open_dataset('../UK_example/SEAS5/SEAS5.nc')

I tried to download EOBS through CDS, but the Product was temporally disabled for maintenance purposes (1.2 Retrieve). As workaround, here, I downloaded EOBS (from 1950 - 2019) and the most recent EOBS data (2020) here. Note, you have to register as E-OBS user.

I will select February monthly mean precipitation to compare to SEAS5. I have taken the average mm/day over the month, which I think is more fair than the total monthly precipitation because of leap days.

[5]:
EOBS = xr.open_dataset('../UK_example/EOBS/rr_ens_mean_0.25deg_reg_v20.0e.nc') ## open the data
EOBS = EOBS.resample(time='1m').mean() ## Monthly averages
EOBS = EOBS.sel(time=EOBS['time.month'] == 2) ## Select only February
EOBS
/soge-home/users/cenv0732/.conda/envs/UNSEEN-open/lib/python3.8/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis=axis, dtype=dtype)
[5]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 201
    • longitude: 464
    • time: 70
    • time
      (time)
      datetime64[ns]
      1950-02-28 ... 2019-02-28
      array(['1950-02-28T00:00:00.000000000', '1951-02-28T00:00:00.000000000',
             '1952-02-29T00:00:00.000000000', '1953-02-28T00:00:00.000000000',
             '1954-02-28T00:00:00.000000000', '1955-02-28T00:00:00.000000000',
             '1956-02-29T00:00:00.000000000', '1957-02-28T00:00:00.000000000',
             '1958-02-28T00:00:00.000000000', '1959-02-28T00:00:00.000000000',
             '1960-02-29T00:00:00.000000000', '1961-02-28T00:00:00.000000000',
             '1962-02-28T00:00:00.000000000', '1963-02-28T00:00:00.000000000',
             '1964-02-29T00:00:00.000000000', '1965-02-28T00:00:00.000000000',
             '1966-02-28T00:00:00.000000000', '1967-02-28T00:00:00.000000000',
             '1968-02-29T00:00:00.000000000', '1969-02-28T00:00:00.000000000',
             '1970-02-28T00:00:00.000000000', '1971-02-28T00:00:00.000000000',
             '1972-02-29T00:00:00.000000000', '1973-02-28T00:00:00.000000000',
             '1974-02-28T00:00:00.000000000', '1975-02-28T00:00:00.000000000',
             '1976-02-29T00:00:00.000000000', '1977-02-28T00:00:00.000000000',
             '1978-02-28T00:00:00.000000000', '1979-02-28T00:00:00.000000000',
             '1980-02-29T00:00:00.000000000', '1981-02-28T00:00:00.000000000',
             '1982-02-28T00:00:00.000000000', '1983-02-28T00:00:00.000000000',
             '1984-02-29T00:00:00.000000000', '1985-02-28T00:00:00.000000000',
             '1986-02-28T00:00:00.000000000', '1987-02-28T00:00:00.000000000',
             '1988-02-29T00:00:00.000000000', '1989-02-28T00:00:00.000000000',
             '1990-02-28T00:00:00.000000000', '1991-02-28T00:00:00.000000000',
             '1992-02-29T00:00:00.000000000', '1993-02-28T00:00:00.000000000',
             '1994-02-28T00:00:00.000000000', '1995-02-28T00:00:00.000000000',
             '1996-02-29T00:00:00.000000000', '1997-02-28T00:00:00.000000000',
             '1998-02-28T00:00:00.000000000', '1999-02-28T00:00:00.000000000',
             '2000-02-29T00:00:00.000000000', '2001-02-28T00:00:00.000000000',
             '2002-02-28T00:00:00.000000000', '2003-02-28T00:00:00.000000000',
             '2004-02-29T00:00:00.000000000', '2005-02-28T00:00:00.000000000',
             '2006-02-28T00:00:00.000000000', '2007-02-28T00:00:00.000000000',
             '2008-02-29T00:00:00.000000000', '2009-02-28T00:00:00.000000000',
             '2010-02-28T00:00:00.000000000', '2011-02-28T00:00:00.000000000',
             '2012-02-29T00:00:00.000000000', '2013-02-28T00:00:00.000000000',
             '2014-02-28T00:00:00.000000000', '2015-02-28T00:00:00.000000000',
             '2016-02-29T00:00:00.000000000', '2017-02-28T00:00:00.000000000',
             '2018-02-28T00:00:00.000000000', '2019-02-28T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • longitude
      (longitude)
      float64
      -40.38 -40.12 ... 75.12 75.38
      units :
      degrees_east
      long_name :
      Longitude values
      axis :
      X
      standard_name :
      longitude
      array([-40.375, -40.125, -39.875, ...,  74.875,  75.125,  75.375])
    • latitude
      (latitude)
      float64
      25.38 25.62 25.88 ... 75.12 75.38
      units :
      degrees_north
      long_name :
      Latitude values
      axis :
      Y
      standard_name :
      latitude
      array([25.375, 25.625, 25.875, ..., 74.875, 75.125, 75.375])
    • rr
      (time, latitude, longitude)
      float32
      nan nan nan nan ... nan nan nan nan
      array([[[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             ...,
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]]], dtype=float32)

Here I define the attributes, that xarray uses when plotting

[6]:
EOBS['rr'].attrs = {'long_name': 'rainfall',  ##Define the name
 'units': 'mm/day', ## unit
 'standard_name': 'thickness_of_rainfall_amount'} ## original name, not used
EOBS['rr'].mean('time').plot() ## and show the 1950-2019 average February precipitation

/soge-home/users/cenv0732/.conda/envs/UNSEEN-open/lib/python3.8/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis=axis, dtype=dtype)
[6]:
<matplotlib.collections.QuadMesh at 0x7f9dd1819f10>
_images/Notebooks_examples_UK_Precipitation_14_2.png

The 2020 data file is separate and needs the same preprocessing:

[8]:
EOBS2020 = xr.open_dataset('../UK_example/EOBS/rr_0.25deg_day_2020_grid_ensmean.nc.1') #open
EOBS2020 = EOBS2020.resample(time='1m').mean() #Monthly mean
EOBS2020['rr'].sel(time='2020-04').plot() #show map
EOBS2020 ## display dataset
/soge-home/users/cenv0732/.conda/envs/UNSEEN-open/lib/python3.8/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis=axis, dtype=dtype)
[8]:
<matplotlib.collections.QuadMesh at 0x7f9dd15e5820>
[8]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 201
    • longitude: 464
    • time: 12
    • time
      (time)
      datetime64[ns]
      2020-01-31 ... 2020-12-31
      array(['2020-01-31T00:00:00.000000000', '2020-02-29T00:00:00.000000000',
             '2020-03-31T00:00:00.000000000', '2020-04-30T00:00:00.000000000',
             '2020-05-31T00:00:00.000000000', '2020-06-30T00:00:00.000000000',
             '2020-07-31T00:00:00.000000000', '2020-08-31T00:00:00.000000000',
             '2020-09-30T00:00:00.000000000', '2020-10-31T00:00:00.000000000',
             '2020-11-30T00:00:00.000000000', '2020-12-31T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • longitude
      (longitude)
      float64
      -40.38 -40.12 ... 75.12 75.38
      standard_name :
      longitude
      long_name :
      Longitude values
      units :
      degrees_east
      axis :
      X
      array([-40.375, -40.125, -39.875, ...,  74.875,  75.125,  75.375])
    • latitude
      (latitude)
      float64
      25.38 25.62 25.88 ... 75.12 75.38
      standard_name :
      latitude
      long_name :
      Latitude values
      units :
      degrees_north
      axis :
      Y
      array([25.375, 25.625, 25.875, ..., 74.875, 75.125, 75.375])
    • rr
      (time, latitude, longitude)
      float32
      nan nan nan nan ... nan nan nan nan
      array([[[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             ...,
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]]], dtype=float32)
_images/Notebooks_examples_UK_Precipitation_16_3.png

We had to download EOBS in two separate files to also obtain the 2020 data. Below, we concatenate the two files and store the processed data for easy import in the future

[10]:
EOBS_concat = xr.concat([EOBS,EOBS2020.sel(time='2020-02')],dim='time') ## Concatenate the 1950-2019 and 2020 datasets.
EOBS_concat.to_netcdf('../UK_example/EOBS/EOBS.nc') ## And store the 1950-2010 February precipitation into one nc for future import

We then extract UK averaged precipitation SEAS5 and EOBS. We upscale EOBS to the SEAS5 grid and apply the same UK mask to extract the UK average for both datasets. See Using EOBS + upscaling for an example how to regrid and how to extract a country average timeseries.

Evaluate

Note

From here onward we use R and not python!

We switch to R since we believe R has a better functionality in extreme value statistics.

[1]:
setwd('../../..')
# getwd()
EOBS_UK_weighted_df <- read.csv("Data/EOBS_UK_weighted_upscaled.csv", stringsAsFactors=FALSE)
SEAS5_UK_weighted_df <- read.csv("Data/SEAS5_UK_weighted_masked.csv", stringsAsFactors=FALSE)

## Convert the time class to Date format
EOBS_UK_weighted_df$time <- lubridate::ymd(EOBS_UK_weighted_df$time)
str(EOBS_UK_weighted_df)

EOBS_UK_weighted_df_hindcast <- EOBS_UK_weighted_df[
    EOBS_UK_weighted_df$time > '1982-02-01' &
    EOBS_UK_weighted_df$time < '2017-02-01',
    ]


SEAS5_UK_weighted_df$time <- lubridate::ymd(SEAS5_UK_weighted_df$time)
str(SEAS5_UK_weighted_df)
'data.frame':   71 obs. of  2 variables:
 $ time: Date, format: "1950-02-28" "1951-02-28" ...
 $ rr  : num  4.13 3.25 1.07 1.59 2.59 ...
'data.frame':   4375 obs. of  4 variables:
 $ leadtime: int  2 2 2 2 2 2 2 2 2 2 ...
 $ number  : int  0 0 0 0 0 0 0 0 0 0 ...
 $ time    : Date, format: "1982-02-01" "1983-02-01" ...
 $ tprate  : num  1.62 2.93 3.27 2 3.31 ...

Is the UNSEEN ensemble realistic?

To answer this question, we perform three statistical tests: independence, model stability and model fidelity tests.
These statistical tests are available through the UNSEEN R package. See evaluation for more info.
[2]:
require(UNSEEN)
Loading required package: UNSEEN

Timeseries

We plot the timeseries of SEAS5 (UNSEEN) and EOBS (OBS) for UK February precipitation.

[3]:
unseen_timeseries(ensemble = SEAS5_UK_weighted_df,
                  obs = EOBS_UK_weighted_df,
                  ylab = 'UK February precipitation (mm/d)')
_images/Notebooks_examples_UK_Precipitation_27_0.png

We select the timeseries for the hindcast years 1981-2016.

[4]:
timeseries <- unseen_timeseries(ensemble = SEAS5_UK_weighted_df,
                  obs = EOBS_UK_weighted_df_hindcast,
                  ylab = 'UK February precipitation (mm/d)')
ggsave(timeseries, height = 5, width = 6,   filename = "graphs/UK_timeseries.png")
Error in ggsave(timeseries, height = 5, width = 6, filename = "graphs/UK_timeseries.png"): could not find function "ggsave"
Traceback:

Evaluation tests

With the hindcast dataset we evaluate the independence, stability and fidelity.

First the independence test. This test checks if the forecasts are independent. If they are not, the event are not unique and care should be taken in the extreme value analysis. Because of the chaotic behaviour of the atmosphere, independence of precipitation events is expected beyond a lead time of two weeks. Here we use lead times 2-6 months and find that the boxplots are within the expected range (perhaps very small dependence in lead time 2). More info in our paper: https://doi.org/10.31223/osf.io/hyxeq.

[5]:
independence_test(ensemble = SEAS5_UK)
Warning message:
"Removed 1625 rows containing non-finite values (stat_ydensity)."
Warning message:
"Removed 1625 rows containing non-finite values (stat_boxplot)."
_images/Notebooks_examples_UK_Precipitation_31_1.png

The test for model stability: Is there a drift in the simulated precipitation over lead times?

We find that the model is stable for UK February precipitation.

[8]:
stability_test(ensemble = SEAS5_UK, lab = 'UK February precipitation (mm/d)')
Warning message:
“Removed 4 row(s) containing missing values (geom_path).”
_images/Notebooks_examples_UK_Precipitation_33_1.png

The fidelity test shows us how consistent the model simulations of UNSEEN (SEAS5) are with the observed (EOBS). With this test we can asses systematic biases. The UNSEEN dataset is much larger than the observed – hence they cannot simply be compared. For example, what if we had faced a few more or a few less precipitation extremes purely by chance?

This would influence the observed mean, but not so much influence the UNSEEN ensemble because of the large data sample. Therefore we express the UNSEEN ensemble as a range of plausible means, for data samples of the same length as the observed. We do the same for higher order statistical moments.

[6]:
fidelity_test(obs = EOBS_UK_weighted_df_hindcast$rr,
              ensemble = SEAS5_UK_weighted_df$tprate
             )
_images/Notebooks_examples_UK_Precipitation_35_0.png

We find that the standard deviation within the model (the grey histograms and lines) are too low compared to the observed.

We can include a simple mean-bias correction (ratio) in this plot by setting biascor = TRUE. However, in this case it won’t help:

[7]:
fidelity_test(obs = EOBS_UK_weighted_df_hindcast$rr,
              ensemble = SEAS5_UK_weighted_df$tprate,
              biascor = TRUE
             )
_images/Notebooks_examples_UK_Precipitation_37_0.png

Check the documentation of the test ?fidelity_test

Illustrate
[8]:
source('src/evt_plot.r')
Loading required package: Lmoments

Loading required package: distillery


Attaching package: 'extRemes'


The following objects are masked from 'package:stats':

    qqnorm, qqplot


First, we fit a Gumbel and a GEV distribution (including shape parameter) to the observed extremes. The Gumbel distribution best describes the data because the p-value of 0.9 is much above 0.05 (based on the likelihood ratio test).

[9]:
fit_obs_Gumbel <- fevd(x = EOBS_UK_weighted_df_hindcast$rr,
                    type = "Gumbel"
                   )
fit_obs_GEV <- fevd(x = EOBS_UK_weighted_df_hindcast$rr,
                    type = "GEV"
                   )
lr.test(fit_obs_Gumbel, fit_obs_GEV)

        Likelihood-ratio Test

data:  EOBS_UK_weighted_df_hindcast$rrEOBS_UK_weighted_df_hindcast$rr
Likelihood-ratio = 0.014629, chi-square critical value = 3.8415, alpha
= 0.0500, Degrees of Freedom = 1.0000, p-value = 0.9037
alternative hypothesis: greater

We show the gumbel plot for the observed (EOBS) and UNSEEN (SEAS5 hindcast data). This shows that the UNSEEN simulations are not within the uncertainty range of the observations. This has to do with the variability of the model that is too low, as indicated in the evaluation section.

[13]:
options(repr.plot.width = 12)
Gumbel_hindcast <- EVT_plot(ensemble = SEAS5_UK_weighted_df$tprate,
                         obs = EOBS_UK_weighted_df_hindcast$rr,
                         main = "1981-2016",
                         GEV_type = "Gumbel",
#                          ylim = 3,
                         y_lab = 'UK February precipitation (mm/d)'
                        )
GEV_hindcast <- EVT_plot(ensemble = SEAS5_UK_weighted_df$tprate,
                                   obs = EOBS_UK_weighted_df$rr,
                                   main = "Entire EOBS",
                                   GEV_type = "Gumbel",
#                                    ylim = 3,
                                   y_lab = 'UK February precipitation (mm/d)'
                                  )

ggarrange(Gumbel_hindcast, GEV_hindcast,
  labels = c("a", "b"), # ,"c","d"),
  common.legend = T,
  font.label = list(size = 10, color = "black", face = "bold", family = NULL),
  ncol = 2, nrow = 1
)
_images/Notebooks_examples_UK_Precipitation_44_0.png

Why is there too little variability within UK february simulations?

This can be fed back to model developers to help improve the models.

We could further explore the use of other observational datasets and other model simulations.

Retrieve

We want to download the monthly precipitation for February. I use the automatically generated request from the CDS server. There are two datasets we can use to download the data: Seasonal forecast daily data on single levels and Seasonal forecast monthly statistics on single levels. We will use the latter for easy downloading of the monthly values. If we want to go to higher temporal resolution, such as daily extremes, we will have to consult the other dataset.

To get started with CDS, you have to register at https://cds.climate.copernicus.eu/ and copy your UID and API key from https://cds.climate.copernicus.eu/user in the ~/.cdsapirc file in the home directory of your user. See the ml-flood project for more details

[7]:
UID = 'UID'
API_key = 'API_key'
[8]:
import os
#Uncomment the following lines to write the UID and API key in the .cdsapirc file
# with open(os.path.join(os.path.expanduser('~'), '.cdsapirc'), 'w') as f:
#     f.write('url: https://cds.climate.copernicus.eu/api/v2\n')
#     f.write(f'key: {UID}:{API_key}')
[8]:
46
[8]:
47

Import packages

[1]:
##This is so variables get printed within jupyter
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
[2]:
##import packages
import os
import cdsapi ## check the current working directory, which should be the UNSEEN-open directory
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
import numpy as np
import cartopy
import cartopy.crs as ccrs
[3]:
##We want the working directory to be the UNSEEN-open directory
pwd = os.getcwd() ##current working directory is UNSEEN-open/Notebooks/1.Download
pwd #print the present working directory
os.chdir(pwd+'/../../') # Change the working directory to UNSEEN-open
os.getcwd() #print the working directory
[3]:
'C:\\Users\\Timo\\OneDrive - Loughborough University\\GitHub\\UNSEEN-open\\doc\\Notebooks\\1.Download'
[3]:
'C:\\Users\\Timo\\OneDrive - Loughborough University\\GitHub\\UNSEEN-open\\doc'

First download

In our request, we will use the monthly mean. Interestingly, there is also the option to use the monthly maximum! We previously downloaded the data on daily resolution and extracted the monthly (or seasonal) maximum from that data. If we could just download the monthly maximum instead that might save a lot of processing power! However, you would be restricted to daily extremes only, for multi-day extremes (5 days is often used), you would have to do the original processing workflow. We select the UK domain to reduce the size of the download.

Here I download the monthly mean total precipitation (both convective and large scale precipitation) forecast for February 1993. It downloads all 25 ensemble members for the forecasts initialized in january.

[4]:
##Our first download:

c = cdsapi.Client()

c.retrieve(
    'seasonal-monthly-single-levels',
    {
        'format': 'netcdf',
        'originating_centre': 'ecmwf',
        'system': '5',
        'variable': 'total_precipitation',
        'product_type': [
            'monthly_mean', #'monthly_maximum',, 'monthly_standard_deviation',
        ],
        'year': '1993', #data before 1993 is available.
        'month': '01', #Initialization month. Target month is February (2), initialization months are August-January (8-12,1)
        'leadtime_month': [ ##Use of single months is much faster. Leadtime 0 does not exist. The first lead time is 1.
            '1', '2',
        ],
        'area': [##Select UK domain to reduce the size of the download
            60, -11, 50,
            2,
        ],
    },
    'Data/First_download.nc') ##can I use nc? yes!
2020-05-13 10:08:56,140 INFO Welcome to the CDS
2020-05-13 10:08:56,142 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/seasonal-monthly-single-levels
2020-05-13 10:08:56,983 INFO Request is completed
2020-05-13 10:08:56,984 INFO Downloading http://136.156.132.110/cache-compute-0001/cache/data0/adaptor.mars.external-1589266964.5635436-26283-29-a38e8975-b0ec-49ee-8f9b-7dea389f59cf.nc to Data/First_download.nc (16.4K)
2020-05-13 10:08:57,131 INFO Download rate 112.7K/s
[4]:
Result(content_length=16800,content_type=application/x-netcdf,location=http://136.156.132.110/cache-compute-0001/cache/data0/adaptor.mars.external-1589266964.5635436-26283-29-a38e8975-b0ec-49ee-8f9b-7dea389f59cf.nc)
Use xarray to visualize the netcdf file

I open the downloaded file and plot February 1993 precipitation over the UK.

[5]:
pr_1993_ds=xr.open_dataset('Data/First_download.nc')
pr_1993_ds

[5]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 11
    • longitude: 14
    • number: 25
    • time: 2
    • longitude
      (longitude)
      float32
      -11.0 -10.0 -9.0 ... 0.0 1.0 2.0
      units :
      degrees_east
      long_name :
      longitude
      array([-11., -10.,  -9.,  -8.,  -7.,  -6.,  -5.,  -4.,  -3.,  -2.,  -1.,   0.,
               1.,   2.], dtype=float32)
    • latitude
      (latitude)
      float32
      60.0 59.0 58.0 ... 52.0 51.0 50.0
      units :
      degrees_north
      long_name :
      latitude
      array([60., 59., 58., 57., 56., 55., 54., 53., 52., 51., 50.], dtype=float32)
    • number
      (number)
      int32
      0 1 2 3 4 5 6 ... 19 20 21 22 23 24
      long_name :
      ensemble_member
      array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,
             18, 19, 20, 21, 22, 23, 24], dtype=int32)
    • time
      (time)
      datetime64[ns]
      1993-01-01 1993-02-01
      long_name :
      time
      array(['1993-01-01T00:00:00.000000000', '1993-02-01T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • tprate
      (time, number, latitude, longitude)
      float32
      ...
      units :
      m s**-1
      long_name :
      Mean total precipitation rate
      array([[[[7.843623e-08, ..., 5.291088e-08],
               ...,
               [5.904984e-08, ..., 1.335037e-08]],
      
              ...,
      
              [[8.193555e-08, ..., 6.469647e-08],
               ...,
               [4.698779e-08, ..., 2.983202e-08]]],
      
      
             [[[7.322512e-08, ..., 7.874678e-08],
               ...,
               [4.052692e-08, ..., 2.413616e-08]],
      
              ...,
      
              [[5.092263e-08, ..., 3.040388e-08],
               ...,
               [3.127492e-08, ..., 2.817704e-08]]]], dtype=float32)
  • Conventions :
    CF-1.6
    history :
    2020-05-12 07:02:45 GMT by grib_to_netcdf-2.16.0: /opt/ecmwf/eccodes/bin/grib_to_netcdf -S param -o /cache/data0/adaptor.mars.external-1589266964.5635436-26283-29-a38e8975-b0ec-49ee-8f9b-7dea389f59cf.nc /cache/tmp/a38e8975-b0ec-49ee-8f9b-7dea389f59cf-adaptor.mars.external-1589266964.5641062-26283-11-tmp.grib

I select ensemble member 0 and february precipitation (‘tprate’ called apparently) and I use cartopy to make the map.

[6]:
## Use cartopy for nicer maps
ax = plt.axes(projection= ccrs.OSGB())
pr_1993_ds['tprate'].sel(number=0,time='1993-02').plot(transform=ccrs.PlateCarree(),cmap=plt.cm.Blues, ax=ax)  #,cmap=plt.cm.Blues,

# ax.set_extent(extent)
ax.coastlines(resolution='50m')
plt.draw()
[6]:
<matplotlib.collections.QuadMesh at 0x7f5435adfa60>
[6]:
<cartopy.mpl.feature_artist.FeatureArtist at 0x7f5435b6ff10>
_images/Notebooks_1.Download_1.Retrieve_12_2.png
Download all data

We will be using the SEAS5 hindcast, which is a dataset running from 1981-2016. The hindcast is initialized every month with 25 ensemble members and the forecast run for 6 months, indicated by blue horizontal bars below. February is forecasted by 6 initialization months (September-February). We discard the first month of the forecast because of dependence between the forecasts, explained in the evaluation section and are left with 5 initialization months (Sep-Jan) and 25 ensemble members forecasting february precipitation each year, totalling to an increase of 125 times the observed length.

For a summary of all available C3S seasonal hindcasts, their initialization months and more specifics, please see ECMWF page and the SEAS5 paper.

title

The first download example above downloaded all 25 ensemble members for the forecast initialized in January (the bottom bar). We should repeat this over the other initialization month and over all years (1981-2016).

[58]:
init_months = np.append(np.arange(9,13),1) ## Initialization months 9-12,1 (Sep-Jan)
init_months
years = np.arange(1982,2017)
years

[58]:
array([ 9, 10, 11, 12,  1])
[58]:
array([1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992,
       1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
       2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014,
       2015, 2016])

For our download, we loop over initialization months and years. Because we only want February precipitation, the leadtime month (forecast length) changes with the initialization month. For example, in the September initialized forecasts, we only want the leadtime month 6 = February. For August initialized this is leadtime 5, etc. Furthermore, the year the forecast is initialized is required for the download. For September - December initialized forecasts, this is the target year-1. For January it is the same year as the target year. For example, for the first two target years this looks like the following:

[101]:

for j in range(2):#len(years)):
    for i in range(len(init_months)):
        init_month = init_months[i]
        leadtime_month = 6-i
        if init_month == 1:
            year = years[j]
        else:
            year = years[j]-1
        print ('year = ' + str(year) +' init_month = ' + str(init_month) + ' leadtime_month = ' + str(leadtime_month))
year = 1981 init_month = 9 leadtime_month = 6
year = 1981 init_month = 10 leadtime_month = 5
year = 1981 init_month = 11 leadtime_month = 4
year = 1981 init_month = 12 leadtime_month = 3
year = 1982 init_month = 1 leadtime_month = 2
year = 1982 init_month = 9 leadtime_month = 6
year = 1982 init_month = 10 leadtime_month = 5
year = 1982 init_month = 11 leadtime_month = 4
year = 1982 init_month = 12 leadtime_month = 3
year = 1983 init_month = 1 leadtime_month = 2

Write a function that is used for the download.

[72]:
def retrieve(variable, originating_centre, year, init_month, leadtime_month):

    c.retrieve(
        'seasonal-monthly-single-levels',
        {
            'format': 'netcdf',
            'originating_centre': originating_centre,
            'system': '5',
            'variable': variable,
            'product_type': [
                'monthly_mean', #'monthly_maximum',, 'monthly_standard_deviation',
            ],
            'year': str(year), #data before 1993 is available.
            'month': "%.2i" % init_month, #Initialization month. Target month is February (2), initialization months are August-January (8-12,1)
            'leadtime_month': [ ##The lead times you want. Use of single months is much faster. Leadtime 0 does not exist. The first lead time is 1.
                #For initialization month 1 (January), the leadtime months is 2 (February). For initialization month 12 (december), the lead time month is 3 (February).
                str(leadtime_month),
            ],
            'area': [##Select UK domain to reduce the size of the download
                     ## 25N-75N x. 40W-75E
                60, -11, 50, 2,
            ],
        },
        '../UK_example/'+ str(year) + "%.2i" % init_month + '.nc')

# retrieve(variable = 'total_precipitation',originating_centre = 'ecmwf', year = years[0], init_month = "%.2i" % init_months[0])

And start the download! In total, we request 35 years x initialization dates = 175 requests. I could try sending just 5 request of the different initialization dates for all years?

[ ]:
for j in range(len(years)):  ##add if error still continue
    for i in range(len(init_months)):
        init_month = init_months[i]
        leadtime_month = 6 - i
        if init_month == 1:
            year = years[j]
        else:
            year = years[j] - 1
        retrieve(variable='total_precipitation',
                 originating_centre='ecmwf',
                 year=year,
                 init_month=init_month,
                 leadtime_month=leadtime_month)
2020-05-18 10:14:48,767 INFO Welcome to the CDS
2020-05-18 10:14:48,768 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/seasonal-monthly-single-levels
2020-05-18 10:14:49,485 INFO Downloading http://136.156.132.235/cache-compute-0006/cache/data5/adaptor.mars.external-1589380912.7108843-4209-7-1add31ae-a0cd-44ce-83ac-9ff7c97f1b01.nc to ../UK_example/198109.nc (8.9K)
2020-05-18 10:14:49,575 INFO Download rate 101.5K/s
2020-05-18 10:14:49,803 INFO Welcome to the CDS
2020-05-18 10:14:49,804 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/seasonal-monthly-single-levels
2020-05-18 10:14:50,498 INFO Downloading http://136.156.132.153/cache-compute-0002/cache/data4/adaptor.mars.external-1589381056.172494-12462-1-c9714216-87ac-49bc-be19-260627a9077d.nc to ../UK_example/198110.nc (8.9K)
2020-05-18 10:14:50,571 INFO Download rate 124.6K/s
2020-05-18 10:14:51,070 INFO Welcome to the CDS
2020-05-18 10:14:51,071 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/seasonal-monthly-single-levels
2020-05-18 10:14:51,213 INFO Downloading http://136.156.132.235/cache-compute-0006/cache/data9/adaptor.mars.external-1589381301.6300867-8112-3-49ba0ab2-34fe-4364-9dec-700bf911b079.nc to ../UK_example/198111.nc (8.9K)
2020-05-18 10:14:51,254 INFO Download rate 219.7K/s
2020-05-18 10:14:51,415 INFO Welcome to the CDS
2020-05-18 10:14:51,416 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/seasonal-monthly-single-levels
2020-05-18 10:14:51,548 INFO Request is queued

The download sometimes fails. When redoing the request it does download. I don’t know what is causing the failure? Below I donwload the file that failed.

[97]:
#201501 missing

year = 2015
init_month = 1
leadtime_month = 2
retrieve(variable = 'total_precipitation',originating_centre = 'ecmwf', year = year,
                 init_month = init_month, leadtime_month = leadtime_month)


2020-05-15 11:51:16,127 INFO Welcome to the CDS
2020-05-15 11:51:16,129 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/seasonal-monthly-single-levels
2020-05-15 11:51:16,327 INFO Downloading http://136.156.133.46/cache-compute-0015/cache/data7/adaptor.mars.external-1589527607.2123153-8094-37-3b786f72-2e2a-462f-bbb8-9c8d89c05102.nc to ../UK_example/201501.nc (8.9K)
2020-05-15 11:51:16,485 INFO Download rate 56.7K/s
Retrieve function

We have written a module where the above procedure is done automatically. Here we load the retrieve module and retrieve SEAS5 and ERA5 data for the examples by selecting the variable, target month(s), area and folder where we want to download the file in.

The main function to download the data is retrieve.retrieve_SEAS5. The function only downloads the target months, for each year and each intialization month. To do this, it obtains the initialization months and leadtimes from the selected target month(s). For the UK example, we select February as our target month, hence sep-jan will be our initialization months with leadtimes 2-6, see Download all.

[7]:
retrieve.print_arguments([2])
year = 1982 init_month = 1 leadtime_month = [2]
year = 1981 init_month = 12 leadtime_month = [3]
year = 1981 init_month = 11 leadtime_month = [4]
year = 1981 init_month = 10 leadtime_month = [5]
year = 1981 init_month = 9 leadtime_month = [6]

For the Siberia example this will be different, since the target months are march-may:

[8]:
retrieve.print_arguments([3,4,5])
year = 1982 init_month = 2 leadtime_month = [2 3 4]
year = 1982 init_month = 1 leadtime_month = [3 4 5]
year = 1981 init_month = 12 leadtime_month = [4 5 6]

Call ?retrieve.retrieve_SEAS5 to see the documentation.

For the California example, we use:

[ ]:
retrieve.retrieve_SEAS5(
    variables=['2m_temperature', '2m_dewpoint_temperature'],
    target_months=[8],
    area=[70, -130, 20, -70],
    years=np.arange(1981, 2021),
    folder='E:/PhD/California_example/SEAS5/')
[ ]:
retrieve.retrieve_ERA5(variables=['2m_temperature', '2m_dewpoint_temperature'],
                       target_months=[8],
                       area=[70, -130, 20, -70],
                       folder='E:/PhD/California_example/SEAS5/')

For the Siberia example:

[ ]:
retrieve.retrieve_SEAS5(
    variables=['2m_temperature', '2m_dewpoint_temperature'],
    target_months=[3, 4, 5],
    area=[70, -11, 30, 120],
    years=np.arange(1981, 2021),
    folder='../Siberia_example/SEAS5/')
[ ]:
retrieve.retrieve_ERA5(variables = ['2m_temperature','2m_dewpoint_temperature'],
                       target_months = [3,4,5],
                       area = [70, -11, 30, 120],
                       folder = '../Siberia_example/ERA5/')

And for the UK example:

[ ]:
retrieve.retrieve_SEAS5(variables = 'total_precipitation',
                        target_months = [2],
                        area = [60, -11, 50, 2],
                        folder = '../UK_example/SEAS5/')
[ ]:
retrieve.retrieve_ERA5(variables = 'total_precipitation',
                       target_months = [2],
                       area = [60, -11, 50, 2],
                       folder = '../UK_example/ERA5/')
EOBS data download

I tried to download EOBS through CDS, but the Product is temporally disabled for maintenance purposes (see below). As workaround I downloaded EOBS (from 1950 - 2019) and the most recent EOBS data (2020) here. Note, you have to register as E-OBS user.

[99]:
c.retrieve(
    'insitu-gridded-observations-europe',
    {
        'version': 'v20.0e',
        'format': 'zip',
        'product_type': 'ensemble_mean',
        'variable': 'precipitation_amount',
        'grid_resolution': '0_25',
        'period': 'full_period',
    },
    '../UK_example/EOBS/EOBS.zip')
2020-05-15 14:06:44,721 INFO Welcome to the CDS
2020-05-15 14:06:44,722 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/insitu-gridded-observations-europe
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
~/.conda/envs/UNSEEN-open/lib/python3.8/site-packages/cdsapi/api.py in _api(self, url, request, method)
    388         try:
--> 389             result.raise_for_status()
    390             reply = result.json()

~/.conda/envs/UNSEEN-open/lib/python3.8/site-packages/requests/models.py in raise_for_status(self)
    940         if http_error_msg:
--> 941             raise HTTPError(http_error_msg, response=self)
    942

HTTPError: 403 Client Error:  for url: https://cds.climate.copernicus.eu/api/v2/resources/insitu-gridded-observations-europe

During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)
<ipython-input-99-d12768b41b79> in <module>
----> 1 c.retrieve(
      2     'insitu-gridded-observations-europe',
      3     {
      4         'version': 'v20.0e',
      5         'format': 'zip',

~/.conda/envs/UNSEEN-open/lib/python3.8/site-packages/cdsapi/api.py in retrieve(self, name, request, target)
    315
    316     def retrieve(self, name, request, target=None):
--> 317         result = self._api('%s/resources/%s' % (self.url, name), request, 'POST')
    318         if target is not None:
    319             result.download(target)

~/.conda/envs/UNSEEN-open/lib/python3.8/site-packages/cdsapi/api.py in _api(self, url, request, method)
    408                                  "of '%s' at %s" % (t['title'], t['url']))
    409                     error = '. '.join(e)
--> 410                 raise Exception(error)
    411             else:
    412                 raise

Exception: Product temporally disabled for maintenance purposes. Sorry for the inconvenience, please try again later.

Preprocess

The preprocessing steps consist of merging all retrieved files into one xarray dataset and extracting the spatial and temporal average of the event of interest.

Merge

Here it is shown how all retrieved files are loaded into one xarray dataset, for both SEAS5 and for ERA5.

SEAS5

All retrieved seasonal forecasts are loaded into one xarray dataset. The amount of files retrieved depends on the temporal extent of the extreme event that is being analyzed (i.e are you looking at a monthly average or a seasonal average?). For the Siberian heatwave, we have retrieved 105 files (one for each of the 35 years and for each of the three lead times, (see Retrieve). For the UK, we are able to use more forecasts, because the target month is shorter: one month as compared to three months for the Siberian example. We retrieved 5 leadtimes x 35 = 175 files.

Each netcdf file contains 25 ensemble members, hence has the dimensions lat, lon, number (25 ensembles). Here we create an xarray dataset that also contains the dimensions time (35 years) and leadtime (5 initialization months). To generate this, we loop over lead times, and open all 35 years of the lead time and then concatenate those leadtimes.

[1]:
##This is so variables get printed within jupyter
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
[2]:
import os
import sys
sys.path.insert(0, os.path.abspath('../../../'))
import src.cdsretrieve as retrieve
[3]:
os.chdir(os.path.abspath('../../../'))
os.getcwd() #print the working directory
[3]:
'C:\\Users\\Timo\\OneDrive - Loughborough University\\GitHub\\UNSEEN-open'
[4]:
import xarray as xr
import numpy as np

def merge_SEAS5(folder, target_months):
    init_months, leadtimes = retrieve._get_init_months(target_months)
    print('Lead time: ' + "%.2i" % init_months[0])
    SEAS5_ld1 = xr.open_mfdataset(
        folder + '*' + "%.2i" % init_months[0] + '.nc',
        combine='by_coords')  # Load the first lead time
    SEAS5 = SEAS5_ld1  # Create the xarray dataset to concatenate over
    for init_month in init_months[1:len(init_months)]:  ## Remove the first that we already have
        print(init_month)
        SEAS5_ld = xr.open_mfdataset(
            folder + '*' + "%.2i" % init_month + '.nc',
            combine='by_coords')
        SEAS5 = xr.concat([SEAS5, SEAS5_ld], dim='leadtime')
    SEAS5 = SEAS5.assign_coords(leadtime = np.arange(len(init_months)) + 2) # assign leadtime coordinates
    return(SEAS5)
[ ]:
SEAS5_Siberia = merge_SEAS5(folder='../Siberia_example/SEAS5/',
                            target_months=[3, 4, 5])
[8]:
SEAS5_Siberia
[8]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 41
    • leadtime: 3
    • longitude: 132
    • number: 51
    • time: 117
    • time
      (time)
      datetime64[ns]
      1982-03-01 ... 2020-05-01
      long_name :
      time
      array(['1982-03-01T00:00:00.000000000', '1982-04-01T00:00:00.000000000',
             '1982-05-01T00:00:00.000000000', '1983-03-01T00:00:00.000000000',
             '1983-04-01T00:00:00.000000000', '1983-05-01T00:00:00.000000000',
             '1984-03-01T00:00:00.000000000', '1984-04-01T00:00:00.000000000',
             '1984-05-01T00:00:00.000000000', '1985-03-01T00:00:00.000000000',
             '1985-04-01T00:00:00.000000000', '1985-05-01T00:00:00.000000000',
             '1986-03-01T00:00:00.000000000', '1986-04-01T00:00:00.000000000',
             '1986-05-01T00:00:00.000000000', '1987-03-01T00:00:00.000000000',
             '1987-04-01T00:00:00.000000000', '1987-05-01T00:00:00.000000000',
             '1988-03-01T00:00:00.000000000', '1988-04-01T00:00:00.000000000',
             '1988-05-01T00:00:00.000000000', '1989-03-01T00:00:00.000000000',
             '1989-04-01T00:00:00.000000000', '1989-05-01T00:00:00.000000000',
             '1990-03-01T00:00:00.000000000', '1990-04-01T00:00:00.000000000',
             '1990-05-01T00:00:00.000000000', '1991-03-01T00:00:00.000000000',
             '1991-04-01T00:00:00.000000000', '1991-05-01T00:00:00.000000000',
             '1992-03-01T00:00:00.000000000', '1992-04-01T00:00:00.000000000',
             '1992-05-01T00:00:00.000000000', '1993-03-01T00:00:00.000000000',
             '1993-04-01T00:00:00.000000000', '1993-05-01T00:00:00.000000000',
             '1994-03-01T00:00:00.000000000', '1994-04-01T00:00:00.000000000',
             '1994-05-01T00:00:00.000000000', '1995-03-01T00:00:00.000000000',
             '1995-04-01T00:00:00.000000000', '1995-05-01T00:00:00.000000000',
             '1996-03-01T00:00:00.000000000', '1996-04-01T00:00:00.000000000',
             '1996-05-01T00:00:00.000000000', '1997-03-01T00:00:00.000000000',
             '1997-04-01T00:00:00.000000000', '1997-05-01T00:00:00.000000000',
             '1998-03-01T00:00:00.000000000', '1998-04-01T00:00:00.000000000',
             '1998-05-01T00:00:00.000000000', '1999-03-01T00:00:00.000000000',
             '1999-04-01T00:00:00.000000000', '1999-05-01T00:00:00.000000000',
             '2000-03-01T00:00:00.000000000', '2000-04-01T00:00:00.000000000',
             '2000-05-01T00:00:00.000000000', '2001-03-01T00:00:00.000000000',
             '2001-04-01T00:00:00.000000000', '2001-05-01T00:00:00.000000000',
             '2002-03-01T00:00:00.000000000', '2002-04-01T00:00:00.000000000',
             '2002-05-01T00:00:00.000000000', '2003-03-01T00:00:00.000000000',
             '2003-04-01T00:00:00.000000000', '2003-05-01T00:00:00.000000000',
             '2004-03-01T00:00:00.000000000', '2004-04-01T00:00:00.000000000',
             '2004-05-01T00:00:00.000000000', '2005-03-01T00:00:00.000000000',
             '2005-04-01T00:00:00.000000000', '2005-05-01T00:00:00.000000000',
             '2006-03-01T00:00:00.000000000', '2006-04-01T00:00:00.000000000',
             '2006-05-01T00:00:00.000000000', '2007-03-01T00:00:00.000000000',
             '2007-04-01T00:00:00.000000000', '2007-05-01T00:00:00.000000000',
             '2008-03-01T00:00:00.000000000', '2008-04-01T00:00:00.000000000',
             '2008-05-01T00:00:00.000000000', '2009-03-01T00:00:00.000000000',
             '2009-04-01T00:00:00.000000000', '2009-05-01T00:00:00.000000000',
             '2010-03-01T00:00:00.000000000', '2010-04-01T00:00:00.000000000',
             '2010-05-01T00:00:00.000000000', '2011-03-01T00:00:00.000000000',
             '2011-04-01T00:00:00.000000000', '2011-05-01T00:00:00.000000000',
             '2012-03-01T00:00:00.000000000', '2012-04-01T00:00:00.000000000',
             '2012-05-01T00:00:00.000000000', '2013-03-01T00:00:00.000000000',
             '2013-04-01T00:00:00.000000000', '2013-05-01T00:00:00.000000000',
             '2014-03-01T00:00:00.000000000', '2014-04-01T00:00:00.000000000',
             '2014-05-01T00:00:00.000000000', '2015-03-01T00:00:00.000000000',
             '2015-04-01T00:00:00.000000000', '2015-05-01T00:00:00.000000000',
             '2016-03-01T00:00:00.000000000', '2016-04-01T00:00:00.000000000',
             '2016-05-01T00:00:00.000000000', '2017-03-01T00:00:00.000000000',
             '2017-04-01T00:00:00.000000000', '2017-05-01T00:00:00.000000000',
             '2018-03-01T00:00:00.000000000', '2018-04-01T00:00:00.000000000',
             '2018-05-01T00:00:00.000000000', '2019-03-01T00:00:00.000000000',
             '2019-04-01T00:00:00.000000000', '2019-05-01T00:00:00.000000000',
             '2020-03-01T00:00:00.000000000', '2020-04-01T00:00:00.000000000',
             '2020-05-01T00:00:00.000000000'], dtype='datetime64[ns]')
    • latitude
      (latitude)
      float32
      70.0 69.0 68.0 ... 32.0 31.0 30.0
      units :
      degrees_north
      long_name :
      latitude
      array([70., 69., 68., 67., 66., 65., 64., 63., 62., 61., 60., 59., 58., 57.,
             56., 55., 54., 53., 52., 51., 50., 49., 48., 47., 46., 45., 44., 43.,
             42., 41., 40., 39., 38., 37., 36., 35., 34., 33., 32., 31., 30.],
            dtype=float32)
    • number
      (number)
      int64
      0 1 2 3 4 5 6 ... 45 46 47 48 49 50
      long_name :
      ensemble_member
      array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,
             18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
             36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50])
    • longitude
      (longitude)
      float32
      -11.0 -10.0 -9.0 ... 119.0 120.0
      units :
      degrees_east
      long_name :
      longitude
      array([-11., -10.,  -9.,  -8.,  -7.,  -6.,  -5.,  -4.,  -3.,  -2.,  -1.,   0.,
               1.,   2.,   3.,   4.,   5.,   6.,   7.,   8.,   9.,  10.,  11.,  12.,
              13.,  14.,  15.,  16.,  17.,  18.,  19.,  20.,  21.,  22.,  23.,  24.,
              25.,  26.,  27.,  28.,  29.,  30.,  31.,  32.,  33.,  34.,  35.,  36.,
              37.,  38.,  39.,  40.,  41.,  42.,  43.,  44.,  45.,  46.,  47.,  48.,
              49.,  50.,  51.,  52.,  53.,  54.,  55.,  56.,  57.,  58.,  59.,  60.,
              61.,  62.,  63.,  64.,  65.,  66.,  67.,  68.,  69.,  70.,  71.,  72.,
              73.,  74.,  75.,  76.,  77.,  78.,  79.,  80.,  81.,  82.,  83.,  84.,
              85.,  86.,  87.,  88.,  89.,  90.,  91.,  92.,  93.,  94.,  95.,  96.,
              97.,  98.,  99., 100., 101., 102., 103., 104., 105., 106., 107., 108.,
             109., 110., 111., 112., 113., 114., 115., 116., 117., 118., 119., 120.],
            dtype=float32)
    • leadtime
      (leadtime)
      int64
      2 3 4
      array([2, 3, 4])
    • t2m
      (leadtime, time, number, latitude, longitude)
      float32
      dask.array<chunksize=(1, 3, 51, 41, 132), meta=np.ndarray>
      units :
      K
      long_name :
      2 metre temperature
      Array Chunk
      Bytes 387.52 MB 3.31 MB
      Shape (3, 117, 51, 41, 132) (1, 3, 51, 41, 132)
      Count 887 Tasks 117 Chunks
      Type float32 numpy.ndarray
      117 3 132 41 51
    • d2m
      (leadtime, time, number, latitude, longitude)
      float32
      dask.array<chunksize=(1, 3, 51, 41, 132), meta=np.ndarray>
      units :
      K
      long_name :
      2 metre dewpoint temperature
      Array Chunk
      Bytes 387.52 MB 3.31 MB
      Shape (3, 117, 51, 41, 132) (1, 3, 51, 41, 132)
      Count 887 Tasks 117 Chunks
      Type float32 numpy.ndarray
      117 3 132 41 51
  • Conventions :
    CF-1.6
    history :
    2020-09-08 09:33:24 GMT by grib_to_netcdf-2.16.0: /opt/ecmwf/eccodes/bin/grib_to_netcdf -S param -o /cache/data1/adaptor.mars.external-1599557575.5884402-22815-11-a3e13f38-976c-41fd-bc34-d70ac6258b8d.nc /cache/tmp/a3e13f38-976c-41fd-bc34-d70ac6258b8d-adaptor.mars.external-1599557575.5891798-22815-3-tmp.grib

You can for example select a the lat, long, time, ensemble member and lead time as follows (add .load() to see the values):

[ ]:
SEAS5_Siberia.sel(latitude=60,
                  longitude=-10,
                  time='2000-03',
                  number=26,
                  leadtime=3).load()

We can repeat this for the UK example, where just February is the target month:

[10]:
SEAS5_UK = merge_SEAS5(folder = '../UK_example/SEAS5/', target_months = [2])
Lead time: 01
12
11
10
9

The SEAS5 total precipitation rate is in m/s. You can easily convert this and change the attributes. Click on the show/hide attributes button to see the assigned attributes.

[11]:
SEAS5_UK['tprate'] = SEAS5_UK['tprate'] * 1000 * 3600 * 24 ## From m/s to mm/d
SEAS5_UK['tprate'].attrs = {'long_name': 'rainfall',
 'units': 'mm/day',
 'standard_name': 'thickness_of_rainfall_amount'}
SEAS5_UK
[11]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 11
    • leadtime: 5
    • longitude: 14
    • number: 25
    • time: 35
    • time
      (time)
      datetime64[ns]
      1982-02-01 ... 2016-02-01
      long_name :
      time
      array(['1982-02-01T00:00:00.000000000', '1983-02-01T00:00:00.000000000',
             '1984-02-01T00:00:00.000000000', '1985-02-01T00:00:00.000000000',
             '1986-02-01T00:00:00.000000000', '1987-02-01T00:00:00.000000000',
             '1988-02-01T00:00:00.000000000', '1989-02-01T00:00:00.000000000',
             '1990-02-01T00:00:00.000000000', '1991-02-01T00:00:00.000000000',
             '1992-02-01T00:00:00.000000000', '1993-02-01T00:00:00.000000000',
             '1994-02-01T00:00:00.000000000', '1995-02-01T00:00:00.000000000',
             '1996-02-01T00:00:00.000000000', '1997-02-01T00:00:00.000000000',
             '1998-02-01T00:00:00.000000000', '1999-02-01T00:00:00.000000000',
             '2000-02-01T00:00:00.000000000', '2001-02-01T00:00:00.000000000',
             '2002-02-01T00:00:00.000000000', '2003-02-01T00:00:00.000000000',
             '2004-02-01T00:00:00.000000000', '2005-02-01T00:00:00.000000000',
             '2006-02-01T00:00:00.000000000', '2007-02-01T00:00:00.000000000',
             '2008-02-01T00:00:00.000000000', '2009-02-01T00:00:00.000000000',
             '2010-02-01T00:00:00.000000000', '2011-02-01T00:00:00.000000000',
             '2012-02-01T00:00:00.000000000', '2013-02-01T00:00:00.000000000',
             '2014-02-01T00:00:00.000000000', '2015-02-01T00:00:00.000000000',
             '2016-02-01T00:00:00.000000000'], dtype='datetime64[ns]')
    • latitude
      (latitude)
      float32
      60.0 59.0 58.0 ... 52.0 51.0 50.0
      units :
      degrees_north
      long_name :
      latitude
      array([60., 59., 58., 57., 56., 55., 54., 53., 52., 51., 50.], dtype=float32)
    • number
      (number)
      int32
      0 1 2 3 4 5 6 ... 19 20 21 22 23 24
      long_name :
      ensemble_member
      array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,
             18, 19, 20, 21, 22, 23, 24], dtype=int32)
    • longitude
      (longitude)
      float32
      -11.0 -10.0 -9.0 ... 0.0 1.0 2.0
      units :
      degrees_east
      long_name :
      longitude
      array([-11., -10.,  -9.,  -8.,  -7.,  -6.,  -5.,  -4.,  -3.,  -2.,  -1.,   0.,
               1.,   2.], dtype=float32)
    • leadtime
      (leadtime)
      int64
      2 3 4 5 6
      array([2, 3, 4, 5, 6])
    • tprate
      (leadtime, time, number, latitude, longitude)
      float32
      dask.array<chunksize=(1, 1, 25, 11, 14), meta=np.ndarray>
      long_name :
      rainfall
      units :
      mm/day
      standard_name :
      thickness_of_rainfall_amount
      Array Chunk
      Bytes 2.69 MB 15.40 kB
      Shape (5, 35, 25, 11, 14) (1, 1, 25, 11, 14)
      Count 1715 Tasks 175 Chunks
      Type float32 numpy.ndarray
      35 5 14 11 25
  • Conventions :
    CF-1.6
    history :
    2020-05-13 14:49:43 GMT by grib_to_netcdf-2.16.0: /opt/ecmwf/eccodes/bin/grib_to_netcdf -S param -o /cache/data7/adaptor.mars.external-1589381366.1540039-11561-3-ad31a097-72e2-45ce-a565-55c62502f358.nc /cache/tmp/ad31a097-72e2-45ce-a565-55c62502f358-adaptor.mars.external-1589381366.1545565-11561-1-tmp.grib
ERA5

For each year a netcdf file is downloaded. They are named ERA5_yyyy, for example ERA5_1981. Therefore, we can load ERA5 by combining all downloaded years:

[12]:
ERA5_Siberia = xr.open_mfdataset('../Siberia_example/ERA5/ERA5_????.nc',combine='by_coords') ## open the data
ERA5_Siberia
[12]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 41
    • longitude: 132
    • time: 126
    • latitude
      (latitude)
      float32
      70.0 69.0 68.0 ... 32.0 31.0 30.0
      units :
      degrees_north
      long_name :
      latitude
      array([70., 69., 68., 67., 66., 65., 64., 63., 62., 61., 60., 59., 58., 57.,
             56., 55., 54., 53., 52., 51., 50., 49., 48., 47., 46., 45., 44., 43.,
             42., 41., 40., 39., 38., 37., 36., 35., 34., 33., 32., 31., 30.],
            dtype=float32)
    • longitude
      (longitude)
      float32
      -11.0 -10.0 -9.0 ... 119.0 120.0
      units :
      degrees_east
      long_name :
      longitude
      array([-11., -10.,  -9.,  -8.,  -7.,  -6.,  -5.,  -4.,  -3.,  -2.,  -1.,   0.,
               1.,   2.,   3.,   4.,   5.,   6.,   7.,   8.,   9.,  10.,  11.,  12.,
              13.,  14.,  15.,  16.,  17.,  18.,  19.,  20.,  21.,  22.,  23.,  24.,
              25.,  26.,  27.,  28.,  29.,  30.,  31.,  32.,  33.,  34.,  35.,  36.,
              37.,  38.,  39.,  40.,  41.,  42.,  43.,  44.,  45.,  46.,  47.,  48.,
              49.,  50.,  51.,  52.,  53.,  54.,  55.,  56.,  57.,  58.,  59.,  60.,
              61.,  62.,  63.,  64.,  65.,  66.,  67.,  68.,  69.,  70.,  71.,  72.,
              73.,  74.,  75.,  76.,  77.,  78.,  79.,  80.,  81.,  82.,  83.,  84.,
              85.,  86.,  87.,  88.,  89.,  90.,  91.,  92.,  93.,  94.,  95.,  96.,
              97.,  98.,  99., 100., 101., 102., 103., 104., 105., 106., 107., 108.,
             109., 110., 111., 112., 113., 114., 115., 116., 117., 118., 119., 120.],
            dtype=float32)
    • time
      (time)
      datetime64[ns]
      1979-03-01 ... 2020-05-01
      long_name :
      time
      array(['1979-03-01T00:00:00.000000000', '1979-04-01T00:00:00.000000000',
             '1979-05-01T00:00:00.000000000', '1980-03-01T00:00:00.000000000',
             '1980-04-01T00:00:00.000000000', '1980-05-01T00:00:00.000000000',
             '1981-03-01T00:00:00.000000000', '1981-04-01T00:00:00.000000000',
             '1981-05-01T00:00:00.000000000', '1982-03-01T00:00:00.000000000',
             '1982-04-01T00:00:00.000000000', '1982-05-01T00:00:00.000000000',
             '1983-03-01T00:00:00.000000000', '1983-04-01T00:00:00.000000000',
             '1983-05-01T00:00:00.000000000', '1984-03-01T00:00:00.000000000',
             '1984-04-01T00:00:00.000000000', '1984-05-01T00:00:00.000000000',
             '1985-03-01T00:00:00.000000000', '1985-04-01T00:00:00.000000000',
             '1985-05-01T00:00:00.000000000', '1986-03-01T00:00:00.000000000',
             '1986-04-01T00:00:00.000000000', '1986-05-01T00:00:00.000000000',
             '1987-03-01T00:00:00.000000000', '1987-04-01T00:00:00.000000000',
             '1987-05-01T00:00:00.000000000', '1988-03-01T00:00:00.000000000',
             '1988-04-01T00:00:00.000000000', '1988-05-01T00:00:00.000000000',
             '1989-03-01T00:00:00.000000000', '1989-04-01T00:00:00.000000000',
             '1989-05-01T00:00:00.000000000', '1990-03-01T00:00:00.000000000',
             '1990-04-01T00:00:00.000000000', '1990-05-01T00:00:00.000000000',
             '1991-03-01T00:00:00.000000000', '1991-04-01T00:00:00.000000000',
             '1991-05-01T00:00:00.000000000', '1992-03-01T00:00:00.000000000',
             '1992-04-01T00:00:00.000000000', '1992-05-01T00:00:00.000000000',
             '1993-03-01T00:00:00.000000000', '1993-04-01T00:00:00.000000000',
             '1993-05-01T00:00:00.000000000', '1994-03-01T00:00:00.000000000',
             '1994-04-01T00:00:00.000000000', '1994-05-01T00:00:00.000000000',
             '1995-03-01T00:00:00.000000000', '1995-04-01T00:00:00.000000000',
             '1995-05-01T00:00:00.000000000', '1996-03-01T00:00:00.000000000',
             '1996-04-01T00:00:00.000000000', '1996-05-01T00:00:00.000000000',
             '1997-03-01T00:00:00.000000000', '1997-04-01T00:00:00.000000000',
             '1997-05-01T00:00:00.000000000', '1998-03-01T00:00:00.000000000',
             '1998-04-01T00:00:00.000000000', '1998-05-01T00:00:00.000000000',
             '1999-03-01T00:00:00.000000000', '1999-04-01T00:00:00.000000000',
             '1999-05-01T00:00:00.000000000', '2000-03-01T00:00:00.000000000',
             '2000-04-01T00:00:00.000000000', '2000-05-01T00:00:00.000000000',
             '2001-03-01T00:00:00.000000000', '2001-04-01T00:00:00.000000000',
             '2001-05-01T00:00:00.000000000', '2002-03-01T00:00:00.000000000',
             '2002-04-01T00:00:00.000000000', '2002-05-01T00:00:00.000000000',
             '2003-03-01T00:00:00.000000000', '2003-04-01T00:00:00.000000000',
             '2003-05-01T00:00:00.000000000', '2004-03-01T00:00:00.000000000',
             '2004-04-01T00:00:00.000000000', '2004-05-01T00:00:00.000000000',
             '2005-03-01T00:00:00.000000000', '2005-04-01T00:00:00.000000000',
             '2005-05-01T00:00:00.000000000', '2006-03-01T00:00:00.000000000',
             '2006-04-01T00:00:00.000000000', '2006-05-01T00:00:00.000000000',
             '2007-03-01T00:00:00.000000000', '2007-04-01T00:00:00.000000000',
             '2007-05-01T00:00:00.000000000', '2008-03-01T00:00:00.000000000',
             '2008-04-01T00:00:00.000000000', '2008-05-01T00:00:00.000000000',
             '2009-03-01T00:00:00.000000000', '2009-04-01T00:00:00.000000000',
             '2009-05-01T00:00:00.000000000', '2010-03-01T00:00:00.000000000',
             '2010-04-01T00:00:00.000000000', '2010-05-01T00:00:00.000000000',
             '2011-03-01T00:00:00.000000000', '2011-04-01T00:00:00.000000000',
             '2011-05-01T00:00:00.000000000', '2012-03-01T00:00:00.000000000',
             '2012-04-01T00:00:00.000000000', '2012-05-01T00:00:00.000000000',
             '2013-03-01T00:00:00.000000000', '2013-04-01T00:00:00.000000000',
             '2013-05-01T00:00:00.000000000', '2014-03-01T00:00:00.000000000',
             '2014-04-01T00:00:00.000000000', '2014-05-01T00:00:00.000000000',
             '2015-03-01T00:00:00.000000000', '2015-04-01T00:00:00.000000000',
             '2015-05-01T00:00:00.000000000', '2016-03-01T00:00:00.000000000',
             '2016-04-01T00:00:00.000000000', '2016-05-01T00:00:00.000000000',
             '2017-03-01T00:00:00.000000000', '2017-04-01T00:00:00.000000000',
             '2017-05-01T00:00:00.000000000', '2018-03-01T00:00:00.000000000',
             '2018-04-01T00:00:00.000000000', '2018-05-01T00:00:00.000000000',
             '2019-03-01T00:00:00.000000000', '2019-04-01T00:00:00.000000000',
             '2019-05-01T00:00:00.000000000', '2020-03-01T00:00:00.000000000',
             '2020-04-01T00:00:00.000000000', '2020-05-01T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • t2m
      (time, latitude, longitude)
      float32
      dask.array<chunksize=(3, 41, 132), meta=np.ndarray>
      units :
      K
      long_name :
      2 metre temperature
      Array Chunk
      Bytes 2.73 MB 64.94 kB
      Shape (126, 41, 132) (3, 41, 132)
      Count 126 Tasks 42 Chunks
      Type float32 numpy.ndarray
      132 41 126
    • d2m
      (time, latitude, longitude)
      float32
      dask.array<chunksize=(3, 41, 132), meta=np.ndarray>
      units :
      K
      long_name :
      2 metre dewpoint temperature
      Array Chunk
      Bytes 2.73 MB 64.94 kB
      Shape (126, 41, 132) (3, 41, 132)
      Count 126 Tasks 42 Chunks
      Type float32 numpy.ndarray
      132 41 126
  • Conventions :
    CF-1.6
    history :
    2020-09-08 13:26:08 GMT by grib_to_netcdf-2.16.0: /opt/ecmwf/eccodes/bin/grib_to_netcdf -S param -o /cache/data5/adaptor.mars.internal-1599571563.605006-1463-33-b77abfe4-0299-4cba-9b8c-c5a877f44943.nc /cache/tmp/b77abfe4-0299-4cba-9b8c-c5a877f44943-adaptor.mars.internal-1599571563.6055787-1463-13-tmp.grib
[13]:
ERA5_UK = xr.open_mfdataset('../UK_example/ERA5/ERA5_????.nc',combine='by_coords') ## open the data
ERA5_UK
[13]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 11
    • longitude: 14
    • time: 42
    • latitude
      (latitude)
      float32
      60.0 59.0 58.0 ... 52.0 51.0 50.0
      units :
      degrees_north
      long_name :
      latitude
      array([60., 59., 58., 57., 56., 55., 54., 53., 52., 51., 50.], dtype=float32)
    • longitude
      (longitude)
      float32
      -11.0 -10.0 -9.0 ... 0.0 1.0 2.0
      units :
      degrees_east
      long_name :
      longitude
      array([-11., -10.,  -9.,  -8.,  -7.,  -6.,  -5.,  -4.,  -3.,  -2.,  -1.,   0.,
               1.,   2.], dtype=float32)
    • time
      (time)
      datetime64[ns]
      1979-02-01 ... 2020-02-01
      long_name :
      time
      array(['1979-02-01T00:00:00.000000000', '1980-02-01T00:00:00.000000000',
             '1981-02-01T00:00:00.000000000', '1982-02-01T00:00:00.000000000',
             '1983-02-01T00:00:00.000000000', '1984-02-01T00:00:00.000000000',
             '1985-02-01T00:00:00.000000000', '1986-02-01T00:00:00.000000000',
             '1987-02-01T00:00:00.000000000', '1988-02-01T00:00:00.000000000',
             '1989-02-01T00:00:00.000000000', '1990-02-01T00:00:00.000000000',
             '1991-02-01T00:00:00.000000000', '1992-02-01T00:00:00.000000000',
             '1993-02-01T00:00:00.000000000', '1994-02-01T00:00:00.000000000',
             '1995-02-01T00:00:00.000000000', '1996-02-01T00:00:00.000000000',
             '1997-02-01T00:00:00.000000000', '1998-02-01T00:00:00.000000000',
             '1999-02-01T00:00:00.000000000', '2000-02-01T00:00:00.000000000',
             '2001-02-01T00:00:00.000000000', '2002-02-01T00:00:00.000000000',
             '2003-02-01T00:00:00.000000000', '2004-02-01T00:00:00.000000000',
             '2005-02-01T00:00:00.000000000', '2006-02-01T00:00:00.000000000',
             '2007-02-01T00:00:00.000000000', '2008-02-01T00:00:00.000000000',
             '2009-02-01T00:00:00.000000000', '2010-02-01T00:00:00.000000000',
             '2011-02-01T00:00:00.000000000', '2012-02-01T00:00:00.000000000',
             '2013-02-01T00:00:00.000000000', '2014-02-01T00:00:00.000000000',
             '2015-02-01T00:00:00.000000000', '2016-02-01T00:00:00.000000000',
             '2017-02-01T00:00:00.000000000', '2018-02-01T00:00:00.000000000',
             '2019-02-01T00:00:00.000000000', '2020-02-01T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • tp
      (time, latitude, longitude)
      float32
      dask.array<chunksize=(1, 11, 14), meta=np.ndarray>
      units :
      m
      long_name :
      Total precipitation
      Array Chunk
      Bytes 25.87 kB 616 B
      Shape (42, 11, 14) (1, 11, 14)
      Count 126 Tasks 42 Chunks
      Type float32 numpy.ndarray
      14 11 42
  • Conventions :
    CF-1.6
    history :
    2020-09-08 13:36:54 GMT by grib_to_netcdf-2.16.0: /opt/ecmwf/eccodes/bin/grib_to_netcdf -S param -o /cache/data6/adaptor.mars.internal-1599572211.936053-12058-17-60c5a89d-0507-4593-8870-aacff3b72426.nc /cache/tmp/60c5a89d-0507-4593-8870-aacff3b72426-adaptor.mars.internal-1599572211.9366653-12058-6-tmp.grib

Event definition

Time selection

For the UK, the event of interest is UK February average precipitation. Since we download monthly averages, we do not have to do any preprocessing along the time dimension here. For the Siberian heatwave, we are interested in the March-May average. Therefore we need to take the seasonal average of the monthly timeseries. We cannot take the simple mean of the three months, because they have a different number of days in the months, see this example. Therefore we take a weighted average:

[14]:
month_length = SEAS5_Siberia.time.dt.days_in_month
month_length
[14]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
'days_in_month'
  • time: 117
  • 31 30 31 31 30 31 31 30 31 31 30 ... 30 31 31 30 31 31 30 31 31 30 31
    array([31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30,
           31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31,
           30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31,
           31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30,
           31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31,
           30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31,
           31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31, 31, 30, 31])
    • time
      (time)
      datetime64[ns]
      1982-03-01 ... 2020-05-01
      long_name :
      time
      array(['1982-03-01T00:00:00.000000000', '1982-04-01T00:00:00.000000000',
             '1982-05-01T00:00:00.000000000', '1983-03-01T00:00:00.000000000',
             '1983-04-01T00:00:00.000000000', '1983-05-01T00:00:00.000000000',
             '1984-03-01T00:00:00.000000000', '1984-04-01T00:00:00.000000000',
             '1984-05-01T00:00:00.000000000', '1985-03-01T00:00:00.000000000',
             '1985-04-01T00:00:00.000000000', '1985-05-01T00:00:00.000000000',
             '1986-03-01T00:00:00.000000000', '1986-04-01T00:00:00.000000000',
             '1986-05-01T00:00:00.000000000', '1987-03-01T00:00:00.000000000',
             '1987-04-01T00:00:00.000000000', '1987-05-01T00:00:00.000000000',
             '1988-03-01T00:00:00.000000000', '1988-04-01T00:00:00.000000000',
             '1988-05-01T00:00:00.000000000', '1989-03-01T00:00:00.000000000',
             '1989-04-01T00:00:00.000000000', '1989-05-01T00:00:00.000000000',
             '1990-03-01T00:00:00.000000000', '1990-04-01T00:00:00.000000000',
             '1990-05-01T00:00:00.000000000', '1991-03-01T00:00:00.000000000',
             '1991-04-01T00:00:00.000000000', '1991-05-01T00:00:00.000000000',
             '1992-03-01T00:00:00.000000000', '1992-04-01T00:00:00.000000000',
             '1992-05-01T00:00:00.000000000', '1993-03-01T00:00:00.000000000',
             '1993-04-01T00:00:00.000000000', '1993-05-01T00:00:00.000000000',
             '1994-03-01T00:00:00.000000000', '1994-04-01T00:00:00.000000000',
             '1994-05-01T00:00:00.000000000', '1995-03-01T00:00:00.000000000',
             '1995-04-01T00:00:00.000000000', '1995-05-01T00:00:00.000000000',
             '1996-03-01T00:00:00.000000000', '1996-04-01T00:00:00.000000000',
             '1996-05-01T00:00:00.000000000', '1997-03-01T00:00:00.000000000',
             '1997-04-01T00:00:00.000000000', '1997-05-01T00:00:00.000000000',
             '1998-03-01T00:00:00.000000000', '1998-04-01T00:00:00.000000000',
             '1998-05-01T00:00:00.000000000', '1999-03-01T00:00:00.000000000',
             '1999-04-01T00:00:00.000000000', '1999-05-01T00:00:00.000000000',
             '2000-03-01T00:00:00.000000000', '2000-04-01T00:00:00.000000000',
             '2000-05-01T00:00:00.000000000', '2001-03-01T00:00:00.000000000',
             '2001-04-01T00:00:00.000000000', '2001-05-01T00:00:00.000000000',
             '2002-03-01T00:00:00.000000000', '2002-04-01T00:00:00.000000000',
             '2002-05-01T00:00:00.000000000', '2003-03-01T00:00:00.000000000',
             '2003-04-01T00:00:00.000000000', '2003-05-01T00:00:00.000000000',
             '2004-03-01T00:00:00.000000000', '2004-04-01T00:00:00.000000000',
             '2004-05-01T00:00:00.000000000', '2005-03-01T00:00:00.000000000',
             '2005-04-01T00:00:00.000000000', '2005-05-01T00:00:00.000000000',
             '2006-03-01T00:00:00.000000000', '2006-04-01T00:00:00.000000000',
             '2006-05-01T00:00:00.000000000', '2007-03-01T00:00:00.000000000',
             '2007-04-01T00:00:00.000000000', '2007-05-01T00:00:00.000000000',
             '2008-03-01T00:00:00.000000000', '2008-04-01T00:00:00.000000000',
             '2008-05-01T00:00:00.000000000', '2009-03-01T00:00:00.000000000',
             '2009-04-01T00:00:00.000000000', '2009-05-01T00:00:00.000000000',
             '2010-03-01T00:00:00.000000000', '2010-04-01T00:00:00.000000000',
             '2010-05-01T00:00:00.000000000', '2011-03-01T00:00:00.000000000',
             '2011-04-01T00:00:00.000000000', '2011-05-01T00:00:00.000000000',
             '2012-03-01T00:00:00.000000000', '2012-04-01T00:00:00.000000000',
             '2012-05-01T00:00:00.000000000', '2013-03-01T00:00:00.000000000',
             '2013-04-01T00:00:00.000000000', '2013-05-01T00:00:00.000000000',
             '2014-03-01T00:00:00.000000000', '2014-04-01T00:00:00.000000000',
             '2014-05-01T00:00:00.000000000', '2015-03-01T00:00:00.000000000',
             '2015-04-01T00:00:00.000000000', '2015-05-01T00:00:00.000000000',
             '2016-03-01T00:00:00.000000000', '2016-04-01T00:00:00.000000000',
             '2016-05-01T00:00:00.000000000', '2017-03-01T00:00:00.000000000',
             '2017-04-01T00:00:00.000000000', '2017-05-01T00:00:00.000000000',
             '2018-03-01T00:00:00.000000000', '2018-04-01T00:00:00.000000000',
             '2018-05-01T00:00:00.000000000', '2019-03-01T00:00:00.000000000',
             '2019-04-01T00:00:00.000000000', '2019-05-01T00:00:00.000000000',
             '2020-03-01T00:00:00.000000000', '2020-04-01T00:00:00.000000000',
             '2020-05-01T00:00:00.000000000'], dtype='datetime64[ns]')
[15]:
# Calculate the weights by grouping by 'time.season'.
weights = month_length.groupby('time.year') / month_length.groupby('time.year').sum()
weights
[15]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
'days_in_month'
  • time: 117
  • 0.337 0.3261 0.337 0.337 0.3261 ... 0.3261 0.337 0.337 0.3261 0.337
    array([0.33695652, 0.32608696, 0.33695652, 0.33695652, 0.32608696,
           0.33695652, 0.33695652, 0.32608696, 0.33695652, 0.33695652,
           0.32608696, 0.33695652, 0.33695652, 0.32608696, 0.33695652,
           0.33695652, 0.32608696, 0.33695652, 0.33695652, 0.32608696,
           0.33695652, 0.33695652, 0.32608696, 0.33695652, 0.33695652,
           0.32608696, 0.33695652, 0.33695652, 0.32608696, 0.33695652,
           0.33695652, 0.32608696, 0.33695652, 0.33695652, 0.32608696,
           0.33695652, 0.33695652, 0.32608696, 0.33695652, 0.33695652,
           0.32608696, 0.33695652, 0.33695652, 0.32608696, 0.33695652,
           0.33695652, 0.32608696, 0.33695652, 0.33695652, 0.32608696,
           0.33695652, 0.33695652, 0.32608696, 0.33695652, 0.33695652,
           0.32608696, 0.33695652, 0.33695652, 0.32608696, 0.33695652,
           0.33695652, 0.32608696, 0.33695652, 0.33695652, 0.32608696,
           0.33695652, 0.33695652, 0.32608696, 0.33695652, 0.33695652,
           0.32608696, 0.33695652, 0.33695652, 0.32608696, 0.33695652,
           0.33695652, 0.32608696, 0.33695652, 0.33695652, 0.32608696,
           0.33695652, 0.33695652, 0.32608696, 0.33695652, 0.33695652,
           0.32608696, 0.33695652, 0.33695652, 0.32608696, 0.33695652,
           0.33695652, 0.32608696, 0.33695652, 0.33695652, 0.32608696,
           0.33695652, 0.33695652, 0.32608696, 0.33695652, 0.33695652,
           0.32608696, 0.33695652, 0.33695652, 0.32608696, 0.33695652,
           0.33695652, 0.32608696, 0.33695652, 0.33695652, 0.32608696,
           0.33695652, 0.33695652, 0.32608696, 0.33695652, 0.33695652,
           0.32608696, 0.33695652])
    • time
      (time)
      datetime64[ns]
      1982-03-01 ... 2020-05-01
      long_name :
      time
      array(['1982-03-01T00:00:00.000000000', '1982-04-01T00:00:00.000000000',
             '1982-05-01T00:00:00.000000000', '1983-03-01T00:00:00.000000000',
             '1983-04-01T00:00:00.000000000', '1983-05-01T00:00:00.000000000',
             '1984-03-01T00:00:00.000000000', '1984-04-01T00:00:00.000000000',
             '1984-05-01T00:00:00.000000000', '1985-03-01T00:00:00.000000000',
             '1985-04-01T00:00:00.000000000', '1985-05-01T00:00:00.000000000',
             '1986-03-01T00:00:00.000000000', '1986-04-01T00:00:00.000000000',
             '1986-05-01T00:00:00.000000000', '1987-03-01T00:00:00.000000000',
             '1987-04-01T00:00:00.000000000', '1987-05-01T00:00:00.000000000',
             '1988-03-01T00:00:00.000000000', '1988-04-01T00:00:00.000000000',
             '1988-05-01T00:00:00.000000000', '1989-03-01T00:00:00.000000000',
             '1989-04-01T00:00:00.000000000', '1989-05-01T00:00:00.000000000',
             '1990-03-01T00:00:00.000000000', '1990-04-01T00:00:00.000000000',
             '1990-05-01T00:00:00.000000000', '1991-03-01T00:00:00.000000000',
             '1991-04-01T00:00:00.000000000', '1991-05-01T00:00:00.000000000',
             '1992-03-01T00:00:00.000000000', '1992-04-01T00:00:00.000000000',
             '1992-05-01T00:00:00.000000000', '1993-03-01T00:00:00.000000000',
             '1993-04-01T00:00:00.000000000', '1993-05-01T00:00:00.000000000',
             '1994-03-01T00:00:00.000000000', '1994-04-01T00:00:00.000000000',
             '1994-05-01T00:00:00.000000000', '1995-03-01T00:00:00.000000000',
             '1995-04-01T00:00:00.000000000', '1995-05-01T00:00:00.000000000',
             '1996-03-01T00:00:00.000000000', '1996-04-01T00:00:00.000000000',
             '1996-05-01T00:00:00.000000000', '1997-03-01T00:00:00.000000000',
             '1997-04-01T00:00:00.000000000', '1997-05-01T00:00:00.000000000',
             '1998-03-01T00:00:00.000000000', '1998-04-01T00:00:00.000000000',
             '1998-05-01T00:00:00.000000000', '1999-03-01T00:00:00.000000000',
             '1999-04-01T00:00:00.000000000', '1999-05-01T00:00:00.000000000',
             '2000-03-01T00:00:00.000000000', '2000-04-01T00:00:00.000000000',
             '2000-05-01T00:00:00.000000000', '2001-03-01T00:00:00.000000000',
             '2001-04-01T00:00:00.000000000', '2001-05-01T00:00:00.000000000',
             '2002-03-01T00:00:00.000000000', '2002-04-01T00:00:00.000000000',
             '2002-05-01T00:00:00.000000000', '2003-03-01T00:00:00.000000000',
             '2003-04-01T00:00:00.000000000', '2003-05-01T00:00:00.000000000',
             '2004-03-01T00:00:00.000000000', '2004-04-01T00:00:00.000000000',
             '2004-05-01T00:00:00.000000000', '2005-03-01T00:00:00.000000000',
             '2005-04-01T00:00:00.000000000', '2005-05-01T00:00:00.000000000',
             '2006-03-01T00:00:00.000000000', '2006-04-01T00:00:00.000000000',
             '2006-05-01T00:00:00.000000000', '2007-03-01T00:00:00.000000000',
             '2007-04-01T00:00:00.000000000', '2007-05-01T00:00:00.000000000',
             '2008-03-01T00:00:00.000000000', '2008-04-01T00:00:00.000000000',
             '2008-05-01T00:00:00.000000000', '2009-03-01T00:00:00.000000000',
             '2009-04-01T00:00:00.000000000', '2009-05-01T00:00:00.000000000',
             '2010-03-01T00:00:00.000000000', '2010-04-01T00:00:00.000000000',
             '2010-05-01T00:00:00.000000000', '2011-03-01T00:00:00.000000000',
             '2011-04-01T00:00:00.000000000', '2011-05-01T00:00:00.000000000',
             '2012-03-01T00:00:00.000000000', '2012-04-01T00:00:00.000000000',
             '2012-05-01T00:00:00.000000000', '2013-03-01T00:00:00.000000000',
             '2013-04-01T00:00:00.000000000', '2013-05-01T00:00:00.000000000',
             '2014-03-01T00:00:00.000000000', '2014-04-01T00:00:00.000000000',
             '2014-05-01T00:00:00.000000000', '2015-03-01T00:00:00.000000000',
             '2015-04-01T00:00:00.000000000', '2015-05-01T00:00:00.000000000',
             '2016-03-01T00:00:00.000000000', '2016-04-01T00:00:00.000000000',
             '2016-05-01T00:00:00.000000000', '2017-03-01T00:00:00.000000000',
             '2017-04-01T00:00:00.000000000', '2017-05-01T00:00:00.000000000',
             '2018-03-01T00:00:00.000000000', '2018-04-01T00:00:00.000000000',
             '2018-05-01T00:00:00.000000000', '2019-03-01T00:00:00.000000000',
             '2019-04-01T00:00:00.000000000', '2019-05-01T00:00:00.000000000',
             '2020-03-01T00:00:00.000000000', '2020-04-01T00:00:00.000000000',
             '2020-05-01T00:00:00.000000000'], dtype='datetime64[ns]')
    • year
      (time)
      int64
      1982 1982 1982 ... 2020 2020 2020
      array([1982, 1982, 1982, 1983, 1983, 1983, 1984, 1984, 1984, 1985, 1985,
             1985, 1986, 1986, 1986, 1987, 1987, 1987, 1988, 1988, 1988, 1989,
             1989, 1989, 1990, 1990, 1990, 1991, 1991, 1991, 1992, 1992, 1992,
             1993, 1993, 1993, 1994, 1994, 1994, 1995, 1995, 1995, 1996, 1996,
             1996, 1997, 1997, 1997, 1998, 1998, 1998, 1999, 1999, 1999, 2000,
             2000, 2000, 2001, 2001, 2001, 2002, 2002, 2002, 2003, 2003, 2003,
             2004, 2004, 2004, 2005, 2005, 2005, 2006, 2006, 2006, 2007, 2007,
             2007, 2008, 2008, 2008, 2009, 2009, 2009, 2010, 2010, 2010, 2011,
             2011, 2011, 2012, 2012, 2012, 2013, 2013, 2013, 2014, 2014, 2014,
             2015, 2015, 2015, 2016, 2016, 2016, 2017, 2017, 2017, 2018, 2018,
             2018, 2019, 2019, 2019, 2020, 2020, 2020])
[16]:
# Test that the sum of the weights for the season is 1.0
np.testing.assert_allclose(weights.groupby('time.year').sum().values, np.ones(39)) ## the weight is one for each year
[30]:
# Calculate the weighted average
SEAS5_Siberia_weighted = (SEAS5_Siberia * weights).groupby('time.year').sum(dim='time', min_count = 3)
SEAS5_Siberia_weighted
[30]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 41
    • leadtime: 3
    • longitude: 132
    • number: 51
    • year: 39
    • leadtime
      (leadtime)
      int64
      2 3 4
      array([2, 3, 4])
    • latitude
      (latitude)
      float32
      70.0 69.0 68.0 ... 32.0 31.0 30.0
      units :
      degrees_north
      long_name :
      latitude
      array([70., 69., 68., 67., 66., 65., 64., 63., 62., 61., 60., 59., 58., 57.,
             56., 55., 54., 53., 52., 51., 50., 49., 48., 47., 46., 45., 44., 43.,
             42., 41., 40., 39., 38., 37., 36., 35., 34., 33., 32., 31., 30.],
            dtype=float32)
    • number
      (number)
      int64
      0 1 2 3 4 5 6 ... 45 46 47 48 49 50
      long_name :
      ensemble_member
      array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,
             18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
             36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50])
    • longitude
      (longitude)
      float32
      -11.0 -10.0 -9.0 ... 119.0 120.0
      units :
      degrees_east
      long_name :
      longitude
      array([-11., -10.,  -9.,  -8.,  -7.,  -6.,  -5.,  -4.,  -3.,  -2.,  -1.,   0.,
               1.,   2.,   3.,   4.,   5.,   6.,   7.,   8.,   9.,  10.,  11.,  12.,
              13.,  14.,  15.,  16.,  17.,  18.,  19.,  20.,  21.,  22.,  23.,  24.,
              25.,  26.,  27.,  28.,  29.,  30.,  31.,  32.,  33.,  34.,  35.,  36.,
              37.,  38.,  39.,  40.,  41.,  42.,  43.,  44.,  45.,  46.,  47.,  48.,
              49.,  50.,  51.,  52.,  53.,  54.,  55.,  56.,  57.,  58.,  59.,  60.,
              61.,  62.,  63.,  64.,  65.,  66.,  67.,  68.,  69.,  70.,  71.,  72.,
              73.,  74.,  75.,  76.,  77.,  78.,  79.,  80.,  81.,  82.,  83.,  84.,
              85.,  86.,  87.,  88.,  89.,  90.,  91.,  92.,  93.,  94.,  95.,  96.,
              97.,  98.,  99., 100., 101., 102., 103., 104., 105., 106., 107., 108.,
             109., 110., 111., 112., 113., 114., 115., 116., 117., 118., 119., 120.],
            dtype=float32)
    • year
      (year)
      int64
      1982 1983 1984 ... 2018 2019 2020
      array([1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
             1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
             2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
             2018, 2019, 2020])
    • t2m
      (year, leadtime, number, latitude, longitude)
      float64
      268.8 269.4 269.8 ... 288.7 289.9
      array([[[[[268.75350554, 269.35344066, 269.79132744, ...,
                 262.55172962, 262.54307739, 262.20887126],
                [270.21908138, 270.57392684, 270.89786264, ...,
                 263.27343833, 263.27937765, 263.32882027],
                [270.91404724, 271.22457654, 271.52035423, ...,
                 263.81292393, 264.07058119, 264.20893114],
                ...,
                [290.17691206, 290.30752763, 290.34111023, ...,
                 288.5618389 , 288.28401184, 288.16064851],
                [290.5469639 , 290.80879775, 286.09820822, ...,
                 289.04761406, 288.5331192 , 288.58973561],
                [290.95285631, 291.6717171 , 289.2621324 , ...,
                 287.62602433, 287.41176672, 288.38811294]],
      
               [[272.16281526, 272.38150489, 272.55040476, ...,
                 260.74969582, 260.64605929, 260.21044822],
                [272.94019616, 273.15438677, 273.36989527, ...,
                 261.62315153, 261.5881754 , 261.63137054],
                [273.46147521, 273.7116603 , 273.91968072, ...,
                 262.16839848, 262.43460564, 262.59700958],
                ...,
                [289.92039589, 290.08851458, 290.71548064, ...,
                 287.90944738, 287.75394572, 287.63379669],
                [290.26652759, 290.66084256, 286.72912963, ...,
                 288.48427018, 288.05350163, 288.13230398],
                [290.74434861, 291.45753147, 289.36278501, ...,
                 287.33462956, 287.14738663, 288.05196812]],
      
               [[268.10085827, 268.66115537, 269.18113908, ...,
                 261.73933991, 261.69452253, 261.42376328],
                [270.56810926, 270.86017443, 271.14864416, ...,
                 262.24157997, 262.2723397 , 262.50122634],
                [271.67436285, 271.84799194, 271.99778117, ...,
                 262.79592099, 263.06410383, 263.28732897],
                ...,
                [290.09161112, 290.22489133, 289.99205846, ...,
                 287.67904862, 287.52714472, 287.51133363],
                [290.46056101, 290.35953422, 285.66259301, ...,
                 288.23097494, 287.85794764, 288.0197608 ],
                [290.73134281, 291.28360516, 288.11794281, ...,
                 286.90373296, 286.77499356, 287.91036059]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]],
      
      
              [[[272.01942178, 272.17594677, 272.30074476, ...,
                 261.95898918, 261.87874487, 261.4954557 ],
                [272.35859879, 272.55891518, 272.77305006, ...,
                 262.96655058, 263.00290464, 263.1122682 ],
                [272.548853  , 272.80328369, 273.07029757, ...,
                 263.39312976, 263.6975431 , 263.92171379],
                ...,
                [289.94303927, 289.94609899, 290.76781298, ...,
                 287.95772453, 287.80829786, 287.78096141],
                [290.20352438, 290.48754452, 287.75627136, ...,
                 288.66799661, 288.30140056, 288.3357189 ],
                [290.51767631, 291.22418279, 289.91647671, ...,
                 287.58335843, 287.26351133, 288.24713466]],
      
               [[269.62163345, 270.08812448, 270.36757461, ...,
                 264.11786519, 264.03060349, 263.67637435],
                [271.37493067, 271.6157273 , 271.84624116, ...,
                 264.92823062, 264.90424811, 265.00203439],
                [272.27830903, 272.55203877, 272.76184679, ...,
                 265.46449744, 265.73204604, 265.92875008],
                ...,
                [291.09478926, 291.15544891, 292.84243575, ...,
                 287.98866504, 287.91944321, 287.88262541],
                [291.31895215, 291.8144319 , 289.77633004, ...,
                 288.53421253, 288.20655325, 288.3903248 ],
                [291.63893658, 292.18391452, 291.58768098, ...,
                 287.00841688, 286.76820539, 288.12835926]],
      
               [[267.84202742, 268.31475333, 268.78350863, ...,
                 262.75208929, 262.71681562, 262.4238802 ],
                [270.28589564, 270.58487005, 270.91825369, ...,
                 263.26498015, 263.2775305 , 263.42545352],
                [271.46566839, 271.67099165, 271.84682133, ...,
                 263.5202849 , 263.83684374, 264.08095451],
                ...,
                [289.99322742, 290.11977619, 290.63532158, ...,
                 287.44218312, 287.3232591 , 287.15448695],
                [290.39010554, 290.64263219, 286.67386362, ...,
                 288.30928902, 287.88807778, 287.95454274],
                [290.87919053, 291.61392311, 289.65745843, ...,
                 287.19998799, 286.97579027, 287.91245137]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]],
      
      
              [[[269.47269241, 269.90395322, 270.27371249, ...,
                 262.85709016, 262.90585194, 262.60849762],
                [270.81485549, 271.06822735, 271.36942523, ...,
                 263.61777729, 263.71331887, 263.83812879],
                [271.50338878, 271.80148448, 272.03336898, ...,
                 264.02712051, 264.32562123, 264.48892013],
                ...,
                [290.54704683, 290.73819666, 291.14269555, ...,
                 288.38625833, 288.19211512, 288.16508716],
                [291.00812331, 290.95115562, 286.8438598 , ...,
                 289.0037802 , 288.56120267, 288.78252643],
                [291.39228788, 291.79506451, 289.28476251, ...,
                 287.67508001, 287.46972623, 288.3837068 ]],
      
               [[270.28868567, 270.70503998, 271.06088157, ...,
                 263.36739184, 263.32399468, 262.96173461],
                [271.82734912, 272.19725899, 272.43082229, ...,
                 263.8656933 , 263.80315466, 263.84219957],
                [272.5956401 , 272.8459685 , 273.00458527, ...,
                 264.5178294 , 264.70029184, 264.82370741],
                ...,
                [290.77859232, 290.91199759, 292.17247109, ...,
                 288.44094683, 288.37852412, 288.43263112],
                [291.10062143, 291.60515694, 288.527771  , ...,
                 288.94203053, 288.65078569, 288.90679766],
                [291.65645035, 292.43133512, 290.89697962, ...,
                 287.55064326, 287.37334442, 288.63343313]],
      
               [[268.12705596, 268.9738398 , 269.70374962, ...,
                 263.04365108, 263.03619053, 262.74024283],
                [270.04698811, 270.63159279, 271.06295113, ...,
                 263.92232679, 264.00273099, 264.22063695],
                [271.0349267 , 271.39073447, 271.69596067, ...,
                 264.52542015, 264.82180239, 265.09378433],
                ...,
                [290.23004847, 290.40863369, 289.50374537, ...,
                 289.3489151 , 288.98860931, 288.82091555],
                [290.71542557, 290.34764199, 285.25999583, ...,
                 289.89107613, 289.39839736, 289.38658905],
                [291.10257456, 291.425696  , 287.44691335, ...,
                 288.06834976, 287.93781612, 288.99947424]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]]],
      
      
      
             [[[[271.7475304 , 271.88761106, 272.09140181, ...,
                 261.89233697, 261.8229327 , 261.52690788],
                [272.3356718 , 272.52735934, 272.80275826, ...,
                 262.76916189, 262.71941061, 262.75636109],
                [273.04713307, 273.12087018, 273.18161442, ...,
                 263.24809265, 263.34314346, 263.41271177],
                ...,
                [289.78732034, 289.81983881, 290.76696711, ...,
                 287.67535036, 287.4997406 , 287.32081106],
                [289.9925766 , 290.46393121, 287.30083432, ...,
                 288.01208828, 287.51840542, 287.67965731],
                [290.44901707, 291.15610239, 289.54470261, ...,
                 286.43084087, 286.20800615, 287.30673284]],
      
               [[272.10705334, 272.26295836, 272.43364749, ...,
                 261.03694286, 260.91581776, 260.63163708],
                [272.5203403 , 272.69285915, 272.9402625 , ...,
                 261.85394884, 261.91606107, 262.17291691],
                [272.87955807, 273.13774208, 273.34500785, ...,
                 262.55345651, 262.81673431, 263.02108765],
                ...,
                [289.94548963, 290.08182459, 290.98565475, ...,
                 287.42931797, 287.42252284, 287.41523643],
                [290.08906489, 290.37011785, 286.84888359, ...,
                 288.06403915, 287.72977414, 287.89800528],
                [290.41396663, 291.01826709, 288.98206926, ...,
                 286.64910756, 286.52424224, 287.78587673]],
      
               [[270.85000478, 271.1382788 , 271.41142207, ...,
                 261.6826701 , 261.73094177, 261.56000386],
                [271.45655922, 271.77424323, 272.10482456, ...,
                 262.11987039, 262.32431495, 262.72996969],
                [272.2410421 , 272.39014833, 272.51841869, ...,
                 262.54585017, 263.05902912, 263.46728781],
                ...,
                [290.45212024, 290.50223541, 291.85311525, ...,
                 288.02641064, 287.77989097, 287.58242267],
                [290.61274985, 290.91171497, 288.24951736, ...,
                 288.50650986, 287.99612294, 288.03067116],
                [290.93377487, 291.51465474, 290.33668618, ...,
                 286.93777565, 286.62325088, 287.72379635]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]],
      
      
              [[[267.01571755, 267.7249119 , 268.43504566, ...,
                 262.91721659, 262.86081878, 262.50095301],
                [269.18376193, 269.71886942, 270.20961297, ...,
                 263.35829793, 263.42892191, 263.58645414],
                [270.5174408 , 270.82258871, 271.10857391, ...,
                 263.62330362, 263.97317206, 264.23718593],
                ...,
                [290.35020679, 290.41243279, 290.93342192, ...,
                 288.49641551, 288.40637671, 288.39657261],
                [290.64273702, 290.54996822, 286.85201496, ...,
                 289.26175557, 288.85507202, 289.11048491],
                [290.92822033, 291.37545577, 289.07391059, ...,
                 287.55088872, 287.46366053, 288.78161289]],
      
               [[270.99107427, 271.40422954, 271.68102729, ...,
                 264.13828908, 264.10614345, 263.75074436],
                [272.14092089, 272.32706053, 272.53446065, ...,
                 264.61843507, 264.72027455, 264.8180333 ],
                [272.6053427 , 272.87722612, 273.07831142, ...,
                 264.89303854, 265.19488492, 265.36357813],
                ...,
                [289.73423402, 289.82384458, 290.93463831, ...,
                 288.17775594, 288.04537533, 287.96525507],
                [289.9820142 , 290.44941015, 287.5850087 , ...,
                 288.59324016, 288.08758611, 288.26539977],
                [290.41728973, 291.15102751, 289.76637434, ...,
                 286.89140486, 286.80247829, 287.93314594]],
      
               [[271.95847685, 272.14712226, 272.33028545, ...,
                 263.3275047 , 263.3520327 , 263.08192145],
                [272.36033829, 272.60467728, 272.89950296, ...,
                 263.73358718, 263.82892294, 263.9927889 ],
                [272.7816391 , 272.97621287, 273.14991793, ...,
                 264.0797421 , 264.28608007, 264.45214545],
                ...,
                [290.38772284, 290.45520219, 290.86244832, ...,
                 287.69283461, 287.5656861 , 287.41075698],
                [290.70745418, 290.83466604, 287.60322339, ...,
                 288.20011371, 287.75979183, 287.93379311],
                [291.12443609, 291.74756921, 289.64999854, ...,
                 286.65948387, 286.56818755, 287.73600006]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]],
      
      
              [[[266.99215798, 267.61951811, 268.28405264, ...,
                 261.35990458, 261.34436864, 261.09028957],
                [267.87654512, 268.52612238, 269.34839597, ...,
                 262.55500827, 262.61484411, 262.73652019],
                [268.98774089, 269.46910991, 270.20723227, ...,
                 263.39287136, 263.53932389, 263.67918976],
                ...,
                [289.87329234, 290.04679871, 290.43437361, ...,
                 287.74817293, 287.58596968, 287.66942663],
                [290.30215587, 290.49775464, 286.46454853, ...,
                 288.33526611, 287.86855615, 288.16297216],
                [290.79765154, 291.45570307, 288.46467259, ...,
                 287.05143439, 286.81564729, 287.95282646]],
      
               [[271.60827504, 271.77628824, 271.94160826, ...,
                 262.73106467, 262.72924506, 262.42559483],
                [272.00671354, 272.2093058 , 272.45207447, ...,
                 263.71528493, 263.79081212, 263.89961856],
                [272.18741309, 272.46651691, 272.77156531, ...,
                 264.34700377, 264.69752668, 264.87907824],
                ...,
                [289.88337608, 289.93618675, 290.49802764, ...,
                 288.02513123, 287.81245555, 287.69967917],
                [290.30364493, 290.35563792, 286.10610033, ...,
                 288.78874605, 288.29800316, 288.33076245],
                [290.6979463 , 291.17077371, 288.5185454 , ...,
                 287.45549774, 287.32450104, 288.36798361]],
      
               [[268.36538597, 268.92360455, 269.57636891, ...,
                 262.84874145, 262.76858703, 262.32981806],
                [269.13382986, 269.72068654, 270.50593666, ...,
                 263.67669661, 263.65795135, 263.61932638],
                [270.33336208, 270.7301921 , 271.1726804 , ...,
                 264.38918288, 264.58643208, 264.60933188],
                ...,
                [290.70302018, 290.79481573, 291.49682584, ...,
                 287.91802614, 287.71428946, 287.58104308],
                [291.04427669, 291.21796749, 287.39548293, ...,
                 288.4911499 , 287.96966188, 288.06044504],
                [291.42326156, 292.09355263, 289.50624118, ...,
                 287.05656334, 286.90948619, 287.9250004 ]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]]],
      
      
      
             [[[[270.98101873, 271.20574155, 271.43235314, ...,
                 264.19043101, 264.13514146, 263.81128742],
                [271.74104243, 272.02170065, 272.34381004, ...,
                 264.63754173, 264.62661926, 264.70917063],
                [272.36871139, 272.67980824, 272.95953966, ...,
                 264.92492361, 265.10717707, 265.27764627],
                ...,
                [290.26611759, 290.39904022, 290.93879667, ...,
                 287.64681211, 287.36550538, 287.30630327],
                [290.60934647, 290.72768601, 286.82429737, ...,
                 288.05676668, 287.65737252, 287.82215848],
                [290.94876828, 291.41162541, 289.11991385, ...,
                 286.52590213, 286.36476434, 287.47014916]],
      
               [[272.52057316, 272.64348337, 272.75499593, ...,
                 265.22490394, 265.09588507, 264.69860077],
                [272.92889437, 273.06704447, 273.26351763, ...,
                 265.72432775, 265.5216834 , 265.40303172],
                [273.3863814 , 273.54594123, 273.7055329 , ...,
                 266.18197433, 266.09641996, 266.03978563],
                ...,
                [289.95491293, 290.14954575, 290.20135763, ...,
                 287.84221118, 287.58158377, 287.47633826],
                [290.34916853, 290.31001414, 285.54853025, ...,
                 288.28839509, 287.91403895, 288.03429081],
                [290.73549619, 291.38742596, 288.06825654, ...,
                 287.02995201, 286.7133726 , 287.76656972]],
      
               [[271.90650277, 272.11057812, 272.29509669, ...,
                 263.14432426, 263.18756468, 262.91888444],
                [272.1505525 , 272.42344898, 272.74364471, ...,
                 263.98991858, 264.10090753, 264.25123049],
                [272.49634088, 272.80905616, 273.11868916, ...,
                 264.65836865, 264.95721568, 265.1457085 ],
                ...,
                [290.15883371, 290.35476685, 290.396151  , ...,
                 289.71578979, 289.46464174, 289.39806167],
                [290.46859808, 290.39739891, 286.15307219, ...,
                 290.19202954, 289.66904848, 289.83679597],
                [290.76094652, 291.16936626, 288.01048942, ...,
                 288.31192979, 288.10531782, 289.29021155]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]],
      
      
              [[[271.59022953, 271.85045491, 272.0788415 , ...,
                 262.27192224, 262.03352439, 261.53881504],
                [272.06720137, 272.26865354, 272.57545637, ...,
                 263.00467483, 262.89857898, 262.8987382 ],
                [272.30702707, 272.5427193 , 272.82410928, ...,
                 263.38337542, 263.52407339, 263.60989396],
                ...,
                [289.94274604, 290.11296811, 290.37430042, ...,
                 288.68376425, 288.38932933, 288.21757176],
                [290.28955775, 290.34734776, 286.32795616, ...,
                 289.184908  , 288.69753265, 288.76864027],
                [290.67016801, 291.16861294, 288.47373631, ...,
                 288.13562609, 287.88764622, 288.73049661]],
      
               [[272.03680619, 272.16379613, 272.29314987, ...,
                 264.7695218 , 264.62230284, 264.24838108],
                [272.44026051, 272.56463059, 272.78737076, ...,
                 265.41402303, 265.37495704, 265.4684362 ],
                [272.64782018, 272.87914973, 273.13138746, ...,
                 265.75084487, 265.91762709, 266.03723509],
                ...,
                [290.37346948, 290.5497745 , 290.81126304, ...,
                 288.02901392, 287.77400871, 287.75323354],
                [290.79262377, 290.72218422, 286.76780634, ...,
                 288.44627049, 287.86769834, 287.99510823],
                [291.11440211, 291.69059986, 289.23084458, ...,
                 286.86808445, 286.55709043, 287.55009925]],
      
               [[271.92733931, 272.18557308, 272.40964674, ...,
                 263.35793586, 263.36327561, 263.08454149],
                [272.38491456, 272.67187235, 272.94588802, ...,
                 264.08867396, 264.16553929, 264.32888761],
                [272.6226999 , 272.9394727 , 273.28270987, ...,
                 264.60704206, 264.95435366, 265.23080594],
                ...,
                [290.32895826, 290.45705381, 292.1100988 , ...,
                 288.80606444, 288.44607179, 288.29881618],
                [290.53070002, 291.18354665, 288.59045112, ...,
                 289.20165419, 288.61419976, 288.76256064],
                [290.99544724, 291.77815545, 290.97817761, ...,
                 287.92942246, 287.48823912, 288.48410366]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]],
      
      
              [[[271.2595855 , 271.52530073, 271.77387238, ...,
                 263.47515537, 263.27990242, 262.79839242],
                [271.80890722, 272.1322121 , 272.45480612, ...,
                 263.93850725, 263.8021761 , 263.76142651],
                [272.3342922 , 272.66201981, 272.92518649, ...,
                 264.19948263, 264.3331541 , 264.4076344 ],
                ...,
                [289.9091359 , 290.00485263, 290.78839543, ...,
                 288.00806294, 287.77391749, 287.62622004],
                [290.13292097, 290.56590735, 286.75686247, ...,
                 288.52002782, 288.07145558, 288.19515096],
                [290.65011298, 291.64242952, 289.82370592, ...,
                 287.276678  , 287.02721106, 288.03961945]],
      
               [[271.02584806, 271.26146598, 271.44849396, ...,
                 264.32139853, 264.35232511, 264.1171185 ],
                [271.70170626, 271.87716874, 272.11674931, ...,
                 264.84164362, 264.87022632, 264.93105814],
                [272.08494966, 272.31136554, 272.55024686, ...,
                 265.17040949, 265.36103025, 265.49005027],
                ...,
                [289.5563318 , 289.61797465, 290.14316791, ...,
                 287.92260576, 287.7869193 , 287.73336228],
                [289.82744399, 290.19176914, 286.61266957, ...,
                 288.40352299, 287.90956248, 288.11183399],
                [290.35250987, 291.07055598, 289.36544004, ...,
                 286.7060998 , 286.5079568 , 287.57488317]],
      
               [[271.80605548, 271.90283104, 272.01789922, ...,
                 266.14777109, 266.21926681, 265.97679553],
                [271.97275477, 272.1504908 , 272.37474856, ...,
                 266.37649851, 266.42484317, 266.56504142],
                [272.3907819 , 272.56412904, 272.72256337, ...,
                 266.43330781, 266.72556537, 266.93288156],
                ...,
                [290.31418079, 290.29192684, 290.88624871, ...,
                 287.54737655, 287.33561541, 287.09024147],
                [290.64176344, 290.8200113 , 287.66086877, ...,
                 288.10420293, 287.54775935, 287.57830943],
                [290.99221769, 291.66225068, 289.74332428, ...,
                 286.54358972, 286.38382986, 287.44902901]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]]],
      
      
      
             ...,
      
      
      
             [[[[272.8782405 , 273.11628093, 273.39408045, ...,
                 264.70130771, 264.68789109, 264.44581438],
                [273.18412316, 273.48433354, 273.91882689, ...,
                 265.13904936, 265.2159938 , 265.42031131],
                [273.5940429 , 273.90443653, 274.23717432, ...,
                 265.50804138, 265.74345912, 265.94916899],
                ...,
                [290.72387098, 290.58824456, 292.48958754, ...,
                 288.92995984, 288.7172961 , 288.67324232],
                [290.69337331, 291.0527566 , 288.82633309, ...,
                 289.51051795, 289.09345776, 289.27122232],
                [291.14275725, 291.6620626 , 290.76832216, ...,
                 288.06669915, 287.84391751, 289.00494053]],
      
               [[273.28333681, 273.41484866, 273.55140089, ...,
                 262.40197372, 262.42008723, 262.12978529],
                [273.61094301, 273.83039557, 274.14721912, ...,
                 263.2152025 , 263.29388826, 263.4473192 ],
                [273.73728877, 274.05926746, 274.41896024, ...,
                 263.92291575, 264.17958848, 264.31332796],
                ...,
                [290.66721278, 290.59665182, 292.44852215, ...,
                 289.44350102, 289.24550131, 289.14523083],
                [290.79858863, 291.26844091, 289.04948392, ...,
                 289.9778041 , 289.70043415, 289.78395313],
                [291.35347283, 291.942004  , 291.35295271, ...,
                 288.82408971, 288.56691841, 289.50104655]],
      
               [[273.06394196, 273.251228  , 273.43026866, ...,
                 261.3823821 , 261.39190027, 261.08840826],
                [273.24218352, 273.55289293, 273.96917393, ...,
                 262.18249495, 262.20253322, 262.31693201],
                [273.42874743, 273.80582262, 274.19229391, ...,
                 262.83474101, 263.07293253, 263.21082588],
                ...,
                [290.78120754, 290.6180818 , 292.81831393, ...,
                 289.34827257, 289.09175574, 289.03754823],
                [290.70642985, 291.31038997, 289.72737387, ...,
                 289.73073876, 289.25857146, 289.38445381],
                [291.24952797, 291.84621429, 292.12659288, ...,
                 288.35817918, 288.15540745, 289.2298312 ]],
      
               ...,
      
               [[272.71315367, 272.85080155, 273.01518084, ...,
                 261.86902602, 261.72402506, 261.32265489],
                [273.02283876, 273.28557985, 273.60906883, ...,
                 262.53414917, 262.51632823, 262.59504169],
                [273.35055874, 273.70000027, 274.01461294, ...,
                 262.89058354, 263.22074542, 263.33006552],
                ...,
                [290.2546599 , 290.2485816 , 291.64814957, ...,
                 289.1731783 , 289.0019989 , 288.80845277],
                [290.37742018, 290.66678387, 288.51139832, ...,
                 289.85551519, 289.39419788, 289.42647884],
                [290.75326737, 291.40361985, 290.68102828, ...,
                 288.74244922, 288.49346891, 289.43227552]],
      
               [[272.97882777, 273.14816914, 273.30516981, ...,
                 267.86143162, 267.82035529, 267.4897932 ],
                [273.31502765, 273.51514833, 273.86077781, ...,
                 268.21266639, 268.25972283, 268.3791212 ],
                [273.59093044, 273.88545459, 274.15546019, ...,
                 268.59248286, 268.80292411, 268.93482142],
                ...,
                [289.1634485 , 289.17020483, 289.50392284, ...,
                 287.00441841, 287.12357795, 287.20489601],
                [289.44075178, 289.4336236 , 285.62933814, ...,
                 287.46303857, 287.28853076, 287.56026028],
                [289.82355599, 290.22659733, 287.77243904, ...,
                 286.54065472, 286.33714825, 287.38385939]],
      
               [[272.83000648, 273.07878411, 273.32021929, ...,
                 262.97245109, 262.99381986, 262.77369027],
                [273.05047442, 273.41294264, 273.96456876, ...,
                 263.30581085, 263.45249358, 263.78490299],
                [273.38391047, 273.72937045, 274.15199014, ...,
                 263.68676675, 263.96661211, 264.21467375],
                ...,
                [290.26292552, 290.03518345, 291.86267654, ...,
                 287.53295135, 287.49171381, 287.51268005],
                [290.19467793, 290.60337863, 288.69362508, ...,
                 288.51360387, 288.12609532, 288.29934891],
                [290.71779168, 291.14000437, 290.72875678, ...,
                 287.80314736, 287.48801323, 288.50297447]]],
      
      
              [[[273.42582736, 273.65427565, 273.92263728, ...,
                 263.31588082, 263.30705941, 262.94568004],
                [273.70837867, 274.00802712, 274.51745771, ...,
                 264.43640386, 264.47942186, 264.48748846],
                [274.20278831, 274.47269008, 274.74166472, ...,
                 264.93526774, 265.15753124, 265.22242836],
                ...,
                [290.29917875, 290.38089885, 291.24427331, ...,
                 289.3404007 , 289.29219984, 289.38007156],
                [290.55357659, 290.76061315, 288.00360041, ...,
                 290.18448042, 289.92354484, 290.19743281],
                [290.96025119, 291.70971514, 290.24737715, ...,
                 289.21578084, 289.10289433, 290.15601681]],
      
               [[272.28271484, 272.46845809, 272.68081997, ...,
                 263.32561858, 263.25040917, 262.8791625 ],
                [272.78187959, 273.0446031 , 273.38244894, ...,
                 263.59775576, 263.6175625 , 263.74140764],
                [273.0513707 , 273.35431273, 273.79386504, ...,
                 263.66680377, 263.95110089, 264.12352919],
                ...,
                [290.20114766, 290.22323078, 290.78372922, ...,
                 288.69034046, 288.64289624, 288.76250292],
                [290.47240979, 290.3944188 , 287.21305947, ...,
                 289.27594492, 288.96265743, 289.16534324],
                [290.68984687, 291.02307859, 289.28512805, ...,
                 288.07927969, 288.01375381, 289.12991864]],
      
               [[273.15388091, 273.33342876, 273.46801526, ...,
                 264.0097706 , 263.94307062, 263.60782358],
                [273.3012075 , 273.55194224, 273.94317959, ...,
                 264.67615343, 264.6305003 , 264.69499986],
                [273.26600249, 273.5780497 , 273.97499881, ...,
                 265.19939406, 265.37117402, 265.49769808],
                ...,
                [289.99511818, 290.01178178, 290.80024786, ...,
                 289.25293035, 289.0073    , 288.95799056],
                [290.18045542, 290.35269231, 286.46201855, ...,
                 289.73077658, 289.32383993, 289.57757568],
                [290.63384711, 291.05884884, 288.60001307, ...,
                 288.48958919, 288.29472915, 289.1912059 ]],
      
               ...,
      
               [[274.36579331, 274.42805879, 274.52264736, ...,
                 264.82728776, 264.72460374, 264.27187513],
                [274.52383323, 274.67552583, 274.88997053, ...,
                 265.34242912, 265.32669366, 265.39633444],
                [274.70960335, 274.87998233, 275.03266973, ...,
                 265.6871104 , 265.83011611, 265.99093363],
                ...,
                [290.2364837 , 290.39978624, 290.94058228, ...,
                 288.30591915, 288.29663517, 288.3346614 ],
                [290.51920916, 290.62191043, 287.18218895, ...,
                 289.08536729, 288.77412879, 289.1002937 ],
                [290.85778178, 291.37057197, 289.0381337 , ...,
                 288.04356252, 287.82547992, 289.0703188 ]],
      
               [[273.37923199, 273.54859758, 273.70961463, ...,
                 264.6201759 , 264.63220862, 264.40162758],
                [273.70819921, 273.96014305, 274.30364559, ...,
                 265.13772981, 265.14926512, 265.29747523],
                [273.76323567, 274.05349201, 274.43023615, ...,
                 265.59354235, 265.85463781, 265.9982741 ],
                ...,
                [290.58376511, 290.57014532, 292.58704244, ...,
                 288.20604805, 288.12666122, 288.06188965],
                [290.64638586, 291.35678764, 289.43961566, ...,
                 288.85266578, 288.56604236, 288.69195955],
                [291.12325486, 291.83666926, 291.71682706, ...,
                 288.02925442, 287.8886052 , 288.85119695]],
      
               [[272.73908698, 272.8422616 , 272.99466241, ...,
                 263.39538442, 263.27624545, 262.82583618],
                [273.15471052, 273.43777433, 273.91295624, ...,
                 264.00679746, 263.96312183, 263.98033739],
                [273.70240618, 274.02187679, 274.33187734, ...,
                 264.27918973, 264.45655358, 264.6031524 ],
                ...,
                [289.89015828, 289.8597495 , 290.70813121, ...,
                 288.89907804, 288.75661966, 288.66688737],
                [290.02933933, 290.13088691, 287.06090446, ...,
                 289.51242032, 289.0693648 , 289.11628093],
                [290.30880638, 290.87161752, 288.77641529, ...,
                 288.10568536, 287.88543701, 288.96135214]]],
      
      
              [[[272.20156694, 272.46946053, 272.7196171 , ...,
                 266.31352118, 266.47516649, 266.40980497],
                [272.72964079, 273.03638657, 273.51306318, ...,
                 266.59863696, 266.67801169, 266.88867105],
                [273.12965128, 273.49708922, 273.9407206 , ...,
                 266.89047407, 267.209913  , 267.41442257],
                ...,
                [290.56418079, 290.65213013, 291.89133951, ...,
                 287.87920048, 287.88248808, 288.02972478],
                [290.82785167, 291.2426111 , 288.45593096, ...,
                 288.57739954, 288.27376988, 288.52076323],
                [291.34456469, 291.98971226, 290.9263027 , ...,
                 287.35731739, 287.17716847, 288.40469029]],
      
               [[272.77342788, 272.97942551, 273.12308668, ...,
                 262.0126303 , 261.96240102, 261.59182308],
                [273.26011824, 273.57140715, 273.94114055, ...,
                 262.65947707, 262.72001449, 262.80472349],
                [273.46772667, 273.82780224, 274.24491484, ...,
                 263.02601823, 263.34543527, 263.61881074],
                ...,
                [290.7654399 , 290.72352666, 292.78296197, ...,
                 289.28994121, 289.08479077, 288.89057425],
                [290.88701696, 291.56260084, 289.62399358, ...,
                 289.95533155, 289.44969874, 289.53411169],
                [291.5181301 , 292.28853143, 291.94856727, ...,
                 288.77949159, 288.44848931, 289.57648866]],
      
               [[272.32443569, 272.42160101, 272.51618128, ...,
                 263.74645897, 263.64636811, 263.29997071],
                [272.73040108, 272.9136326 , 273.17354949, ...,
                 264.36691268, 264.21492469, 264.16304696],
                [273.23095371, 273.52433711, 273.74382583, ...,
                 264.86875617, 264.87331092, 264.9032606 ],
                ...,
                [291.12702743, 291.0806301 , 292.39303423, ...,
                 289.9706192 , 289.65702455, 289.61773184],
                [291.3511117 , 291.814956  , 288.91624517, ...,
                 290.18716563, 289.83671139, 290.18537173],
                [291.98558144, 292.57424628, 291.17319522, ...,
                 288.70967732, 288.73351089, 290.01658796]],
      
               ...,
      
               [[273.34591277, 273.45872299, 273.57981873, ...,
                 262.81575924, 262.72791854, 262.37939602],
                [273.68293464, 273.91683595, 274.25132353, ...,
                 263.37114052, 263.30571083, 263.33434793],
                [273.92674852, 274.228985  , 274.57270481, ...,
                 263.93969378, 264.06189114, 264.15750271],
                ...,
                [291.37913646, 291.41254027, 292.59082662, ...,
                 288.91358616, 288.73577682, 288.70355656],
                [291.67715222, 292.03747293, 289.41052113, ...,
                 289.72848842, 289.28888802, 289.40653826],
                [292.13491523, 293.01697474, 291.72582245, ...,
                 288.54446378, 288.28386257, 289.25678618]],
      
               [[272.55039414, 272.69902802, 272.84877081, ...,
                 265.02739782, 264.87330163, 264.37162051],
                [272.87520035, 273.14459925, 273.46567005, ...,
                 265.84818036, 265.76857194, 265.69866844],
                [273.02756799, 273.34019105, 273.73089633, ...,
                 266.26722684, 266.44287408, 266.4686611 ],
                ...,
                [290.91764234, 291.01268337, 291.74321515, ...,
                 288.65493177, 288.46945555, 288.39646912],
                [291.20885766, 291.32540495, 287.48553533, ...,
                 289.24264659, 288.8253814 , 289.00372912],
                [291.50577313, 292.16831937, 289.65082152, ...,
                 287.87827069, 287.74947324, 288.91543712]],
      
               [[273.92830691, 274.11728104, 274.39245639, ...,
                 261.51154162, 261.44379972, 261.09472806],
                [273.86595552, 274.26219144, 274.88331305, ...,
                 261.78378744, 261.71550336, 261.73140816],
                [274.08003633, 274.44283328, 274.82481285, ...,
                 261.96268629, 262.12053349, 262.20781359],
                ...,
                [290.00445159, 289.97239387, 291.20125215, ...,
                 288.63998214, 288.64471535, 288.71420786],
                [290.1392255 , 290.56347092, 287.74341417, ...,
                 289.44294706, 289.15743952, 289.37620976],
                [290.66755245, 291.29344277, 290.25320302, ...,
                 288.44625092, 288.13005364, 289.19336866]]]],
      
      
      
             [[[[272.92710412, 273.14902894, 273.3065766 , ...,
                 262.26105848, 262.22013507, 261.87569162],
                [273.53203185, 273.85093722, 274.18197698, ...,
                 262.82805036, 262.91089   , 263.07497804],
                [273.74735061, 274.03372789, 274.37143774, ...,
                 263.14051471, 263.53289098, 263.75146435],
                ...,
                [290.43531766, 290.45071643, 292.05277683, ...,
                 289.43205825, 289.27283843, 289.27010113],
                [290.52907993, 290.98302659, 289.0869479 , ...,
                 290.14447221, 289.81931172, 289.94970935],
                [290.939751  , 291.65970147, 291.4058954 , ...,
                 289.04581418, 288.91771466, 289.86680437]],
      
               [[272.53083801, 272.7911838 , 273.019515  , ...,
                 263.20790929, 263.14817478, 262.87788988],
                [273.10000245, 273.39211572, 273.75463502, ...,
                 263.91858308, 263.93672379, 263.97779332],
                [273.36240122, 273.71203912, 274.06178781, ...,
                 264.58796841, 264.70678761, 264.77687803],
                ...,
                [291.03385925, 291.04863474, 292.73157733, ...,
                 289.65358535, 289.69816092, 289.69143113],
                [291.27781379, 291.83057901, 290.15554611, ...,
                 290.20417587, 289.86519258, 290.08510092],
                [291.77702133, 292.39236384, 292.00914731, ...,
                 288.76328941, 288.76546147, 289.86618075]],
      
               [[272.85013448, 273.11187777, 273.30068373, ...,
                 261.8953952 , 261.87650017, 261.62000689],
                [273.32435376, 273.62877556, 274.04371046, ...,
                 262.37408082, 262.41930107, 262.57806761],
                [273.41648633, 273.74603935, 274.13027888, ...,
                 262.71088459, 262.87988513, 263.07418724],
                ...,
                [290.27060467, 290.26458674, 291.36818529, ...,
                 289.18037846, 288.88327458, 288.65844627],
                [290.40719671, 290.7378686 , 288.29150092, ...,
                 289.70282745, 289.24102982, 289.3596407 ],
                [290.87030759, 291.46644327, 290.39695939, ...,
                 288.28009265, 288.02918741, 289.06834345]],
      
               ...,
      
               [[273.32188283, 273.47638138, 273.64927872, ...,
                 260.91976862, 260.73617968, 260.34854093],
                [273.77483899, 274.06964111, 274.33812879, ...,
                 261.40162095, 261.36584224, 261.54063532],
                [273.92458874, 274.33069445, 274.67235632, ...,
                 261.89291249, 262.11309848, 262.27926885],
                ...,
                [290.0915053 , 290.08199576, 291.02647566, ...,
                 288.45578899, 288.46496582, 288.49535536],
                [290.2714313 , 290.49456057, 286.97226218, ...,
                 289.30904289, 288.97646597, 289.17128621],
                [290.57775779, 291.21985825, 289.35299848, ...,
                 288.2260447 , 288.02275683, 289.31943811]],
      
               [[272.91703465, 273.15677311, 273.36052273, ...,
                 263.28126509, 263.18059042, 262.85946871],
                [273.45619699, 273.67683444, 274.00225432, ...,
                 263.8266988 , 263.77114968, 263.9269318 ],
                [273.62241164, 273.83931799, 274.13789135, ...,
                 264.49903156, 264.63225987, 264.72063662],
                ...,
                [290.77789307, 290.88014686, 291.90378836, ...,
                 288.71083434, 288.65016572, 288.67468295],
                [291.11218262, 291.21121979, 287.64757903, ...,
                 289.18513621, 288.86784462, 289.14648802],
                [291.48180754, 292.0350574 , 289.81336544, ...,
                 287.79259391, 287.71038818, 288.91613637]],
      
               [[273.10674584, 273.2770399 , 273.40399203, ...,
                 261.89522685, 261.87207628, 261.58840362],
                [273.66184467, 273.91866004, 274.20086504, ...,
                 262.60448472, 262.67107507, 262.83401887],
                [273.90741763, 274.16568192, 274.44609766, ...,
                 263.27831915, 263.58299355, 263.78719313],
                ...,
                [290.46097764, 290.55653945, 291.45215175, ...,
                 288.2858973 , 288.27422963, 288.36490731],
                [290.74918531, 290.84930453, 287.42283929, ...,
                 289.1218265 , 288.86890013, 289.12299214],
                [291.17627517, 291.71105227, 289.6072182 , ...,
                 288.37030129, 288.30290056, 289.3637085 ]]],
      
      
              [[[273.31192547, 273.53057596, 273.70017674, ...,
                 264.58895924, 264.53362075, 264.14864946],
                [273.73505733, 273.99131543, 274.25734744, ...,
                 265.02998103, 265.04266341, 265.12875764],
                [273.74945732, 274.00847294, 274.31781437, ...,
                 265.42133729, 265.64167437, 265.76763833],
                ...,
                [290.57247228, 290.67464513, 291.81790261, ...,
                 289.44032951, 289.22429159, 289.18523706],
                [290.88959039, 291.29241313, 287.87659454, ...,
                 289.97164552, 289.62119492, 289.78169416],
                [291.52318673, 292.24690976, 290.25834291, ...,
                 288.4799682 , 288.46952521, 289.52344049]],
      
               [[272.44737973, 272.7658917 , 272.99184948, ...,
                 261.98515303, 261.95926484, 261.68911494],
                [272.83707859, 273.15735958, 273.57170039, ...,
                 262.23424066, 262.31334238, 262.54673502],
                [273.12008601, 273.4192757 , 273.76145437, ...,
                 262.50588259, 262.72839836, 262.87171621],
                ...,
                [289.35167893, 289.40365335, 289.49003336, ...,
                 289.17865488, 289.11205491, 289.19152235],
                [289.6532815 , 289.42329274, 285.3126715 , ...,
                 289.78024325, 289.477347  , 289.72954261],
                [289.88202369, 290.31035647, 287.40938867, ...,
                 288.41408605, 288.27458622, 289.59652113]],
      
               [[272.76160862, 272.97146839, 273.14681708, ...,
                 263.49213161, 263.51049108, 263.24958271],
                [273.1874519 , 273.42064435, 273.76934549, ...,
                 264.04716923, 264.15263168, 264.28338059],
                [273.36983523, 273.74049278, 274.06830166, ...,
                 264.38228541, 264.63990485, 264.78018072],
                ...,
                [290.07286403, 290.17013218, 291.2067964 , ...,
                 288.37114019, 288.26653157, 288.29766182],
                [290.27260258, 290.69634147, 287.51514136, ...,
                 289.07939048, 288.69800037, 288.93884709],
                [290.89063462, 291.64981875, 289.83921018, ...,
                 287.63069451, 287.44174858, 288.69469916]],
      
               ...,
      
               [[273.71524579, 273.84174148, 273.99570929, ...,
                 263.66381338, 263.65328681, 263.38957745],
                [274.28317128, 274.48562224, 274.71701415, ...,
                 264.11404834, 264.18237819, 264.35385862],
                [274.6242563 , 274.83898893, 275.1213432 , ...,
                 264.32627769, 264.59033502, 264.84212361],
                ...,
                [289.60124339, 289.71952521, 289.39777407, ...,
                 289.62896994, 289.51905955, 289.38965972],
                [289.93726448, 289.7464321 , 285.3168806 , ...,
                 290.19737443, 289.82342231, 290.02627132],
                [290.21164902, 290.88345105, 287.68286465, ...,
                 288.90436919, 288.7567006 , 289.83624433]],
      
               [[272.85353354, 273.10671964, 273.31931205, ...,
                 262.70270124, 262.57641635, 262.18718985],
                [273.40694394, 273.66760088, 273.96749977, ...,
                 263.55086866, 263.5909802 , 263.72110699],
                [273.56852988, 273.84803971, 274.10322836, ...,
                 263.97929532, 264.21553836, 264.3905497 ],
                ...,
                [290.22988029, 290.32084921, 291.95546192, ...,
                 288.98863585, 288.66278143, 288.51231882],
                [290.6918743 , 291.05909497, 288.75742672, ...,
                 289.60191776, 289.04882613, 289.08277595],
                [291.29431617, 292.01250391, 290.68617713, ...,
                 288.34642327, 288.1409597 , 289.20984417]],
      
               [[272.98917057, 273.20210963, 273.38373002, ...,
                 263.18828483, 263.10920964, 262.73431081],
                [273.75244572, 274.01852218, 274.32137531, ...,
                 263.87767576, 264.06789216, 264.28619269],
                [274.16831439, 274.43182937, 274.68832663, ...,
                 264.18267889, 264.56286505, 264.84177813],
                ...,
                [290.54898867, 290.53732831, 291.98588496, ...,
                 288.85531351, 288.76308474, 288.75452091],
                [290.67863498, 291.07415407, 288.1491958 , ...,
                 289.50508217, 289.22887686, 289.41221121],
                [291.23091092, 291.91097027, 290.37004189, ...,
                 288.31919728, 288.26852152, 289.40680064]]],
      
      
              [[[273.74429354, 273.93858039, 274.11858268, ...,
                 263.75191879, 263.70093221, 263.38400633],
                [274.29087929, 274.54664081, 274.90700166, ...,
                 264.09938016, 264.06186129, 264.06595197],
                [274.67095881, 275.07503111, 275.42735291, ...,
                 264.50255485, 264.62635206, 264.58129833],
                ...,
                [291.04913098, 291.05446592, 292.87474657, ...,
                 289.81099237, 289.61918706, 289.47726805],
                [291.17662745, 291.64400084, 289.15511853, ...,
                 290.4640556 , 289.96159794, 290.0517598 ],
                [291.8583248 , 292.49332096, 291.40103614, ...,
                 289.11727275, 288.78787994, 289.81358437]],
      
               [[272.57357025, 272.86182702, 273.08042908, ...,
                 262.51498081, 262.51596849, 262.28252212],
                [273.22900059, 273.57547793, 273.98640243, ...,
                 263.05801956, 263.12909367, 263.35128336],
                [273.53156546, 273.78704005, 274.07179957, ...,
                 263.66229132, 263.88378657, 263.94938842],
                ...,
                [290.29212885, 290.39709373, 291.80685657, ...,
                 289.60796555, 289.44820106, 289.42971205],
                [290.58623571, 290.98550747, 288.65495798, ...,
                 290.32912843, 289.97451351, 290.10181659],
                [290.96714882, 291.73928004, 290.753206  , ...,
                 289.02782672, 289.0107183 , 290.29709824]],
      
               [[273.14463474, 273.36323746, 273.54188703, ...,
                 262.0107062 , 261.94175289, 261.55882927],
                [273.78584057, 274.08378236, 274.44345789, ...,
                 262.51150115, 262.50774417, 262.57719073],
                [274.34125884, 274.60720294, 274.77754842, ...,
                 263.02804897, 263.23598945, 263.2873429 ],
                ...,
                [290.6524625 , 290.77290245, 291.49602674, ...,
                 289.31477157, 289.17952264, 289.23125557],
                [291.0034664 , 291.04485553, 288.44891258, ...,
                 289.78390005, 289.50588359, 289.76600481],
                [291.37242889, 291.81227311, 290.06515138, ...,
                 288.58660856, 288.60778344, 289.60799342]],
      
               ...,
      
               [[272.93930651, 273.05826701, 273.17113329, ...,
                 261.4450186 , 261.44349952, 261.1532145 ],
                [273.62322401, 273.88227015, 274.11438519, ...,
                 262.05141681, 262.20927015, 262.46405228],
                [274.01318592, 274.33967026, 274.66194485, ...,
                 262.25503855, 262.64359914, 262.93686709],
                ...,
                [290.33700362, 290.4223321 , 290.95360996, ...,
                 288.33195396, 288.31638071, 288.3829767 ],
                [290.67326355, 290.65066064, 287.3263656 , ...,
                 288.96907309, 288.818026  , 289.00869419],
                [290.94195324, 291.5335355 , 289.65979269, ...,
                 287.89256718, 287.83416848, 288.9967114 ]],
      
               [[271.66298145, 272.01588175, 272.32725591, ...,
                 263.86441504, 263.77815645, 263.37406838],
                [272.59895922, 272.9219848 , 273.26788264, ...,
                 264.16574793, 264.21815325, 264.366506  ],
                [273.10255598, 273.39633179, 273.67381983, ...,
                 264.51153349, 264.69978017, 264.78107685],
                ...,
                [290.34204865, 290.38878764, 291.84559167, ...,
                 287.14010554, 287.12718068, 287.22662121],
                [290.63161999, 291.32154614, 289.33312491, ...,
                 287.86866926, 287.52767712, 287.83357371],
                [291.28310693, 292.13088956, 291.82161082, ...,
                 286.6507303 , 286.4117571 , 287.5742433 ]],
      
               [[271.76599519, 272.05063994, 272.30238342, ...,
                 266.40059181, 266.49313454, 266.37046515],
                [272.66659513, 272.94862996, 273.23686185, ...,
                 266.62317823, 266.74443469, 267.04572628],
                [273.12290623, 273.39958357, 273.70430457, ...,
                 267.02997987, 267.24801685, 267.45217813],
                ...,
                [290.89084294, 290.94992994, 292.02143362, ...,
                 289.20207712, 289.08890401, 289.03025685],
                [291.29361758, 291.68110922, 288.53069471, ...,
                 289.76193138, 289.37956536, 289.51731143],
                [291.74090112, 292.40679666, 290.89845807, ...,
                 288.45584969, 288.27284639, 289.50053903]]]],
      
      
      
             [[[[272.52542745, 272.69906948, 272.85302303, ...,
                 263.68097869, 263.60969427, 263.23185033],
                [272.98695374, 273.21965392, 273.49369513, ...,
                 264.04186464, 264.03878088, 264.1484516 ],
                [273.32827062, 273.60496355, 273.89212401, ...,
                 264.42197435, 264.72984812, 264.93192955],
                ...,
                [290.84376625, 290.75411092, 292.88437653, ...,
                 288.94185041, 288.88996356, 288.86967236],
                [290.88774739, 291.50389763, 289.95298568, ...,
                 289.33172641, 288.97050045, 289.25486092],
                [291.28880808, 292.03585517, 292.76893914, ...,
                 287.90841111, 287.7670852 , 288.97857732]],
      
               [[273.78294804, 273.90700796, 274.00368467, ...,
                 261.30986786, 261.22051123, 260.8384207 ],
                [274.12538578, 274.33655415, 274.66120911, ...,
                 262.34586483, 262.26831685, 262.24146486],
                [274.02320596, 274.29741801, 274.70488175, ...,
                 263.22875446, 263.33407361, 263.34033933],
                ...,
                [291.25368699, 291.27816706, 292.24323671, ...,
                 289.12785704, 288.98202647, 288.9223603 ],
                [291.45860556, 291.54734802, 288.32045845, ...,
                 289.6055676 , 289.12363998, 289.29262211],
                [291.89774289, 292.38167473, 290.42491382, ...,
                 288.38337243, 288.14671923, 289.12162748]],
      
               [[273.14759031, 273.26486936, 273.3691592 , ...,
                 263.10106758, 262.97770807, 262.54386537],
                [273.72447934, 273.87576095, 274.07370194, ...,
                 263.31706536, 263.272483  , 263.36680139],
                [274.12210183, 274.31397048, 274.51372064, ...,
                 263.58691373, 263.84167199, 264.01812247],
                ...,
                [290.96197875, 290.92123944, 291.6878483 , ...,
                 288.35292816, 288.35487034, 288.47608815],
                [291.23045515, 291.01180367, 288.25141608, ...,
                 289.09849018, 288.76008108, 288.92935114],
                [291.43438754, 291.74885294, 290.05823451, ...,
                 287.97462165, 287.78379755, 288.88104215]],
      
               ...,
      
               [[273.42738939, 273.52428536, 273.61015088, ...,
                 263.78110438, 263.49701392, 262.8957901 ],
                [273.64441548, 273.88386702, 274.17617897, ...,
                 264.42803341, 264.29436526, 264.1666419 ],
                [273.80187126, 274.09187217, 274.32112088, ...,
                 264.70845695, 264.77488924, 264.75643058],
                ...,
                [290.71003491, 290.68436996, 292.23123965, ...,
                 288.70555015, 288.58349643, 288.48855292],
                [290.85588604, 291.40934455, 288.82669863, ...,
                 289.46885018, 289.00198862, 289.06509565],
                [291.29502471, 292.09772724, 291.40032428, ...,
                 288.27056022, 288.08566317, 288.99807938]],
      
               [[272.99033522, 273.11693274, 273.25279037, ...,
                 263.09413064, 263.06924919, 262.73715558],
                [273.4310525 , 273.65543399, 274.03416045, ...,
                 263.92030567, 264.0260975 , 264.20723708],
                [273.62462815, 273.84256048, 274.1410068 , ...,
                 264.42843495, 264.83575954, 265.05727668],
                ...,
                [290.34125784, 290.39285245, 290.53954979, ...,
                 289.09675532, 289.00614365, 288.94655675],
                [290.64825804, 290.41242881, 286.6980687 , ...,
                 289.75831604, 289.31589375, 289.36786055],
                [290.99390179, 291.40467834, 288.41607832, ...,
                 288.39419788, 287.96807662, 289.05026046]],
      
               [[272.44191012, 272.62980154, 272.78724637, ...,
                 265.07661272, 264.96172233, 264.51785212],
                [273.0650595 , 273.3247485 , 273.6492094 , ...,
                 265.59299469, 265.60083605, 265.6287331 ],
                [273.39627075, 273.72365835, 274.0898202 , ...,
                 266.0205725 , 266.20756564, 266.3207623 ],
                ...,
                [290.47298133, 290.48339247, 291.95858532, ...,
                 290.24016538, 290.09438258, 290.06381856],
                [290.65034817, 291.08319722, 288.88633927, ...,
                 291.07817774, 290.74341782, 290.93504732],
                [291.10205742, 291.85575402, 290.98335565, ...,
                 289.95381231, 289.92581641, 291.0327991 ]]],
      
      
              [[[273.32459657, 273.50483372, 273.54591436, ...,
                 264.70869977, 264.64744651, 264.36613332],
                [273.91790771, 274.17552218, 274.40301514, ...,
                 265.23771369, 265.13587388, 265.20758687],
                [274.36014789, 274.57140483, 274.73440353, ...,
                 265.79859676, 265.94261368, 266.02591705],
                ...,
                [290.88316146, 290.85471079, 292.05863322, ...,
                 288.91878974, 288.67877861, 288.58640157],
                [291.05824313, 291.1554111 , 287.94390106, ...,
                 289.47516101, 289.13164819, 289.2939964 ],
                [291.32400944, 291.91552502, 290.24810625, ...,
                 288.28263921, 288.1294559 , 289.39388176]],
      
               [[273.01618062, 273.24919991, 273.46408545, ...,
                 263.93452686, 263.84885373, 263.47056712],
                [273.46935902, 273.69736978, 274.01774365, ...,
                 264.26965896, 264.21813053, 264.33740997],
                [273.60620383, 273.89020406, 274.2284599 , ...,
                 264.4430474 , 264.673854  , 264.85725287],
                ...,
                [290.93170763, 290.88131913, 292.45196268, ...,
                 289.6347497 , 289.54702659, 289.62204477],
                [291.00050553, 291.37077597, 289.09122533, ...,
                 290.13555809, 289.8104802 , 290.17937702],
                [291.33441328, 291.98292906, 290.94305387, ...,
                 288.99414394, 288.94603497, 290.08225084]],
      
               [[272.42856167, 272.62019481, 272.74607219, ...,
                 264.09012156, 264.00395368, 263.6013245 ],
                [273.34299502, 273.56684676, 273.84736666, ...,
                 264.67669247, 264.62256573, 264.57494023],
                [273.89634141, 274.0579207 , 274.23774852, ...,
                 264.96630229, 265.12003907, 265.16148476],
                ...,
                [291.24181134, 291.25328528, 293.03848764, ...,
                 289.93864275, 289.9010305 , 289.9194661 ],
                [291.31946531, 291.83452507, 289.84677887, ...,
                 290.46979589, 290.16654073, 290.48482248],
                [291.77864672, 292.44565284, 291.67466669, ...,
                 289.13682755, 289.06057839, 290.11888786]],
      
               ...,
      
               [[271.47179081, 271.55898982, 271.6056827 , ...,
                 267.01862003, 266.83109715, 266.37014671],
                [271.965952  , 272.12580971, 272.3063925 , ...,
                 267.70743262, 267.51199474, 267.33675816],
                [272.60257986, 272.81672668, 272.94815627, ...,
                 268.45126044, 268.43216108, 268.29295051],
                ...,
                [292.73990034, 292.64279573, 295.09442039, ...,
                 289.43017976, 289.38138448, 289.51803025],
                [292.94746764, 293.5251299 , 290.81525521, ...,
                 290.07199428, 289.65194138, 289.92514204],
                [293.38272692, 294.06881913, 293.28957234, ...,
                 288.61646072, 288.48159226, 289.64898416]],
      
               [[273.01671003, 273.16647107, 273.27563278, ...,
                 265.50991423, 265.41507754, 265.11832727],
                [273.55745233, 273.74980562, 274.00205596, ...,
                 266.62675144, 266.5856373 , 266.60255134],
                [273.75588989, 274.00754149, 274.352074  , ...,
                 267.16388503, 267.28123076, 267.35290527],
                ...,
                [290.14713022, 290.13748103, 290.89223878, ...,
                 288.97073663, 288.85103541, 288.78855531],
                [290.38969256, 290.41515052, 287.43264173, ...,
                 289.25445623, 288.96996042, 289.11642357],
                [290.74869902, 291.00559765, 289.19575799, ...,
                 288.01613451, 287.66289786, 288.67740996]],
      
               [[272.47583306, 272.64304617, 272.74756622, ...,
                 265.83249001, 266.02860559, 265.89741682],
                [273.17933025, 273.3437029 , 273.5497347 , ...,
                 266.39102505, 266.53250819, 266.73173954],
                [273.71131797, 273.87063798, 274.04573159, ...,
                 266.63559657, 266.9303622 , 267.14738498],
                ...,
                [290.2802605 , 290.35241301, 290.80397001, ...,
                 289.16597681, 289.05141482, 289.10738705],
                [290.5618117 , 290.34778097, 286.81359598, ...,
                 289.66098785, 289.37395212, 289.55032116],
                [290.67154362, 291.02296614, 288.64582825, ...,
                 288.67284791, 288.36372807, 289.41439819]]],
      
      
              [[[272.54905137, 272.85449584, 273.01139765, ...,
                 264.40983648, 264.45587689, 264.1472362 ],
                [273.25034564, 273.5541425 , 273.82019806, ...,
                 264.86785872, 264.99560962, 265.15178133],
                [273.74129188, 274.04348854, 274.3060117 , ...,
                 265.19655145, 265.52103258, 265.73416071],
                ...,
                [290.70675195, 290.62814696, 292.46559044, ...,
                 289.70106672, 289.58076875, 289.47846487],
                [290.83509959, 291.43035789, 289.44165802, ...,
                 290.24248339, 289.85106559, 289.97643844],
                [291.29560753, 291.91483506, 291.78304755, ...,
                 288.73303355, 288.6338282 , 289.7057379 ]],
      
               [[273.42702716, 273.7231913 , 273.86032801, ...,
                 263.31696751, 263.21953848, 262.88217843],
                [273.97541676, 274.2941659 , 274.5799544 , ...,
                 263.7951423 , 263.77908591, 263.85655677],
                [274.34183038, 274.68011607, 274.95047262, ...,
                 264.1022586 , 264.3437782 , 264.47670696],
                ...,
                [291.32845174, 291.345934  , 292.41904383, ...,
                 288.93703228, 288.8436893 , 288.99992238],
                [291.58963444, 291.71084429, 288.42093227, ...,
                 289.61475041, 289.39148513, 289.62947779],
                [292.00644617, 292.5731241 , 290.55009925, ...,
                 288.98442011, 288.69660187, 289.67704309]],
      
               [[273.64433388, 273.80713455, 273.93600696, ...,
                 267.73519433, 267.75071716, 267.44793369],
                [274.13837499, 274.33007613, 274.5085698 , ...,
                 268.4296132 , 268.52257272, 268.63231195],
                [274.46982973, 274.69141255, 274.876297  , ...,
                 269.11132016, 269.29548579, 269.41435242],
                ...,
                [290.26927052, 290.36964682, 291.59490171, ...,
                 289.84197534, 289.86535844, 289.80409042],
                [290.55188088, 290.95580159, 287.73012841, ...,
                 290.22657544, 289.94272249, 290.18448871],
                [291.12008501, 291.87177641, 289.99443751, ...,
                 288.85270591, 288.61322088, 289.78839974]],
      
               ...,
      
               [[272.4736567 , 272.61506819, 272.69560772, ...,
                 264.26544372, 264.20307939, 263.91370259],
                [273.2385443 , 273.44309865, 273.60102546, ...,
                 264.86298918, 264.80552839, 264.80365421],
                [273.95055091, 274.14120483, 274.28130307, ...,
                 265.29111564, 265.40851759, 265.48645716],
                ...,
                [290.65924902, 290.63598699, 292.36861022, ...,
                 290.3062575 , 290.02939274, 289.77527817],
                [290.86599897, 291.16678785, 288.91208217, ...,
                 290.81920392, 290.41290681, 290.49053325],
                [291.28230717, 291.87242889, 291.13952438, ...,
                 289.48744965, 289.27680339, 290.4456671 ]],
      
               [[273.99541109, 274.19367251, 274.35573346, ...,
                 263.72953133, 263.63137452, 263.29607906],
                [274.39262556, 274.61398183, 274.89003654, ...,
                 264.52617115, 264.4637491 , 264.50652098],
                [274.42154992, 274.74308213, 275.06725311, ...,
                 264.95656271, 265.15528173, 265.32766425],
                ...,
                [291.64245207, 291.45911009, 294.45666106, ...,
                 288.54193613, 288.55435745, 288.60525612],
                [291.81754402, 292.83118306, 291.62861899, ...,
                 289.1364159 , 288.88451319, 289.05843121],
                [292.71007604, 293.43540921, 293.92048147, ...,
                 287.91136767, 287.68609321, 288.87630861]],
      
               [[273.50153384, 273.63655522, 273.72290039, ...,
                 262.14897189, 262.16270745, 261.89033143],
                [273.89169809, 274.10677304, 274.32408142, ...,
                 262.67019106, 262.76888109, 262.97836735],
                [274.16809712, 274.45020593, 274.69745371, ...,
                 262.92302886, 263.29160491, 263.63895947],
                ...,
                [289.99934188, 290.02948695, 291.60851022, ...,
                 289.33095517, 289.30778603, 289.36678248],
                [290.21776315, 290.70664248, 288.7387891 , ...,
                 289.91583418, 289.66567263, 289.84992251],
                [290.83648383, 291.50648797, 290.76654982, ...,
                 288.77824103, 288.70147373, 289.89081308]]]]])
    • d2m
      (year, leadtime, number, latitude, longitude)
      float64
      266.1 266.5 266.9 ... 284.7 286.0
      array([[[[[266.08850396, 266.53399658, 266.89909927, ...,
                 257.96354825, 258.03986508, 257.99407113],
                [267.24463919, 267.53575366, 267.78855697, ...,
                 258.41461563, 258.37738568, 258.40770589],
                [267.80843187, 268.0374789 , 268.29298865, ...,
                 259.04727173, 259.05719475, 259.09603948],
                ...,
                [286.3161097 , 286.42925959, 282.27403624, ...,
                 282.43334198, 282.57749408, 282.83188828],
                [286.73485797, 286.19886116, 275.5401618 , ...,
                 283.94905787, 283.96259341, 284.00070953],
                [287.0666149 , 287.53875898, 274.46136839, ...,
                 283.14683632, 282.83087258, 284.07938783]],
      
               [[269.91115869, 270.13345304, 270.29775901, ...,
                 256.5310037 , 256.51154443, 256.33339758],
                [270.8068035 , 270.97125775, 271.12790348, ...,
                 257.01556032, 256.99149986, 257.0473243 ],
                [271.4693703 , 271.65252719, 271.82352879, ...,
                 257.62568366, 257.67834672, 257.74914302],
                ...,
                [285.97263635, 286.08812747, 281.48216115, ...,
                 282.83816761, 282.91014796, 283.09393576],
                [286.41818071, 285.82689833, 273.80630261, ...,
                 284.03099491, 283.96951692, 284.08122054],
                [286.88183959, 287.21923364, 273.60876233, ...,
                 283.4215602 , 283.03936237, 284.13353895]],
      
               [[265.99203292, 266.37167657, 266.77463797, ...,
                 257.12735881, 257.14149409, 257.10441506],
                [267.99712903, 268.23091059, 268.38809503, ...,
                 257.39951374, 257.42792975, 257.60964402],
                [269.13970715, 269.23232269, 269.32721412, ...,
                 258.04624159, 258.10638743, 258.22070512],
                ...,
                [285.90674823, 286.15445311, 282.28122811, ...,
                 282.13732147, 282.26281274, 282.576146  ],
                [286.38594022, 286.0973597 , 275.78356171, ...,
                 283.20849576, 283.26482723, 283.33850098],
                [286.81510196, 287.47000089, 276.22089784, ...,
                 282.22382985, 281.93995832, 283.36503866]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]],
      
      
              [[[269.3009972 , 269.4143428 , 269.5325941 , ...,
                 257.69200532, 257.70142066, 257.59421971],
                [269.90907022, 270.07259502, 270.14449941, ...,
                 258.46643945, 258.48883422, 258.57624319],
                [270.42294809, 270.58328313, 270.73678489, ...,
                 258.9885108 , 259.01917814, 259.11835447],
                ...,
                [285.85470482, 285.89286837, 281.02522278, ...,
                 282.8731789 , 282.96362769, 283.0566466 ],
                [286.34436566, 285.72199581, 273.7722848 , ...,
                 284.01200502, 283.91036722, 283.98223678],
                [286.87775786, 287.50995603, 274.22113502, ...,
                 283.3486295 , 282.94742518, 284.16551839]],
      
               [[267.74226844, 268.11232791, 268.36293594, ...,
                 259.77293462, 259.80097746, 259.76993843],
                [269.3809559 , 269.57483607, 269.73564015, ...,
                 260.33225847, 260.37137206, 260.43443613],
                [270.28750843, 270.47000686, 270.62430274, ...,
                 260.98008164, 261.03829624, 261.12624608],
                ...,
                [287.21919649, 287.42620617, 281.62758736, ...,
                 282.73168116, 282.92367222, 283.12575299],
                [287.60049273, 286.96056631, 274.48167287, ...,
                 283.97613492, 284.06833516, 284.08461496],
                [287.96151999, 288.49404675, 275.42513076, ...,
                 283.02585569, 282.66003352, 283.94798047]],
      
               [[265.91678321, 266.32213095, 266.71755086, ...,
                 258.30015647, 258.32966398, 258.27584441],
                [267.95505922, 268.17291028, 268.4047971 , ...,
                 258.56970447, 258.54974946, 258.6711522 ],
                [268.77023548, 268.93945876, 269.12186399, ...,
                 259.00416366, 259.05895333, 259.18440197],
                ...,
                [285.43113211, 285.56296639, 280.79404615, ...,
                 282.65045199, 282.8394646 , 282.98400149],
                [286.01901278, 285.44445071, 273.86034692, ...,
                 284.06295312, 284.12691929, 284.16639411],
                [286.59378981, 287.0821719 , 274.06808339, ...,
                 283.51048942, 283.2238597 , 284.31145079]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]],
      
      
              [[[267.44754294, 267.78744275, 268.10459999, ...,
                 258.34288721, 258.43498081, 258.4147518 ],
                [268.26915641, 268.48292707, 268.73355235, ...,
                 258.85714125, 258.92732786, 259.03895652],
                [268.78777744, 269.00891843, 269.21480063, ...,
                 259.32555506, 259.35299915, 259.44120739],
                ...,
                [286.44598521, 286.63902581, 283.00966876, ...,
                 282.28206203, 282.32260629, 282.67520905],
                [286.99917337, 286.82825702, 276.52242412, ...,
                 283.60449716, 283.58057603, 283.76035607],
                [287.32236812, 287.75278606, 276.87426824, ...,
                 282.79698977, 282.38949651, 283.68314527]],
      
               [[268.5398669 , 268.88160241, 269.16328895, ...,
                 259.01173351, 258.98880038, 258.86479071],
                [269.77178623, 270.0430195 , 270.18152353, ...,
                 259.38044656, 259.29012846, 259.29844997],
                [270.25173751, 270.4363735 , 270.56932433, ...,
                 260.16793574, 260.12250884, 260.10918377],
                ...,
                [286.39224575, 286.43043584, 279.00439287, ...,
                 283.3460763 , 283.44985033, 283.78203981],
                [286.81725145, 286.09694605, 271.72152876, ...,
                 284.46551912, 284.55386154, 284.73180522],
                [287.44096341, 287.99732673, 272.88722329, ...,
                 283.71731601, 283.4082761 , 284.69599716]],
      
               [[266.01085397, 266.60799806, 267.01255931, ...,
                 258.68916752, 258.77610165, 258.75133896],
                [267.35993095, 267.59060503, 267.75540626, ...,
                 259.30707102, 259.36349089, 259.54328321],
                [267.94126229, 268.07226994, 268.16967574, ...,
                 260.04898619, 260.13329232, 260.30461834],
                ...,
                [285.49068484, 285.77594989, 282.45281717, ...,
                 282.99027418, 283.02161971, 283.23585079],
                [286.15410747, 286.06829038, 276.57075301, ...,
                 284.37368111, 284.25782444, 284.37870954],
                [286.66881263, 287.27003678, 277.90754036, ...,
                 283.63568911, 283.12318619, 284.21368309]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]]],
      
      
      
             [[[[269.29380765, 269.36023646, 269.49217191, ...,
                 257.67817373, 257.65510493, 257.57319127],
                [270.06619163, 270.20675626, 270.33777917, ...,
                 258.13568845, 258.0175433 , 257.98243116],
                [270.75581426, 270.77151622, 270.79147239, ...,
                 258.59123446, 258.41267096, 258.3230682 ],
                ...,
                [285.72581482, 285.80592247, 280.39082635, ...,
                 282.35565484, 282.46732762, 282.5608819 ],
                [286.07097327, 285.48721944, 272.68901891, ...,
                 283.71560105, 283.61259261, 283.54942289],
                [286.48159823, 287.18550508, 273.0967865 , ...,
                 282.90344835, 282.52545232, 283.61894923]],
      
               [[269.20194211, 269.34192657, 269.468887  , ...,
                 257.06160255, 257.06475366, 257.03824151],
                [269.78283924, 269.95648658, 270.08236694, ...,
                 257.49542369, 257.49345166, 257.61426793],
                [270.45938309, 270.59427046, 270.68347533, ...,
                 258.13867304, 258.15241308, 258.21850254],
                ...,
                [285.33569867, 285.50707378, 280.03731271, ...,
                 282.69818745, 282.85345227, 282.96120022],
                [285.69985464, 285.07970097, 273.69202357, ...,
                 283.73566304, 283.74410314, 283.81223496],
                [286.07554759, 286.56534377, 275.10793902, ...,
                 283.27824369, 282.923034  , 283.9506617 ]],
      
               [[268.070073  , 268.27492921, 268.47795967, ...,
                 257.26409614, 257.38610641, 257.44846261],
                [268.85897562, 269.07453885, 269.27758988, ...,
                 257.48644837, 257.66719818, 257.99518121],
                [269.71661112, 269.76752273, 269.83082979, ...,
                 258.03181706, 258.27343269, 258.52198841],
                ...,
                [286.5426984 , 286.77995566, 281.21117268, ...,
                 281.69634214, 281.80410103, 282.06710351],
                [287.03291254, 286.41709568, 273.59202211, ...,
                 283.21046514, 283.21744371, 283.32660841],
                [287.36146612, 287.841772  , 275.0906873 , ...,
                 282.67037931, 282.24590003, 283.37581037]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]],
      
      
              [[[264.92637004, 265.43127972, 265.96525574, ...,
                 258.1501848 , 258.13805423, 258.01168077],
                [266.67339458, 267.00097159, 267.31390713, ...,
                 258.32229133, 258.33052428, 258.37629368],
                [267.79440109, 267.93609619, 268.09989034, ...,
                 258.69333864, 258.77229674, 258.92605243],
                ...,
                [286.49249699, 286.58510556, 281.93992946, ...,
                 282.88418048, 282.9951142 , 283.21315533],
                [286.96438002, 286.50340138, 275.30343097, ...,
                 284.0392058 , 284.04478388, 284.19619784],
                [287.30186363, 287.86129794, 275.92943739, ...,
                 283.34443134, 282.91388736, 284.19156813]],
      
               [[268.75890052, 269.07386713, 269.28648575, ...,
                 259.91721842, 259.90155776, 259.80113519],
                [269.73413351, 269.90274479, 270.05739826, ...,
                 260.22819055, 260.2843399 , 260.38057477],
                [270.21744371, 270.41965319, 270.58597167, ...,
                 260.62755137, 260.67112168, 260.78929354],
                ...,
                [285.7081478 , 285.84789774, 281.14796381, ...,
                 282.0810998 , 282.33118804, 282.553561  ],
                [286.2901744 , 285.94193832, 275.07442906, ...,
                 283.44072126, 283.45103222, 283.48468217],
                [286.91391555, 287.57112885, 276.60442352, ...,
                 282.63287851, 282.17758676, 283.39039081]],
      
               [[269.15968256, 269.3408704 , 269.53066652, ...,
                 258.63456842, 258.67733881, 258.6323748 ],
                [269.81231955, 270.00161942, 270.19829095, ...,
                 258.73161996, 258.69825148, 258.76956442],
                [270.53655906, 270.60743083, 270.75083625, ...,
                 259.08154148, 259.00592124, 259.05967945],
                ...,
                [286.41895162, 286.66584048, 281.84469339, ...,
                 282.59746552, 282.72721465, 283.02432782],
                [287.028521  , 286.54403322, 274.94524549, ...,
                 283.86637115, 283.87513501, 283.99128391],
                [287.40319758, 287.96390633, 275.57323622, ...,
                 283.07663561, 282.8174946 , 284.00923389]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]],
      
      
              [[[265.14416404, 265.66326871, 266.20989493, ...,
                 257.01993362, 257.00882721, 256.92201482],
                [266.00660009, 266.49402685, 267.03750378, ...,
                 257.83866235, 257.72564896, 257.63215173],
                [266.84566929, 267.21220431, 267.72956218, ...,
                 258.52601043, 258.39857649, 258.36506553],
                ...,
                [285.49171713, 285.66884149, 280.0874793 , ...,
                 282.25568755, 282.44822726, 282.80612083],
                [285.99372731, 285.51806906, 273.48068901, ...,
                 283.75133747, 283.79340164, 283.9522725 ],
                [286.39502053, 286.97013092, 273.84546197, ...,
                 283.28878287, 283.01176419, 284.14659052]],
      
               [[268.675695  , 268.85836095, 269.01443714, ...,
                 258.53157873, 258.60360419, 258.54021703],
                [269.25453219, 269.39444766, 269.55759994, ...,
                 259.21268778, 259.25800506, 259.30271762],
                [269.55210213, 269.73877451, 269.97458416, ...,
                 259.85146315, 259.92585074, 259.95938376],
                ...,
                [285.62192933, 285.63906529, 281.24080691, ...,
                 282.35395481, 282.46905186, 282.675219  ],
                [286.09131291, 285.65574513, 275.65169757, ...,
                 283.70480778, 283.63233848, 283.60178873],
                [286.52712847, 286.98827893, 275.97512121, ...,
                 282.8249253 , 282.51795893, 283.6669358 ]],
      
               [[266.69292251, 267.1111762 , 267.6020541 , ...,
                 258.57531274, 258.50861408, 258.31102819],
                [267.35124339, 267.74670642, 268.25877347, ...,
                 259.24704527, 259.16458428, 259.07278525],
                [268.34210172, 268.53784412, 268.76899752, ...,
                 260.08451445, 259.9461179 , 259.78667914],
                ...,
                [286.71926482, 286.89003488, 282.22955986, ...,
                 282.73612412, 282.82319044, 282.90458347],
                [287.15310039, 286.76176784, 275.94749517, ...,
                 283.9690973 , 283.92002305, 283.86089259],
                [287.53440791, 288.17751943, 277.63152081, ...,
                 283.43035856, 282.98073843, 283.94911459]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]]],
      
      
      
             [[[[267.30774589, 267.58780139, 267.84596982, ...,
                 259.46184872, 259.43835781, 259.32608298],
                [268.52966541, 268.7694397 , 269.02314659, ...,
                 259.79667332, 259.77081962, 259.80597819],
                [269.49818686, 269.73528422, 269.97146673, ...,
                 260.29851996, 260.22620856, 260.22221806],
                ...,
                [286.16034898, 286.29237233, 281.7894317 , ...,
                 282.21709177, 282.34390192, 282.44415383],
                [286.54527051, 286.22733672, 274.853984  , ...,
                 283.2819728 , 283.33677541, 283.34230804],
                [286.92868142, 287.48935832, 275.23670727, ...,
                 282.21403139, 281.79821678, 283.14656299]],
      
               [[270.0101534 , 270.08809463, 270.1676921 , ...,
                 260.86790864, 260.8369129 , 260.72014353],
                [270.66704758, 270.71290854, 270.75647603, ...,
                 261.17257326, 260.98877285, 260.8766249 ],
                [271.24444215, 271.30006575, 271.35817851, ...,
                 261.68397323, 261.40721611, 261.27174162],
                ...,
                [285.58843828, 285.79407136, 280.86594557, ...,
                 282.34140545, 282.43883448, 282.54277503],
                [286.03098828, 285.58800606, 274.09833195, ...,
                 283.74548307, 283.72458914, 283.67341647],
                [286.2809299 , 286.88274914, 274.88476098, ...,
                 283.20481176, 282.65364572, 283.75260594]],
      
               [[268.96460027, 269.15809731, 269.3389531 , ...,
                 258.62123738, 258.72819337, 258.71657828],
                [269.53706426, 269.74728924, 269.93305472, ...,
                 259.27764196, 259.38475103, 259.49284545],
                [269.97103252, 270.23223877, 270.50524139, ...,
                 260.0093009 , 260.11545148, 260.200192  ],
                ...,
                [286.04099871, 286.2205512 , 282.11085278, ...,
                 283.5207619 , 283.70454639, 283.91426418],
                [286.5247879 , 286.2041699 , 275.01762987, ...,
                 284.80142345, 284.85239808, 285.03285449],
                [286.91196243, 287.40522667, 275.89118062, ...,
                 283.91893934, 283.44872019, 284.79913728]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]],
      
      
              [[[269.49949148, 269.69981849, 269.88513316, ...,
                 257.6951279 , 257.51843129, 257.28287672],
                [269.94306415, 270.09554921, 270.27653006, ...,
                 258.25076261, 258.12475403, 258.07507822],
                [270.18983957, 270.33651667, 270.5253402 , ...,
                 258.72854498, 258.65613838, 258.61540471],
                ...,
                [285.91603188, 285.95702959, 280.79476697, ...,
                 282.68558502, 282.77549545, 282.90220111],
                [286.15683282, 285.56382818, 273.55093749, ...,
                 283.85873413, 283.93372411, 284.0298107 ],
                [286.4404612 , 286.82597152, 273.9062092 , ...,
                 283.0856917 , 282.74122288, 283.94741125]],
      
               [[268.83693728, 268.98162643, 269.11953901, ...,
                 260.47382388, 260.34748044, 260.17115153],
                [269.51567608, 269.64630989, 269.78723742, ...,
                 260.80653564, 260.71610691, 260.74979119],
                [269.97783031, 270.11062091, 270.26524784, ...,
                 261.18983841, 261.07926908, 261.03327842],
                ...,
                [286.03292681, 286.23970828, 281.68051612, ...,
                 281.23030157, 281.41089332, 281.79274783],
                [286.53148817, 286.26643007, 274.70912336, ...,
                 282.55140487, 282.51628445, 282.61767843],
                [287.03116442, 287.48095604, 275.08050371, ...,
                 282.34071582, 281.76924929, 282.81243167]],
      
               [[269.62485471, 269.82226629, 270.00996067, ...,
                 259.00737597, 259.02143064, 258.915803  ],
                [270.09273761, 270.3034313 , 270.49574744, ...,
                 259.48240546, 259.4721348 , 259.54475204],
                [270.41988472, 270.61088628, 270.84235183, ...,
                 260.05658125, 260.09195776, 260.1755386 ],
                ...,
                [286.23203543, 286.26249828, 280.45280324, ...,
                 282.99394889, 283.09234155, 283.25617284],
                [286.7171601 , 286.05972688, 274.03093753, ...,
                 284.31913625, 284.31326493, 284.36612469],
                [287.29682392, 287.97489166, 274.98244874, ...,
                 283.43530605, 283.01514169, 284.26904164]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]],
      
      
              [[[268.61660236, 268.82941669, 269.02886897, ...,
                 258.76898144, 258.59904132, 258.37262875],
                [269.2311607 , 269.49318529, 269.71845776, ...,
                 259.07930557, 258.89979951, 258.78113838],
                [269.92841837, 270.16790009, 270.36060433, ...,
                 259.45504893, 259.3621103 , 259.31860186],
                ...,
                [285.81881117, 285.93038509, 280.47598565, ...,
                 282.88626464, 282.9798511 , 283.07250778],
                [286.29834482, 285.62202188, 273.80655007, ...,
                 283.96523915, 283.95866096, 284.1448341 ],
                [286.86848616, 287.25790538, 273.13403685, ...,
                 283.14182845, 282.75147347, 284.01600415]],
      
               [[267.84446086, 267.98531673, 268.11711419, ...,
                 259.95110984, 259.9877933 , 259.94245513],
                [268.55101146, 268.68426945, 268.86627595, ...,
                 260.33581344, 260.29881884, 260.28746132],
                [269.12455882, 269.27099079, 269.48061968, ...,
                 260.84558785, 260.77216671, 260.77069142],
                ...,
                [285.09627069, 285.17080821, 280.02991419, ...,
                 281.8382638 , 282.09558205, 282.51249031],
                [285.7316669 , 285.16855057, 273.5800977 , ...,
                 283.05742877, 283.23208552, 283.39411396],
                [286.41048365, 287.1966775 , 274.21186829, ...,
                 282.32719057, 281.97254645, 283.27376457]],
      
               [[268.83205381, 268.90477487, 269.00582289, ...,
                 261.19493335, 261.27543839, 261.24562156],
                [269.29915951, 269.44500169, 269.53273242, ...,
                 261.2458375 , 261.27299101, 261.35556213],
                [269.88985211, 269.94711967, 269.96569658, ...,
                 261.53455187, 261.59259282, 261.70399094],
                ...,
                [286.07279869, 286.0837326 , 281.08295275, ...,
                 281.42603567, 281.63210131, 281.86344147],
                [286.5518905 , 285.84170134, 272.97068588, ...,
                 282.47018068, 282.61419346, 282.77150793],
                [286.9827569 , 287.56402323, 274.62361278, ...,
                 281.4122895 , 281.09253162, 282.55132294]],
      
               ...,
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]],
      
               [[         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                ...,
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan],
                [         nan,          nan,          nan, ...,
                          nan,          nan,          nan]]]],
      
      
      
             ...,
      
      
      
             [[[[269.82953246, 270.02522875, 270.25788481, ...,
                 260.35888174, 260.34912209, 260.27270093],
                [270.26892687, 270.49317899, 270.74584331, ...,
                 260.66833065, 260.63001019, 260.66128805],
                [270.76173202, 270.99128292, 271.23685488, ...,
                 261.06676948, 261.07015659, 261.0883061 ],
                ...,
                [287.04012862, 287.14189944, 281.95153775, ...,
                 283.9274282 , 283.99672069, 284.11057248],
                [287.26703279, 286.70225459, 275.78155949, ...,
                 285.16223775, 285.0349068 , 285.10993958],
                [287.46769283, 288.03571485, 275.70800582, ...,
                 284.49108754, 284.03561501, 285.13932435]],
      
               [[270.1380456 , 270.28048872, 270.44291886, ...,
                 258.20628888, 258.25057154, 258.22780161],
                [270.65968389, 270.79800382, 270.96762748, ...,
                 258.79724652, 258.84119929, 258.94525876],
                [271.06025895, 271.26139135, 271.5006747 , ...,
                 259.69790566, 259.66250627, 259.62517713],
                ...,
                [287.33572753, 287.36790732, 282.0544291 , ...,
                 284.84822746, 284.94567705, 284.98597949],
                [287.613265  , 286.99731678, 275.53398431, ...,
                 285.80897389, 285.77868918, 285.8728714 ],
                [287.9125343 , 288.35364466, 274.69665826, ...,
                 284.83792844, 284.51047317, 285.71134717]],
      
               [[269.34282485, 269.61740145, 269.85575635, ...,
                 256.39196595, 256.41411375, 256.38120137],
                [269.85372361, 270.12480661, 270.45542344, ...,
                 257.12254134, 257.12023378, 257.18981735],
                [270.44282532, 270.70482038, 270.98415574, ...,
                 258.09071964, 258.02377004, 257.99252236],
                ...,
                [287.28154622, 287.31925964, 281.1745695 , ...,
                 284.18947568, 284.18396825, 284.26901212],
                [287.43954269, 286.57504505, 272.92407658, ...,
                 285.17504054, 285.08149786, 284.99045629],
                [287.79396389, 288.01422849, 272.85260939, ...,
                 284.0793059 , 283.74151479, 284.84983826]],
      
               ...,
      
               [[268.49966099, 268.65175131, 268.78466731, ...,
                 257.30869525, 257.27416196, 257.17546811],
                [269.08359262, 269.26684869, 269.4484044 , ...,
                 257.81726373, 257.7346062 , 257.71604256],
                [269.6769648 , 269.853985  , 270.02420243, ...,
                 258.4225643 , 258.43322953, 258.39823914],
                ...,
                [286.32494653, 286.52421968, 282.20378776, ...,
                 284.01869567, 284.0649351 , 284.18550939],
                [286.75375134, 286.33867413, 275.55193495, ...,
                 285.34142469, 285.1831194 , 285.22815107],
                [287.03177178, 287.64945155, 275.90444979, ...,
                 284.77429896, 284.33407659, 285.41338713]],
      
               [[270.05542025, 270.26317596, 270.42294676, ...,
                 263.33165078, 263.38801641, 263.37177277],
                [270.52727575, 270.67988785, 270.91592706, ...,
                 263.3908101 , 263.40479809, 263.49716021],
                [270.78031756, 270.95843937, 271.19821598, ...,
                 263.67587479, 263.64986121, 263.76060652],
                ...,
                [285.18649491, 285.24269867, 281.082561  , ...,
                 282.45546457, 282.6649505 , 282.89728546],
                [285.62488058, 285.20494942, 275.07568094, ...,
                 283.42023369, 283.50778231, 283.61720044],
                [286.09984589, 286.7398267 , 275.93312438, ...,
                 282.96231145, 282.63082886, 283.64672686]],
      
               [[269.53043166, 269.73317088, 269.9359645 , ...,
                 258.49474252, 258.53557056, 258.51135453],
                [270.08193074, 270.33922212, 270.64353711, ...,
                 258.53912271, 258.64226084, 258.95078775],
                [270.53873145, 270.78236621, 271.01655114, ...,
                 258.93323666, 258.98741946, 259.14343195],
                ...,
                [286.69270524, 286.63157422, 280.71425994, ...,
                 283.15704578, 283.18478327, 283.28685561],
                [287.0103093 , 286.19252213, 273.58078434, ...,
                 284.43777001, 284.38006957, 284.39534527],
                [287.37212073, 287.76044929, 273.18870345, ...,
                 284.19616799, 283.68597213, 284.71080481]]],
      
      
              [[[270.89303688, 271.12897425, 271.36682328, ...,
                 258.80497974, 258.88744819, 258.79663086],
                [271.34023252, 271.58922643, 271.92665001, ...,
                 259.55357875, 259.52933535, 259.4913408 ],
                [271.93217568, 272.11620862, 272.35577824, ...,
                 260.18726764, 260.02548798, 259.91222166],
                ...,
                [286.487378  , 286.64172927, 282.22316941, ...,
                 284.45109293, 284.63410983, 284.89245738],
                [286.97472448, 286.61680105, 275.22760806, ...,
                 285.88418413, 285.93437925, 286.07418492],
                [287.46781921, 288.06827777, 275.78940814, ...,
                 285.44337563, 285.09979945, 286.21319547]],
      
               [[268.77370221, 269.01417873, 269.23692786, ...,
                 258.8404143 , 258.83934485, 258.76750565],
                [269.52114968, 269.73570417, 269.97720237, ...,
                 258.97665837, 258.92574974, 258.97230762],
                [270.10349871, 270.3324575 , 270.63671576, ...,
                 259.207492  , 259.17121224, 259.15078039],
                ...,
                [286.16516379, 286.36962791, 282.19862034, ...,
                 283.58254939, 283.84150165, 284.1015154 ],
                [286.68540988, 286.43423727, 275.24324799, ...,
                 284.81314021, 284.87196582, 284.97840516],
                [287.1386324 , 287.66893005, 276.38264233, ...,
                 284.08728525, 283.93377918, 285.16509744]],
      
               [[269.94267372, 270.14202118, 270.33324366, ...,
                 259.8905905 , 259.93551205, 259.88552044],
                [270.2630602 , 270.4779003 , 270.75688702, ...,
                 260.25778082, 260.25297812, 260.3370766 ],
                [270.42678767, 270.69435319, 270.9621237 , ...,
                 260.77090686, 260.78777413, 260.83970327],
                ...,
                [285.72874782, 285.84744064, 280.52695697, ...,
                 283.35834304, 283.43571008, 283.69558251],
                [286.10619089, 285.49736089, 273.07389566, ...,
                 284.709949  , 284.75052046, 284.85208229],
                [286.45966339, 286.77439515, 273.39840997, ...,
                 283.97549604, 283.49770621, 284.83042012]],
      
               ...,
      
               [[271.65937838, 271.74674192, 271.83772145, ...,
                 259.96176065, 259.96698927, 259.8419289 ],
                [271.96515954, 272.05597819, 272.208993  , ...,
                 260.29884554, 260.23958803, 260.23439109],
                [272.0855086 , 272.23536118, 272.39534693, ...,
                 260.7518969 , 260.68635194, 260.74913025],
                ...,
                [286.42644866, 286.59566431, 282.04376022, ...,
                 284.03752368, 284.14561363, 284.31969021],
                [286.66652248, 286.36976889, 275.53159664, ...,
                 285.39045118, 285.36560722, 285.46886278],
                [287.07399916, 287.53580641, 276.37675476, ...,
                 284.89277682, 284.56690581, 285.76491381]],
      
               [[270.28377997, 270.51164146, 270.71209385, ...,
                 260.20998283, 260.25499145, 260.24172078],
                [270.92974157, 271.1812565 , 271.45607094, ...,
                 260.4585636 , 260.40876156, 260.45726975],
                [271.40569007, 271.65795766, 271.91524671, ...,
                 261.08190404, 261.06074756, 261.06125027],
                ...,
                [286.91346442, 286.8753138 , 281.12567835, ...,
                 284.23078156, 284.31384841, 284.4015221 ],
                [287.19363271, 286.18465092, 273.55043262, ...,
                 285.54600127, 285.51882935, 285.50728773],
                [287.64270484, 288.32889391, 274.45426277, ...,
                 285.4970859 , 285.24841839, 286.03766533]],
      
               [[269.3694196 , 269.47069981, 269.6069661 , ...,
                 259.45307259, 259.39917805, 259.21299744],
                [270.09188876, 270.24360259, 270.47165249, ...,
                 259.77488261, 259.75051714, 259.75855172],
                [270.82941669, 270.98284713, 271.15810129, ...,
                 260.02559065, 260.02141123, 260.02995151],
                ...,
                [285.8695148 , 285.80574202, 280.5143008 , ...,
                 284.30436839, 284.30478834, 284.44469784],
                [286.14313142, 285.3097511 , 273.87402841, ...,
                 285.323349  , 285.32734149, 285.30249853],
                [286.40079465, 286.90378405, 274.67742223, ...,
                 284.5131209 , 284.1912938 , 285.32246498]]],
      
      
              [[[268.87942571, 269.12379588, 269.36900064, ...,
                 262.31689038, 262.40054952, 262.45414369],
                [269.63707799, 269.89455447, 270.24583037, ...,
                 262.33977741, 262.35004359, 262.48374657],
                [270.32895926, 270.62744937, 270.92684306, ...,
                 262.66303917, 262.67941085, 262.71832027],
                ...,
                [286.60004591, 286.71110833, 282.083924  , ...,
                 282.58827906, 282.92912624, 283.36111682],
                [286.97309743, 286.52915358, 275.46554035, ...,
                 284.00685385, 284.21433092, 284.33023237],
                [287.43570809, 288.20981631, 274.92009238, ...,
                 283.43757994, 283.18437261, 284.4397646 ]],
      
               [[269.7968478 , 270.04912633, 270.2450336 , ...,
                 257.60825149, 257.60949591, 257.51751278],
                [270.41929361, 270.69308969, 270.96187824, ...,
                 258.06397745, 258.08398122, 258.0964654 ],
                [270.90321947, 271.15772347, 271.42624465, ...,
                 258.3965139 , 258.40612445, 258.47122159],
                ...,
                [286.58977343, 286.65401061, 279.99366727, ...,
                 284.56846353, 284.5006893 , 284.63167074],
                [286.98272241, 286.20905337, 271.86888255, ...,
                 285.78391299, 285.59943954, 285.65119437],
                [287.49663842, 287.94186866, 272.05951823, ...,
                 285.13690119, 284.54069453, 285.71839706]],
      
               [[268.57584613, 268.71877919, 268.83456587, ...,
                 259.34356374, 259.2801371 , 259.15389003],
                [269.15458016, 269.28269428, 269.47730885, ...,
                 259.60618442, 259.42449205, 259.3332619 ],
                [270.03080982, 270.1849614 , 270.2817688 , ...,
                 260.01216391, 259.85983824, 259.82008295],
                ...,
                [287.29023875, 287.40717747, 282.43460448, ...,
                 284.70257668, 284.87529158, 285.16914998],
                [287.65809963, 287.13807678, 275.39608168, ...,
                 285.67948814, 285.67607448, 285.92436152],
                [288.19422481, 288.6823203 , 275.96861997, ...,
                 284.71331422, 284.49704013, 285.74217788]],
      
               ...,
      
               [[270.33204186, 270.49564693, 270.65511786, ...,
                 257.94634214, 257.95330495, 257.86559379],
                [270.96275031, 271.11674699, 271.33479176, ...,
                 258.27806257, 258.2817139 , 258.35939656],
                [271.41257444, 271.56201802, 271.72449029, ...,
                 258.87784145, 258.88542208, 258.93886251],
                ...,
                [287.83148923, 287.86600793, 282.60938628, ...,
                 283.56394063, 283.80747256, 284.02091317],
                [288.31294582, 287.5565441 , 273.9865046 , ...,
                 284.99108555, 285.14000602, 285.10726564],
                [288.77549777, 289.23389004, 274.79376818, ...,
                 284.53528396, 284.17510257, 285.28475819]],
      
               [[269.65706203, 269.81555143, 269.96871782, ...,
                 261.07266484, 260.95078079, 260.65066081],
                [270.11437026, 270.30611619, 270.55258212, ...,
                 261.65146836, 261.51257954, 261.36319069],
                [270.40596605, 270.6204761 , 270.93276115, ...,
                 262.09506109, 261.97890754, 261.8515081 ],
                ...,
                [286.5658765 , 286.76307048, 281.66106713, ...,
                 284.10260142, 284.2873439 , 284.50297745],
                [287.01441259, 286.5250891 , 274.88517264, ...,
                 285.24886554, 285.37003393, 285.55072055],
                [287.46275993, 288.05882927, 275.95849543, ...,
                 284.71551215, 284.57398522, 285.62909035]],
      
               [[271.57281096, 271.75073773, 271.96419791, ...,
                 257.10217468, 257.08166504, 256.93137094],
                [271.84724426, 272.09797635, 272.4476869 , ...,
                 257.19533721, 257.09114755, 257.05345751],
                [272.12141186, 272.33525716, 272.57438228, ...,
                 257.54119409, 257.43666143, 257.32489843],
                ...,
                [285.67948184, 285.70107004, 279.95661893, ...,
                 284.47058703, 284.59136631, 284.92357635],
                [286.17525018, 285.48985257, 273.18628991, ...,
                 285.73524873, 285.73426189, 285.88818028],
                [286.77910083, 287.33068284, 273.45897144, ...,
                 285.36925507, 285.07512499, 286.14380248]]]],
      
      
      
             [[[[269.91518502, 270.05761354, 270.15663313, ...,
                 257.8192147 , 257.88366616, 257.84662048],
                [270.48587567, 270.63411646, 270.77948993, ...,
                 258.2646282 , 258.2993592 , 258.42780437],
                [271.03841135, 271.19229524, 271.38415793, ...,
                 258.79569278, 258.94506869, 259.02358146],
                ...,
                [286.38918139, 286.40805883, 280.829627  , ...,
                 284.85987622, 284.93646074, 285.10812444],
                [286.71390102, 285.80048603, 273.08191581, ...,
                 286.09212162, 286.09620401, 286.11887094],
                [287.04279958, 287.43300098, 273.90002309, ...,
                 285.52468275, 285.2101802 , 286.20461074]],
      
               [[269.21230217, 269.43683425, 269.69086423, ...,
                 258.4331806 , 258.41820311, 258.38371426],
                [269.97317704, 270.14767721, 270.41571675, ...,
                 258.90176524, 258.85690772, 258.80669652],
                [270.51163682, 270.70339667, 270.95504628, ...,
                 259.57745594, 259.47483527, 259.46456544],
                ...,
                [287.51697076, 287.7208242 , 282.70694832, ...,
                 284.85108881, 284.98716703, 285.23642598],
                [287.90605827, 287.35022835, 274.51250126, ...,
                 285.78870823, 285.89889526, 286.10977239],
                [288.24035943, 288.91756307, 275.01046753, ...,
                 285.21968045, 284.96945323, 286.23124761]],
      
               [[269.64260765, 269.8916616 , 270.10962942, ...,
                 257.50066906, 257.57033489, 257.59325807],
                [270.26619621, 270.52529045, 270.78096174, ...,
                 257.49142357, 257.55355006, 257.71903859],
                [270.64988874, 270.92117276, 271.20587191, ...,
                 257.73395505, 257.73438794, 257.85594841],
                ...,
                [286.22127865, 286.32669499, 280.57757966, ...,
                 284.28684135, 284.27253491, 284.3592599 ],
                [286.7512008 , 286.0742015 , 272.8857936 , ...,
                 285.4523133 , 285.42830061, 285.37787462],
                [287.22839687, 287.77510535, 273.89969071, ...,
                 284.83646691, 284.39529917, 285.48770307]],
      
               ...,
      
               [[270.74897335, 270.90002508, 271.04747341, ...,
                 256.70109923, 256.62760461, 256.49691607],
                [271.28628308, 271.49909907, 271.69465173, ...,
                 256.7937909 , 256.73754982, 256.80764505],
                [271.61058044, 271.86179982, 272.07560863, ...,
                 257.26328642, 257.16542484, 257.14524078],
                ...,
                [285.92061781, 285.98915067, 281.33805018, ...,
                 284.0066933 , 284.20505457, 284.34407309],
                [286.29421035, 285.53254169, 274.21324324, ...,
                 285.38482467, 285.45564469, 285.47853055],
                [286.54238195, 286.95610013, 274.86028854, ...,
                 285.13778554, 284.76900416, 285.77785293]],
      
               [[269.60183683, 269.78200664, 269.93641298, ...,
                 258.42875058, 258.42065927, 258.39809567],
                [270.2900928 , 270.43376591, 270.61618307, ...,
                 258.67971719, 258.61049636, 258.68695748],
                [270.75645414, 270.90629677, 271.07128044, ...,
                 259.26296284, 259.18296101, 259.19168489],
                ...,
                [286.95791228, 287.11748571, 282.16688936, ...,
                 282.88589345, 283.19850291, 283.40128293],
                [287.28976275, 286.8473325 , 275.87180163, ...,
                 284.20142066, 284.31544826, 284.39706388],
                [287.52987704, 288.0410959 , 276.77066305, ...,
                 283.75990561, 283.22402888, 284.50782311]],
      
               [[269.80673483, 269.93774713, 270.06958937, ...,
                 257.69061312, 257.77798462, 257.75754812],
                [270.51240374, 270.68446914, 270.83214237, ...,
                 258.24016488, 258.3227481 , 258.44707373],
                [271.04046001, 271.20151752, 271.3662325 , ...,
                 259.06435527, 259.1866669 , 259.29143756],
                ...,
                [286.36381564, 286.59110459, 281.50742241, ...,
                 283.33024962, 283.50765792, 283.85166036],
                [286.73040705, 286.25985552, 274.36856842, ...,
                 284.45405778, 284.6678145 , 284.77338011],
                [287.02254619, 287.35620814, 274.72848677, ...,
                 284.00255684, 283.70445815, 284.90459608]]],
      
      
              [[[270.35231283, 270.51515297, 270.6294622 , ...,
                 259.61998284, 259.63110634, 259.5576006 ],
                [270.86634462, 271.03154688, 271.16111291, ...,
                 259.9169081 , 259.88699357, 259.91544989],
                [271.02957054, 271.16610685, 271.36977785, ...,
                 260.45874256, 260.44405299, 260.42447961],
                ...,
                [286.60281273, 286.75442638, 281.72957943, ...,
                 283.86079241, 283.943709  , 284.21338952],
                [286.97654326, 286.31899361, 274.23848559, ...,
                 285.14716969, 285.1259958 , 285.22181834],
                [287.27924911, 287.82546665, 274.9034039 , ...,
                 284.57429106, 284.25122601, 285.44395911]],
      
               [[269.308951  , 269.49166041, 269.65269802, ...,
                 257.57850713, 257.63875232, 257.59048794],
                [269.76195228, 269.9401129 , 270.12995546, ...,
                 257.56529601, 257.61175487, 257.75912177],
                [270.13784724, 270.34635461, 270.50528916, ...,
                 257.96471322, 257.9238205 , 257.92530607],
                ...,
                [285.07205864, 285.25341266, 281.09396064, ...,
                 284.37487627, 284.55191869, 284.82325745],
                [285.49116019, 285.16645349, 274.52669791, ...,
                 285.50263811, 285.58556067, 285.75880764],
                [285.83228733, 286.35796389, 275.37595202, ...,
                 284.85755224, 284.52830505, 285.7807793 ]],
      
               [[268.87643764, 269.09732719, 269.29812158, ...,
                 258.80893027, 258.84471976, 258.81953795],
                [269.56737784, 269.75159023, 269.93462604, ...,
                 259.11082608, 259.20031489, 259.31333658],
                [269.9764265 , 270.18914331, 270.34567327, ...,
                 259.48440602, 259.52501911, 259.55597438],
                ...,
                [285.80039613, 285.89976269, 280.87743212, ...,
                 283.25981804, 283.43786886, 283.74362282],
                [286.26521633, 285.72639333, 273.85488593, ...,
                 284.59439186, 284.6528035 , 284.82770538],
                [286.7427942 , 287.20094797, 274.30072453, ...,
                 283.78179534, 283.42483919, 284.75451063]],
      
               ...,
      
               [[270.49075417, 270.64864316, 270.82708972, ...,
                 259.37941228, 259.37515541, 259.27318374],
                [271.34466586, 271.50744629, 271.70842279, ...,
                 259.69721952, 259.70390353, 259.80736907],
                [271.85431107, 272.02099576, 272.23783742, ...,
                 260.10712798, 260.13174571, 260.18695483],
                ...,
                [285.11683953, 285.41256117, 281.90332164, ...,
                 284.10127159, 284.27944283, 284.59395135],
                [285.57205764, 285.53156148, 275.67125337, ...,
                 285.49157549, 285.57830247, 285.65235602],
                [286.01502991, 286.72435694, 276.3470532 , ...,
                 285.00736867, 284.65747236, 285.79981497]],
      
               [[269.25174713, 269.36532327, 269.4742624 , ...,
                 258.25104091, 258.24330305, 258.13508838],
                [269.91065647, 270.02500252, 270.09732089, ...,
                 258.80840683, 258.84436301, 258.91206725],
                [270.52768475, 270.62113555, 270.73518935, ...,
                 259.30937195, 259.33914234, 259.36631825],
                ...,
                [286.25909523, 286.30176909, 280.87838049, ...,
                 283.09823741, 283.06406436, 283.20357115],
                [286.65662285, 286.04082887, 273.39484306, ...,
                 284.57920605, 284.55875563, 284.46474855],
                [287.02059572, 287.45258066, 274.38678874, ...,
                 284.15222632, 283.70242509, 284.82281627]],
      
               [[270.11341194, 270.27150328, 270.38067726, ...,
                 258.53617975, 258.53590294, 258.45782139],
                [270.84073606, 271.02407837, 271.17178046, ...,
                 258.77153297, 258.95761175, 259.14335815],
                [271.28950036, 271.54522506, 271.69570127, ...,
                 259.05817413, 259.17168327, 259.31725344],
                ...,
                [286.66230475, 286.69985862, 281.45861053, ...,
                 284.37898785, 284.50616455, 284.80398493],
                [287.02582915, 286.3542109 , 274.24672599, ...,
                 285.53284023, 285.62141319, 285.73562357],
                [287.46086618, 287.75939112, 275.28943866, ...,
                 285.02878438, 284.8213836 , 286.02565102]]],
      
      
              [[[270.90051999, 271.12173993, 271.30472664, ...,
                 259.24890336, 259.2308202 , 259.15622413],
                [271.74066096, 271.91267959, 272.16415505, ...,
                 259.26738722, 259.22022662, 259.18657353],
                [272.38510397, 272.61119809, 272.83591262, ...,
                 259.7956941 , 259.66657008, 259.45448436],
                ...,
                [286.99559353, 287.07704992, 280.36222076, ...,
                 284.90291894, 284.94335772, 285.15095354],
                [287.33252915, 286.49465345, 273.29067761, ...,
                 286.02596283, 285.98507923, 286.14163473],
                [287.70950782, 288.06892395, 274.08927619, ...,
                 285.33840113, 284.9471074 , 286.12522689]],
      
               [[269.16017449, 269.35609569, 269.51549099, ...,
                 258.30321635, 258.40542221, 258.50311213],
                [269.89006673, 270.1326493 , 270.38988959, ...,
                 258.62028868, 258.69097287, 258.9028735 ],
                [270.36344279, 270.57199627, 270.79734039, ...,
                 259.39154069, 259.43662411, 259.38469364],
                ...,
                [286.50438093, 286.63798324, 283.05486099, ...,
                 285.12908206, 285.32209479, 285.55565577],
                [286.91039774, 286.60444641, 276.28847968, ...,
                 286.21672688, 286.26165705, 286.42752506],
                [287.42077471, 287.98939813, 276.79764922, ...,
                 285.77784961, 285.47571829, 286.65780441]],
      
               [[269.79876609, 269.96595333, 270.09342094, ...,
                 257.83832732, 257.84245184, 257.75086444],
                [270.82535951, 271.00421408, 271.17876567, ...,
                 258.12751654, 258.0894578 , 258.10507069],
                [271.70748437, 271.83804952, 271.92014346, ...,
                 258.72505254, 258.74682617, 258.66520907],
                ...,
                [286.46094082, 286.64379684, 281.92836164, ...,
                 283.64439193, 283.72354922, 284.0811469 ],
                [286.79261282, 286.54556606, 273.89695673, ...,
                 284.8123839 , 284.7659869 , 284.91039011],
                [287.20973604, 287.80982639, 274.89108077, ...,
                 284.23145095, 283.92221202, 285.07907834]],
      
               ...,
      
               [[269.90209563, 270.04352536, 270.13350843, ...,
                 256.82965386, 256.84422501, 256.77442667],
                [270.70703589, 270.84830342, 270.91481018, ...,
                 257.27223786, 257.34484167, 257.48480191],
                [271.17120793, 271.30743441, 271.41757667, ...,
                 257.69502076, 257.79528643, 257.88544613],
                ...,
                [286.55896261, 286.66315891, 283.03212506, ...,
                 282.9309165 , 282.94134289, 283.25599073],
                [286.91142505, 286.68203835, 276.36051808, ...,
                 284.15016075, 284.23976699, 284.25783572],
                [287.34266231, 288.02444491, 276.39723969, ...,
                 283.4950127 , 283.06272888, 284.07687312]],
      
               [[268.79840652, 269.12089937, 269.39106386, ...,
                 259.67164944, 259.62522573, 259.46403503],
                [269.74628813, 270.02248018, 270.30619912, ...,
                 259.76408403, 259.79080134, 259.8421669 ],
                [270.38664445, 270.58706964, 270.79773281, ...,
                 260.12045802, 260.07776891, 260.01800073],
                ...,
                [286.74798916, 286.84504899, 281.98917488, ...,
                 282.36091415, 282.52960703, 282.91093345],
                [287.00769308, 286.44610297, 273.4593811 , ...,
                 283.58204717, 283.70314291, 283.8797488 ],
                [287.56598796, 288.22360661, 273.84890449, ...,
                 283.15013587, 282.78987055, 283.92178676]],
      
               [[268.5095122 , 268.7960079 , 269.02240753, ...,
                 262.08293799, 262.14508106, 262.1475515 ],
                [269.36087268, 269.61076587, 269.84696264, ...,
                 261.98340325, 262.05781389, 262.19606748],
                [269.96624225, 270.20194941, 270.4113743 , ...,
                 262.23535471, 262.28111615, 262.30688079],
                ...,
                [286.78966489, 286.83843696, 281.73768417, ...,
                 284.17741295, 284.24772047, 284.4079152 ],
                [287.04547086, 286.33293484, 273.87865548, ...,
                 285.37754888, 285.30876591, 285.36116227],
                [287.32591214, 287.71074809, 273.87158336, ...,
                 284.75072778, 284.44826839, 285.61388961]]]],
      
      
      
             [[[[269.06615879, 269.27253856, 269.44330133, ...,
                 259.53331176, 259.49647704, 259.35289831],
                [269.80872146, 269.99504919, 270.19323598, ...,
                 259.67888857, 259.64949649, 259.6444052 ],
                [270.33362878, 270.5039978 , 270.74623473, ...,
                 260.20811197, 260.15776775, 260.14952204],
                ...,
                [287.4051998 , 287.49768929, 283.08205547, ...,
                 283.0800496 , 283.26142286, 283.53075144],
                [287.61472719, 287.00884479, 276.72517262, ...,
                 284.22780675, 284.32764302, 284.49910703],
                [287.96754854, 288.25230507, 276.42094123, ...,
                 283.53275133, 283.24507207, 284.47622283]],
      
               [[270.71046282, 270.81783262, 270.93467945, ...,
                 257.04219735, 257.02114371, 256.92971304],
                [271.39603888, 271.45007656, 271.58431642, ...,
                 257.82480174, 257.77040531, 257.75844607],
                [271.70975428, 271.81335217, 272.02133245, ...,
                 258.78068675, 258.66620072, 258.58814206],
                ...,
                [287.38122161, 287.58450516, 283.42251487, ...,
                 284.21504477, 284.22836038, 284.34609886],
                [287.79783199, 287.28794098, 276.35045159, ...,
                 285.37344261, 285.2815565 , 285.24768133],
                [288.13434435, 288.59417924, 277.32386713, ...,
                 284.71342833, 284.29467773, 285.37562362]],
      
               [[270.05201754, 270.12815857, 270.19019583, ...,
                 258.93675132, 258.86811895, 258.64740123],
                [270.91780256, 270.9697876 , 271.02850441, ...,
                 258.85152187, 258.77534352, 258.80256122],
                [271.55833966, 271.62718831, 271.7513849 , ...,
                 259.2068644 , 259.19373355, 259.21675624],
                ...,
                [287.28871652, 287.42274807, 283.67703678, ...,
                 283.40217988, 283.67148457, 283.96058456],
                [287.67444246, 287.41724363, 277.48872939, ...,
                 284.76274441, 284.89573238, 284.93559597],
                [288.06668024, 288.66904483, 277.52674468, ...,
                 284.40319161, 284.07475049, 285.17405502]],
      
               ...,
      
               [[269.98386881, 270.18493918, 270.38735199, ...,
                 259.31283354, 259.16686116, 258.90248274],
                [270.28843788, 270.51479704, 270.7230218 , ...,
                 259.59104339, 259.51628063, 259.45332917],
                [270.54371709, 270.74536697, 270.91138823, ...,
                 260.1743184 , 260.02211397, 259.90535388],
                ...,
                [286.95085542, 286.93609221, 281.29371345, ...,
                 283.81187804, 283.88897539, 284.04908056],
                [287.33975518, 286.25343223, 274.72347193, ...,
                 285.13203828, 285.0797567 , 284.99001976],
                [287.75548023, 288.05209682, 275.04143955, ...,
                 284.35314543, 283.98333906, 285.10274141]],
      
               [[269.82728378, 269.97429193, 270.09136134, ...,
                 258.56706337, 258.56871049, 258.46425612],
                [270.41420646, 270.57363958, 270.7778662 , ...,
                 259.10622107, 259.16279718, 259.27576098],
                [270.73011083, 270.87001734, 271.1152974 , ...,
                 259.81059995, 259.95155036, 260.06869424],
                ...,
                [286.25300333, 286.29019762, 281.7970873 , ...,
                 284.66009256, 284.7759479 , 284.95052172],
                [286.70561086, 286.25498398, 274.70935888, ...,
                 285.89037754, 285.80560833, 285.8684636 ],
                [287.07419885, 287.65388456, 276.10337465, ...,
                 285.38071608, 284.89413983, 285.90154067]],
      
               [[269.31756724, 269.52874922, 269.72550832, ...,
                 261.18316319, 261.11577673, 260.8981446 ],
                [270.14656763, 270.39546535, 270.67621977, ...,
                 261.45855215, 261.40951803, 261.3808481 ],
                [270.79379173, 271.05204076, 271.33787603, ...,
                 261.97668225, 261.94356305, 261.96207428],
                ...,
                [286.48724929, 286.56251028, 281.46034009, ...,
                 285.88287022, 285.99767436, 286.14351455],
                [286.79305201, 286.11826689, 274.13607257, ...,
                 287.07244309, 287.0852691 , 287.19412729],
                [287.20847553, 287.68806756, 274.06363811, ...,
                 286.47212949, 286.22294484, 287.32571345]]],
      
      
              [[[271.02128468, 271.17079693, 271.24422322, ...,
                 260.11856477, 260.07931734, 260.00924948],
                [271.64163606, 271.8366958 , 271.98430103, ...,
                 260.53698797, 260.41630289, 260.41468214],
                [272.14453092, 272.27324245, 272.43955861, ...,
                 261.20901224, 261.11915024, 261.07921866],
                ...,
                [286.93638777, 287.00406282, 281.58865191, ...,
                 284.28099989, 284.34277078, 284.55005845],
                [287.21305482, 286.57272505, 274.5022782 , ...,
                 285.29503366, 285.38795007, 285.47407698],
                [287.55392987, 287.81531989, 274.96039581, ...,
                 284.77331311, 284.54309779, 285.73552339]],
      
               [[270.28675146, 270.47058039, 270.64959982, ...,
                 259.64409156, 259.61767595, 259.52733214],
                [270.74179608, 270.8583165 , 271.07311116, ...,
                 259.75488066, 259.67777899, 259.76970092],
                [271.01289733, 271.12698033, 271.33288077, ...,
                 260.16477834, 260.17405187, 260.20754259],
                ...,
                [287.23475183, 287.41735574, 282.15980331, ...,
                 284.78815825, 284.96760791, 285.17979829],
                [287.54363947, 286.82026938, 274.80258444, ...,
                 285.90914419, 285.95053067, 286.13421664],
                [287.78823587, 288.32147648, 275.51318592, ...,
                 285.35775956, 285.00431592, 286.15294083]],
      
               [[269.51757547, 269.65544327, 269.7360465 , ...,
                 260.07734995, 259.9948558 , 259.80900308],
                [270.50106845, 270.65246084, 270.81817063, ...,
                 260.40881746, 260.28253887, 260.16011777],
                [271.04635686, 271.14278644, 271.27507351, ...,
                 260.86644048, 260.71121548, 260.58476407],
                ...,
                [287.55784076, 287.57602559, 281.82145757, ...,
                 284.56032164, 284.77199787, 284.92432404],
                [287.81106601, 286.9912869 , 273.8039637 , ...,
                 285.51745572, 285.62780463, 285.81647193],
                [288.07131958, 288.5956819 , 274.91384589, ...,
                 284.38427303, 284.1473246 , 285.43803306]],
      
               ...,
      
               [[267.58597764, 267.69762587, 267.77413244, ...,
                 262.90474767, 262.86238861, 262.6784872 ],
                [268.29899033, 268.44509689, 268.53846309, ...,
                 263.41949894, 263.26722883, 263.07227906],
                [268.95749963, 269.07577481, 269.19106956, ...,
                 264.19199736, 263.95501112, 263.78797714],
                ...,
                [289.2449311 , 289.16544375, 281.35910698, ...,
                 284.43734575, 284.64236881, 285.0686201 ],
                [289.37284752, 288.03226969, 273.3702439 , ...,
                 285.62100883, 285.61132647, 285.80379022],
                [289.41581792, 289.22580653, 272.55133952, ...,
                 284.87914243, 284.60298754, 285.82638882]],
      
               [[269.79706308, 269.98988574, 270.1316326 , ...,
                 261.53465171, 261.49541424, 261.42802545],
                [270.45658045, 270.58849932, 270.77898341, ...,
                 262.04208507, 261.97272077, 261.9328809 ],
                [270.79295913, 270.96300042, 271.13901055, ...,
                 262.51901726, 262.46326679, 262.43545134],
                ...,
                [285.77619437, 285.97922184, 281.4484986 , ...,
                 283.44110074, 283.73295859, 283.96879014],
                [286.33802862, 285.7675141 , 274.54297008, ...,
                 284.5286016 , 284.64702075, 284.77585171],
                [286.79267485, 287.35202922, 275.54740209, ...,
                 283.88906363, 283.43960372, 284.62318984]],
      
               [[269.65833946, 269.82059114, 269.96195155, ...,
                 261.50137097, 261.65283203, 261.65924537],
                [270.45514347, 270.55032946, 270.7102764 , ...,
                 261.8522309 , 261.94138369, 262.08751745],
                [271.03518942, 271.12782155, 271.28776849, ...,
                 262.18311774, 262.22812553, 262.34417061],
                ...,
                [286.04266988, 286.26989779, 281.85792243, ...,
                 284.21988313, 284.5260431 , 284.80774656],
                [286.40065168, 286.15243331, 274.49307749, ...,
                 285.4626979 , 285.53848598, 285.6328815 ],
                [286.69893248, 287.215748  , 275.39704729, ...,
                 285.00986514, 284.62417503, 285.75246728]]],
      
      
              [[[269.63361624, 269.92423049, 270.12769052, ...,
                 259.91745592, 259.96462565, 259.8618927 ],
                [270.38940264, 270.63698379, 270.82497572, ...,
                 260.2762481 , 260.31311682, 260.36056867],
                [270.99676082, 271.24271691, 271.46427254, ...,
                 260.83055546, 260.79375607, 260.80125096],
                ...,
                [287.14729409, 287.17281408, 281.61405149, ...,
                 284.57436238, 284.58561043, 284.791143  ],
                [287.43472091, 286.66974076, 272.99914683, ...,
                 285.61914958, 285.51639258, 285.58796227],
                [287.87012316, 288.36948627, 273.63380366, ...,
                 284.86240686, 284.49651337, 285.52478492]],
      
               [[270.74638201, 270.94932822, 271.09642029, ...,
                 259.19024227, 259.14991594, 259.06394942],
                [271.36874091, 271.61198027, 271.76087321, ...,
                 259.41725225, 259.37519787, 259.41342561],
                [271.93496605, 272.17532913, 272.41339841, ...,
                 259.85985068, 259.90705474, 259.93438986],
                ...,
                [287.44328242, 287.38022149, 281.78762088, ...,
                 284.35671898, 284.53977004, 284.9054111 ],
                [287.64597486, 286.89695839, 274.91562852, ...,
                 285.78773167, 285.91673478, 286.05213331],
                [287.90841177, 288.22809667, 275.12800034, ...,
                 286.01304892, 285.5640428 , 286.47001781]],
      
               [[271.16478132, 271.37713922, 271.54244464, ...,
                 263.80586807, 263.79702891, 263.64949367],
                [271.68433513, 271.86363983, 272.02985515, ...,
                 264.08574776, 264.02179685, 263.9569523 ],
                [272.02640434, 272.2225992 , 272.40095686, ...,
                 264.66426086, 264.54396488, 264.46557086],
                ...,
                [286.13494375, 286.17098501, 280.66769077, ...,
                 285.25776606, 285.54686538, 285.85950072],
                [286.56084674, 285.76588274, 273.20012068, ...,
                 286.07636161, 286.12984997, 286.43562649],
                [286.98658421, 287.34512329, 273.90970346, ...,
                 285.26094122, 285.03325554, 286.18697589]],
      
               ...,
      
               [[268.92368084, 269.07489213, 269.17253212, ...,
                 259.83751645, 259.913653  , 259.94724124],
                [270.0595514 , 270.19366322, 270.27090786, ...,
                 259.95971447, 259.93671832, 259.9540999 ],
                [271.04721501, 271.09286499, 271.1620636 , ...,
                 260.37109541, 260.2984931 , 260.34910766],
                ...,
                [286.50934999, 286.68430395, 280.79426011, ...,
                 284.19371796, 284.31128228, 284.59494184],
                [286.82588295, 286.23899112, 273.42682814, ...,
                 285.9723534 , 285.9193908 , 286.02114138],
                [287.21891951, 287.73579042, 273.96557717, ...,
                 285.47012429, 285.08115188, 286.17530159]],
      
               [[271.3296134 , 271.55052351, 271.72476661, ...,
                 259.74678404, 259.68608624, 259.56615017],
                [271.86742302, 272.06877899, 272.24192976, ...,
                 260.14764222, 260.07023903, 260.06534145],
                [272.06580353, 272.3102752 , 272.55315731, ...,
                 260.54530699, 260.50725804, 260.51385697],
                ...,
                [287.93825266, 287.86485423, 279.99292556, ...,
                 284.12559675, 284.40058965, 284.626159  ],
                [288.15636544, 286.90952931, 271.02514217, ...,
                 285.45817699, 285.55548626, 285.63036247],
                [288.58792711, 288.75779757, 270.29120636, ...,
                 285.19180829, 284.98752893, 285.93219425]],
      
               [[270.12012581, 270.26921513, 270.41291942, ...,
                 257.76817736, 257.87240285, 257.8775308 ],
                [270.76040318, 270.9358965 , 271.05466959, ...,
                 258.00180319, 258.09825599, 258.27359987],
                [271.20120306, 271.33157448, 271.50358714, ...,
                 258.49354321, 258.63722594, 258.82817277],
                ...,
                [286.18709796, 286.3604932 , 281.00520059, ...,
                 284.18015754, 284.41231835, 284.82863385],
                [286.48317221, 285.92893119, 274.05155016, ...,
                 285.49128425, 285.53281502, 285.69833772],
                [286.94503187, 287.61717257, 274.18027496, ...,
                 285.05898517, 284.73168945, 286.00680442]]]]])

Or as function:

[31]:
def season_mean(ds, years, calendar='standard'):
    # Make a DataArray with the number of days in each month, size = len(time)
    month_length = ds.time.dt.days_in_month

    # Calculate the weights by grouping by 'time.season'
    weights = month_length.groupby('time.year') / month_length.groupby('time.year').sum()

    # Test that the sum of the weights for each season is 1.0
    np.testing.assert_allclose(weights.groupby('time.year').sum().values, np.ones(years))

    # Calculate the weighted average
    return (ds * weights).groupby('time.year').sum(dim='time', min_count = 3)
[33]:
ERA5_Siberia_weighted = season_mean(ERA5_Siberia, years = 42)
ERA5_Siberia_weighted
[33]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 41
    • longitude: 132
    • year: 42
    • latitude
      (latitude)
      float32
      70.0 69.0 68.0 ... 32.0 31.0 30.0
      units :
      degrees_north
      long_name :
      latitude
      array([70., 69., 68., 67., 66., 65., 64., 63., 62., 61., 60., 59., 58., 57.,
             56., 55., 54., 53., 52., 51., 50., 49., 48., 47., 46., 45., 44., 43.,
             42., 41., 40., 39., 38., 37., 36., 35., 34., 33., 32., 31., 30.],
            dtype=float32)
    • longitude
      (longitude)
      float32
      -11.0 -10.0 -9.0 ... 119.0 120.0
      units :
      degrees_east
      long_name :
      longitude
      array([-11., -10.,  -9.,  -8.,  -7.,  -6.,  -5.,  -4.,  -3.,  -2.,  -1.,   0.,
               1.,   2.,   3.,   4.,   5.,   6.,   7.,   8.,   9.,  10.,  11.,  12.,
              13.,  14.,  15.,  16.,  17.,  18.,  19.,  20.,  21.,  22.,  23.,  24.,
              25.,  26.,  27.,  28.,  29.,  30.,  31.,  32.,  33.,  34.,  35.,  36.,
              37.,  38.,  39.,  40.,  41.,  42.,  43.,  44.,  45.,  46.,  47.,  48.,
              49.,  50.,  51.,  52.,  53.,  54.,  55.,  56.,  57.,  58.,  59.,  60.,
              61.,  62.,  63.,  64.,  65.,  66.,  67.,  68.,  69.,  70.,  71.,  72.,
              73.,  74.,  75.,  76.,  77.,  78.,  79.,  80.,  81.,  82.,  83.,  84.,
              85.,  86.,  87.,  88.,  89.,  90.,  91.,  92.,  93.,  94.,  95.,  96.,
              97.,  98.,  99., 100., 101., 102., 103., 104., 105., 106., 107., 108.,
             109., 110., 111., 112., 113., 114., 115., 116., 117., 118., 119., 120.],
            dtype=float32)
    • year
      (year)
      int64
      1979 1980 1981 ... 2018 2019 2020
      array([1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990,
             1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
             2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014,
             2015, 2016, 2017, 2018, 2019, 2020])
    • t2m
      (year, latitude, longitude)
      float64
      270.5 270.9 271.2 ... 289.1 290.6
      array([[[270.53845348, 270.90226215, 271.22064939, ..., 256.88882678,
               256.76314014, 256.44316632],
              [271.21075605, 271.58743916, 272.10160761, ..., 258.50939145,
               258.35444674, 258.34003249],
              [271.61115928, 271.98949233, 272.36104982, ..., 259.58987725,
               259.61455818, 259.5761601 ],
              ...,
              [289.77074333, 289.52894526, 289.55374345, ..., 287.64928668,
               287.54833089, 287.2222645 ],
              [289.92099298, 289.98857448, 285.8466024 , ..., 288.41151163,
               288.06052001, 288.03151703],
              [290.27319634, 290.02542214, 288.90056776, ..., 287.6235335 ,
               286.62242956, 287.85563295]],
      
             [[272.47546884, 272.75750998, 273.00497967, ..., 259.44512807,
               259.23107429, 258.71411664],
              [273.02040963, 273.30033277, 273.79829672, ..., 260.57161879,
               260.22838526, 260.16624102],
              [273.60945362, 273.79806419, 274.03776418, ..., 260.85592552,
               260.81758234, 260.90060823],
              ...,
              [290.29287952, 289.9930201 , 290.14131131, ..., 286.97752281,
               286.94516953, 286.3993182 ],
              [290.32587765, 290.11277837, 286.06247015, ..., 287.71539572,
               287.1034861 , 287.41468446],
              [290.48734449, 290.24152872, 288.26933123, ..., 286.70426178,
               285.67877628, 287.07606639]],
      
             [[270.85066754, 271.2507709 , 271.57826896, ..., 260.76708255,
               260.78421352, 260.35821367],
              [271.70493682, 272.06639066, 272.54059203, ..., 261.8014878 ,
               261.67763967, 261.59550576],
              [272.3355212 , 272.6204018 , 272.93550939, ..., 262.37989442,
               262.33512115, 262.37479799],
              ...,
              [290.14578181, 289.86415399, 289.97064508, ..., 288.84671949,
               288.58071369, 288.42606818],
              [290.29717852, 290.04429527, 285.92263396, ..., 289.40699602,
               289.05557948, 289.11679575],
              [290.42925992, 290.23387179, 288.20256341, ..., 288.45622817,
               287.61726512, 288.78954481]],
      
             ...,
      
             [[273.93356224, 274.21504477, 274.45377881, ..., 261.43229327,
               261.43808763, 260.99563201],
              [274.19589532, 274.48848658, 275.03751042, ..., 262.39660761,
               262.2738193 , 262.09600415],
              [274.55402507, 274.74373726, 275.02716728, ..., 263.07369481,
               262.92978469, 262.88688626],
              ...,
              [289.97606924, 289.72782334, 289.86853094, ..., 290.54649751,
               290.40096382, 290.259144  ],
              [290.08727828, 289.40257064, 285.77515876, ..., 291.61008155,
               291.35451043, 291.37790116],
              [290.29168336, 289.63168368, 287.78337761, ..., 290.87840039,
               290.21575497, 291.59742173]],
      
             [[272.928425  , 273.18573562, 273.41191433, ..., 263.66581245,
               263.67493704, 263.23926511],
              [273.46121614, 273.77523572, 274.24082317, ..., 264.7070548 ,
               264.54024887, 264.37905254],
              [273.9498762 , 274.12044724, 274.33304463, ..., 265.20289181,
               265.18147394, 265.24060589],
              ...,
              [290.73547264, 290.23868926, 291.9598936 , ..., 289.92534438,
               289.92701754, 289.64130534],
              [290.66058582, 290.17593351, 288.22335451, ..., 290.76902406,
               290.51999764, 290.59552599],
              [290.81727103, 290.13983685, 291.03420589, ..., 289.73828888,
               288.9285421 , 290.25149636]],
      
             [[271.86548681, 272.1268692 , 272.38349152, ..., 264.56114479,
               264.38686586, 263.81075569],
              [272.51668084, 272.7602277 , 273.16793027, ..., 265.4545993 ,
               265.15164831, 265.09558504],
              [273.1618513 , 273.33289702, 273.55358455, ..., 266.01881657,
               265.8605491 , 265.85815994],
              ...,
              [291.15030073, 290.76279051, 291.74977875, ..., 290.25953077,
               289.86484428, 289.58513608],
              [291.21759663, 290.39006275, 287.89739526, ..., 290.94006845,
               290.63725049, 290.79393105],
              [291.49315975, 290.68042888, 289.96384828, ..., 290.03618721,
               289.1397526 , 290.5711388 ]]])
    • d2m
      (year, latitude, longitude)
      float64
      267.1 267.4 267.8 ... 283.5 284.7
      array([[[267.08530592, 267.44651861, 267.78679027, ..., 252.60430344,
               252.59938331, 252.54768007],
              [267.75876717, 268.13905567, 268.57483043, ..., 253.91470951,
               253.85659807, 253.86594739],
              [268.28329468, 268.6458173 , 268.94433925, ..., 254.96331853,
               254.90412206, 254.82613124],
              ...,
              [285.2836652 , 285.52568253, 282.18790071, ..., 281.98624122,
               282.0235599 , 282.09372977],
              [285.81397015, 285.74176954, 275.2587466 , ..., 283.47724981,
               283.29016611, 283.73143005],
              [286.27695631, 286.54966238, 276.11770232, ..., 283.09150099,
               282.35261735, 283.54230234]],
      
             [[270.0560462 , 270.28085194, 270.50536512, ..., 254.73382121,
               254.53267437, 254.22853171],
              [270.64404629, 270.90351403, 271.29315783, ..., 255.49363708,
               255.13780428, 254.97790925],
              [271.23682536, 271.45255512, 271.69985099, ..., 255.72470076,
               255.46575181, 255.3253693 ],
              ...,
              [286.34983129, 286.44495193, 284.45133408, ..., 281.90314152,
               281.87271085, 281.82724165],
              [286.76781298, 286.81808405, 279.2684711 , ..., 283.19177644,
               282.87829822, 283.40576769],
              [287.14303854, 287.42607183, 281.56492582, ..., 282.82251673,
               281.96020176, 283.20188506]],
      
             [[267.48594533, 267.75006535, 267.98242519, ..., 255.7427743 ,
               255.73121328, 255.49709801],
              [268.30199897, 268.56740968, 268.89460257, ..., 256.59632376,
               256.48026126, 256.30581798],
              [269.08470983, 269.28889532, 269.52602685, ..., 257.26749702,
               257.06190341, 256.8050834 ],
              ...,
              [285.6106919 , 285.80548792, 283.16996533, ..., 282.80867336,
               283.04773115, 283.06608018],
              [286.05431532, 286.18231102, 277.65601946, ..., 284.3706121 ,
               284.1623429 , 284.54197991],
              [286.42097672, 286.77872633, 279.5448071 , ..., 284.05219169,
               283.33775728, 284.42656509]],
      
             ...,
      
             [[270.8889399 , 271.09284874, 271.30223382, ..., 256.22794724,
               256.34163848, 256.16001826],
              [271.37453029, 271.57490307, 271.92048413, ..., 257.14158829,
               257.04828694, 256.84056008],
              [271.89897587, 272.05106586, 272.23722707, ..., 257.96104896,
               257.65194271, 257.40792432],
              ...,
              [285.86931079, 286.0414578 , 283.64100116, ..., 285.465679  ,
               285.35143844, 285.22891733],
              [286.3004701 , 286.23255157, 277.32089532, ..., 286.72803962,
               286.51520671, 287.08830891],
              [286.65807343, 286.88324638, 279.45262279, ..., 285.97165017,
               285.23219565, 286.46798507]],
      
             [[269.58005623, 269.73718129, 269.90134629, ..., 258.65804755,
               258.74450634, 258.56263385],
              [270.28108414, 270.45363352, 270.73014566, ..., 259.4485535 ,
               259.27823606, 259.1722495 ],
              [270.95068658, 271.06147368, 271.16166753, ..., 260.15164798,
               259.97192383, 259.90708127],
              ...,
              [287.14252605, 287.17520473, 283.60553111, ..., 283.28956504,
               283.36251765, 283.51566016],
              [287.46080647, 286.90985373, 275.88732777, ..., 284.7537603 ,
               284.6344505 , 285.4749255 ],
              [287.82753422, 287.799535  , 276.99410314, ..., 284.49364737,
               283.64042332, 284.94194031]],
      
             [[268.33366295, 268.53917329, 268.75751694, ..., 259.42017729,
               259.39134017, 259.11995863],
              [269.06553683, 269.25900368, 269.56070411, ..., 259.9021696 ,
               259.6504034 , 259.52636603],
              [269.90905098, 270.0588097 , 270.22716788, ..., 260.5269316 ,
               260.27090885, 260.2320288 ],
              ...,
              [287.246657  , 287.37171538, 284.46413554, ..., 283.36024508,
               283.78340514, 283.89836618],
              [287.64222153, 287.32740386, 277.1937969 , ..., 285.15094127,
               284.92933655, 285.47841677],
              [287.93024146, 288.0426241 , 279.17122153, ..., 284.31629977,
               283.4837139 , 284.74968753]]])

What is the difference between the mean and weighted mean?

Barely visible the difference

[34]:
ERA5_Siberia_weighted['t2m'].mean(['longitude', 'latitude']).plot()
ERA5_Siberia['t2m'].groupby('time.year').mean().mean(['longitude','latitude']).plot()
[34]:
[<matplotlib.lines.Line2D at 0x2aedbb30ca90>]
[34]:
[<matplotlib.lines.Line2D at 0x2aed3bf98b50>]
_images/Notebooks_2.Preprocess_2.Preprocess_25_2.png
Spatial selection

What spatial extent defines the event you are analyzing? The easiest option is to select a lat-lon box, like we did for the Siberian heatwave example (i.e we average the temperature over 30-70N, -11-120E).

In case you want to specify another domain than a lat-lon box, you could mask the datasets. For the California Fires example, we select the domain with high temperature anomalies (>2 standard deviation), see California_august_temperature_anomaly. For the UK example, we want a country-averaged timeseries instead of a box. In this case, we use another observational product: the EOBS dataset that covers Europe. We upscale this dataset to the same resolution as SEAS5 and create a mask to take the spatial average over the UK, see Using EOBS + upscaling.

[35]:
ERA5_Siberia_events = (
    ERA5_Siberia_weighted['t2m'].sel(  # Select 2 metre temperature
        latitude=slice(70, 30),        # Select the latitudes
        longitude=slice(-11, 120)).    # Select the longitude
    mean(['longitude', 'latitude']))   # And average
ERA5_Siberia_events
[35]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
't2m'
  • year: 42
  • 277.2 277.0 278.0 277.9 278.0 277.7 ... 280.0 279.6 279.0 279.6 280.4
    array([277.16074991, 277.03096514, 277.97289103, 277.91908656,
           277.97520289, 277.65083809, 277.41882817, 277.91126484,
           276.91748994, 277.7290794 , 278.77625033, 279.26028161,
           277.8734671 , 277.73297789, 278.05803743, 278.33474762,
           278.8209804 , 277.56676759, 279.12484889, 278.01516085,
           277.87531784, 279.26812975, 278.86348174, 279.10661042,
           278.37979554, 278.49025936, 278.74264131, 278.30305153,
           279.58431666, 279.54500525, 278.82677061, 278.60606811,
           279.51421559, 279.21937005, 278.59269493, 279.92328752,
           279.6721145 , 280.00902662, 279.55917477, 278.99138847,
           279.61443777, 280.41497365])
    • year
      (year)
      int64
      1979 1980 1981 ... 2018 2019 2020
      array([1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990,
             1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
             2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014,
             2015, 2016, 2017, 2018, 2019, 2020])

In addition to the large domain, we select one more specific domain that faced the highest anomalies, also used here

[36]:
ERA5_Siberia_events_zoomed = (
    ERA5_Siberia_weighted['t2m'].sel(  # Select 2 metre temperature
        latitude=slice(70, 50),        # Select the latitudes
        longitude=slice(65, 120)).    # Select the longitude
    mean(['longitude', 'latitude']))

And we repeat this for the SEAS5 events

[37]:
SEAS5_Siberia_events = (
    SEAS5_Siberia_weighted['t2m'].sel(
        latitude=slice(70, 30),
        longitude=slice(-11, 120)).
    mean(['longitude', 'latitude']))
SEAS5_Siberia_events.load()
/soge-home/users/cenv0732/.conda/envs/UNSEEN-open/lib/python3.8/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis=axis, dtype=dtype)
[37]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
't2m'
  • year: 39
  • leadtime: 3
  • number: 51
  • 277.7 277.1 277.1 276.4 277.6 277.0 ... 277.9 277.8 279.0 278.8 278.2
    array([[[277.70246026, 277.08011538, 277.05805243, ...,          nan,
                      nan,          nan],
            [276.54063304, 277.63527276, 276.53540684, ...,          nan,
                      nan,          nan],
            [276.94382457, 277.22540106, 277.25375804, ...,          nan,
                      nan,          nan]],
    
           [[276.68638666, 276.64418409, 276.88169219, ...,          nan,
                      nan,          nan],
            [277.06362955, 277.30470221, 276.49967939, ...,          nan,
                      nan,          nan],
            [276.37166345, 276.63563118, 277.05456392, ...,          nan,
                      nan,          nan]],
    
           [[277.53103277, 277.49691758, 278.32115366, ...,          nan,
                      nan,          nan],
            [277.53911427, 278.11393678, 277.66278741, ...,          nan,
                      nan,          nan],
            [278.24589375, 277.71341079, 277.3067712 , ...,          nan,
                      nan,          nan]],
    
           ...,
    
           [[278.78906418, 278.0626699 , 278.09438675, ..., 278.10947691,
             278.27620377, 278.18620179],
            [278.65929139, 277.33954004, 278.65951576, ..., 278.22959696,
             278.32163068, 278.94724957],
            [278.90689211, 277.9030209 , 279.13818072, ..., 278.76767259,
             279.13397914, 277.76992423]],
    
           [[278.6218426 , 277.95006232, 278.22900254, ..., 277.56330007,
             277.99480916, 277.66857676],
            [278.39808792, 277.65889255, 277.92266928, ..., 278.39390445,
             277.90353039, 278.01793147],
            [278.63429219, 278.11630486, 278.58465727, ..., 277.7081865 ,
             277.73949614, 278.65482764]],
    
           [[279.28124227, 278.53474142, 278.47436518, ..., 278.93209185,
             278.11716261, 279.3904762 ],
            [277.77935773, 279.15571385, 279.02168652, ..., 279.25803913,
             278.8991169 , 278.72803803],
            [278.54721722, 278.25816177, 279.65502139, ..., 279.01242149,
             278.80174459, 278.23615329]]])
    • leadtime
      (leadtime)
      int64
      2 3 4
      array([2, 3, 4])
    • number
      (number)
      int64
      0 1 2 3 4 5 6 ... 45 46 47 48 49 50
      long_name :
      ensemble_member
      array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,
             18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
             36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50])
    • year
      (year)
      int64
      1982 1983 1984 ... 2018 2019 2020
      array([1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
             1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
             2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
             2018, 2019, 2020])
[39]:
SEAS5_Siberia_events_zoomed = (
    SEAS5_Siberia_weighted['t2m'].sel(
        latitude=slice(70, 50),
        longitude=slice(65, 120)).
    mean(['longitude', 'latitude']))
SEAS5_Siberia_events_zoomed.load()
[39]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
't2m'
  • year: 39
  • leadtime: 3
  • number: 51
  • 269.4 267.5 268.9 266.8 269.6 267.9 ... 268.2 270.0 270.0 269.8 267.2
    array([[[269.41349502, 267.46724112, 268.92858923, ...,          nan,
                      nan,          nan],
            [267.30541714, 269.45786213, 267.88083134, ...,          nan,
                      nan,          nan],
            [266.70463988, 269.36559057, 267.85380896, ...,          nan,
                      nan,          nan]],
    
           [[267.65255078, 267.85459971, 267.93397041, ...,          nan,
                      nan,          nan],
            [267.86908721, 269.16875401, 266.25505375, ...,          nan,
                      nan,          nan],
            [267.37705396, 268.0216673 , 269.216725  , ...,          nan,
                      nan,          nan]],
    
           [[269.11559244, 270.30993792, 268.97992022, ...,          nan,
                      nan,          nan],
            [268.42632866, 270.23730451, 268.14872887, ...,          nan,
                      nan,          nan],
            [269.91675564, 269.37623754, 268.62430776, ...,          nan,
                      nan,          nan]],
    
           ...,
    
           [[270.1395106 , 269.2763681 , 269.63408345, ..., 267.98167445,
             270.99148119, 269.2334804 ],
            [269.47838693, 267.62436995, 270.46814617, ..., 269.60061317,
             269.2030878 , 270.34174847],
            [271.39762301, 268.06102893, 271.27933216, ..., 269.56866515,
             270.64943148, 266.36754614]],
    
           [[269.32829344, 268.54758963, 269.10385302, ..., 268.03762412,
             269.16690743, 268.41760566],
            [269.09579833, 268.27844902, 268.80430384, ..., 269.38437353,
             269.58112924, 269.15390309],
            [269.2755198 , 269.28402279, 270.34429505, ..., 268.05044769,
             269.01128231, 270.09822017]],
    
           [[271.35447849, 269.73507649, 269.16852164, ..., 270.77523033,
             268.30803885, 271.87237937],
            [269.33923167, 270.81122764, 269.97102764, ..., 272.56708782,
             270.69195734, 269.90622653],
            [270.37695877, 269.72247595, 272.524012  , ..., 270.04026793,
             269.81585811, 267.24061429]]])
    • leadtime
      (leadtime)
      int64
      2 3 4
      array([2, 3, 4])
    • number
      (number)
      int64
      0 1 2 3 4 5 6 ... 45 46 47 48 49 50
      long_name :
      ensemble_member
      array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,
             18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
             36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50])
    • year
      (year)
      int64
      1982 1983 1984 ... 2018 2019 2020
      array([1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993,
             1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
             2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
             2018, 2019, 2020])
[40]:
SEAS5_Siberia_events.to_dataframe().to_csv('Data/SEAS5_Siberia_events.csv')
ERA5_Siberia_events.to_dataframe().to_csv('Data/ERA5_Siberia_events.csv')
[41]:
SEAS5_Siberia_events_zoomed.to_dataframe().to_csv('Data/SEAS5_Siberia_events_zoomed.csv')
ERA5_Siberia_events_zoomed.to_dataframe().to_csv('Data/ERA5_Siberia_events_zoomed.csv')

Evaluate

Can seasonal forecasts be used as ‘alternate’ realities? Here we show how a set of evaluation metrics can be used to answer this question. The evaluation metrics are available through an R package for easy evaluation of the UNSEEN ensemble. Here, we illustrate how this package can be used in the UNSEEN workflow. We will evaluate the generated UNSEEN ensemble of UK February precipitation and of MAM Siberian heatwaves.

The framework to evaluate the UNSEEN ensemble presented here consists of testing the ensemble member independence, model stability and model fidelity, see also NPJ preprint.

Note

This is R code and not python!

We switch to R since we believe R has a better functionality in extreme value statistics.

We load the UNSEEN package and read in the data.

[2]:
library(UNSEEN)

The data that is imported here are the files stored at the end of the preprocessing step.

[125]:
SEAS5_Siberia_events <- read.csv("Data/SEAS5_Siberia_events.csv", stringsAsFactors=FALSE)
ERA5_Siberia_events <- read.csv("Data/ERA5_Siberia_events.csv", stringsAsFactors=FALSE)
[126]:
SEAS5_Siberia_events_zoomed <- read.csv("Data/SEAS5_Siberia_events_zoomed.csv", stringsAsFactors=FALSE)
ERA5_Siberia_events_zoomed <- read.csv("Data/ERA5_Siberia_events_zoomed.csv", stringsAsFactors=FALSE)
[127]:
SEAS5_Siberia_events$t2m <- SEAS5_Siberia_events$t2m - 273.15
ERA5_Siberia_events$t2m <- ERA5_Siberia_events$t2m - 273.15
SEAS5_Siberia_events_zoomed$t2m <- SEAS5_Siberia_events_zoomed$t2m - 273.15
ERA5_Siberia_events_zoomed$t2m <- ERA5_Siberia_events_zoomed$t2m - 273.15

[6]:
head(SEAS5_Siberia_events_zoomed,n = 3)
head(ERA5_Siberia_events, n = 3)
A data.frame: 3 × 4
yearleadtimenumbert2m
<int><int><int><dbl>
1198220-3.736505
2198221-5.682759
3198222-4.221411
A data.frame: 3 × 2
yeart2m
<int><dbl>
119794.010750
219803.880965
319814.822891
[7]:
EOBS_UK_weighted_df <- read.csv("Data/EOBS_UK_weighted_upscaled.csv", stringsAsFactors=FALSE)
SEAS5_UK_weighted_df <- read.csv("Data/SEAS5_UK_weighted_masked.csv", stringsAsFactors=FALSE)

And then convert the time class to Date format, with the ymd function in lubridate:

[42]:
EOBS_UK_weighted_df$time <- lubridate::ymd(EOBS_UK_weighted_df$time)
str(EOBS_UK_weighted_df)

EOBS_UK_weighted_df_hindcast <- EOBS_UK_weighted_df[
    EOBS_UK_weighted_df$time > '1982-02-01' &
    EOBS_UK_weighted_df$time < '2017-02-01',
    ]


SEAS5_UK_weighted_df$time <- lubridate::ymd(SEAS5_UK_weighted_df$time)
str(SEAS5_UK_weighted_df)
'data.frame':   71 obs. of  2 variables:
 $ time: Date, format: "1950-02-28" "1951-02-28" ...
 $ rr  : num  4.13 3.25 1.07 1.59 2.59 ...
'data.frame':   4375 obs. of  4 variables:
 $ leadtime: int  2 2 2 2 2 2 2 2 2 2 ...
 $ number  : int  0 0 0 0 0 0 0 0 0 0 ...
 $ time    : Date, format: "1982-02-01" "1983-02-01" ...
 $ tprate  : num  1.62 2.93 3.27 2 3.31 ...

Timeseries

Here we plot the timeseries of SEAS5 (UNSEEN) and ERA5 (OBS) for the entire domain and a zoomed domain for the Siberian Heatwave.

[9]:
unseen_timeseries(
    ensemble = SEAS5_Siberia_events,
    obs = ERA5_Siberia_events,
    ensemble_yname = "t2m",
    ensemble_xname = "year",
    obs_yname = "t2m",
    obs_xname = "year",
    ylab = "MAM Siberian temperature (C)")
Warning message:
"Removed 2756 rows containing non-finite values (stat_boxplot)."
_images/Notebooks_3.Evaluate_3.Evaluate_14_1.png
[10]:
unseen_timeseries(
    ensemble = SEAS5_Siberia_events_zoomed,
    obs = ERA5_Siberia_events_zoomed,
    ensemble_yname = "t2m",
    ensemble_xname = "year",
    obs_yname = "t2m",
    obs_xname = "year",
    ylab = "MAM Siberian temperature (C)")
Warning message:
"Removed 2756 rows containing non-finite values (stat_boxplot)."
_images/Notebooks_3.Evaluate_3.Evaluate_15_1.png

This shows that there is a temperature trend over the entire domain. Here we will continue with the ‘zoomed’ domain because it better describes the 2020 event.

The timeseries consist of hindcast (years 1982-2016) and archived forecasts (years 2017-2020). The datasets are slightly different: the hindcasts contains 25 members whereas operational forecasts contain 51 members, the native resolution is different and the dataset from which the forecasts are initialized is different.

For the evaluation of the UNSEEN ensemble we want to only use the SEAS5 hindcasts for a consistent dataset. Note, 2017 is not used in either the hindcast nor the operational dataset in this example, since it contains forecasts both initialized in 2016 (hindcast) and 2017 (forecast), see retrieve. We split SEAS5 into hindcast and operational forecasts:

[24]:
SEAS5_Siberia_events_zoomed_hindcast <- SEAS5_Siberia_events_zoomed[
    SEAS5_Siberia_events_zoomed$year < 2017 &
    SEAS5_Siberia_events_zoomed$number < 25,]

SEAS5_Siberia_events_zoomed_forecasts <- SEAS5_Siberia_events_zoomed[
    SEAS5_Siberia_events_zoomed$year > 2017,]

And we select the same years for ERA5.

[32]:
ERA5_Siberia_events_zoomed_hindcast <- ERA5_Siberia_events_zoomed[
    ERA5_Siberia_events_zoomed$year < 2017 &
    ERA5_Siberia_events_zoomed$year > 1981,]
[33]:
unseen_timeseries(
    ensemble = SEAS5_Siberia_events_zoomed_hindcast,
    obs = ERA5_Siberia_events_zoomed_hindcast,
    ensemble_yname = "t2m",
    ensemble_xname = "year",
    obs_yname = "t2m",
    obs_xname = "year",
    ylab = "MAM Siberian temperature")
_images/Notebooks_3.Evaluate_3.Evaluate_20_0.png
[26]:
unseen_timeseries(
    ensemble = SEAS5_Siberia_events_zoomed_forecasts,
    obs = ERA5_Siberia_events_zoomed[ERA5_Siberia_events_zoomed$year > 2017,],
    ensemble_yname = "t2m",
    ensemble_xname = "year",
    obs_yname = "t2m",
    obs_xname = "year",
    ylab = "MAM Siberian temperature")
_images/Notebooks_3.Evaluate_3.Evaluate_21_0.png

For the UK we have a longer historical record available from EOBS:

[12]:
unseen_timeseries(ensemble = SEAS5_UK_weighted_df,
                  obs = EOBS_UK_weighted_df,
                  ylab = 'UK February precipitation (mm/d)')
_images/Notebooks_3.Evaluate_3.Evaluate_23_0.png
[38]:
unseen_timeseries(ensemble = SEAS5_UK_weighted_df,
                  obs = EOBS_UK_weighted_df_hindcast,
                  ylab = 'UK February precipitation (mm/d)')
_images/Notebooks_3.Evaluate_3.Evaluate_24_0.png

Call the documentation of the function with ?unseen_timeseries

Independence

Significance ranges need fixing + detrend method (Rob)

[14]:
independence_test(
    ensemble = SEAS5_Siberia_events,
    n_lds = 3,
    var_name = "t2m",
)
Warning message:
"Removed 975 rows containing non-finite values (stat_ydensity)."
Warning message:
"Removed 975 rows containing non-finite values (stat_boxplot)."
_images/Notebooks_3.Evaluate_3.Evaluate_28_1.png
[15]:
independence_test(
    ensemble = SEAS5_Siberia_events_zoomed,
    n_lds = 3,
    var_name = "t2m",
)
Warning message:
"Removed 975 rows containing non-finite values (stat_ydensity)."
Warning message:
"Removed 975 rows containing non-finite values (stat_boxplot)."
_images/Notebooks_3.Evaluate_3.Evaluate_29_1.png
[16]:
independence_test(ensemble = SEAS5_UK)
Warning message:
"Removed 1625 rows containing non-finite values (stat_ydensity)."
Warning message:
"Removed 1625 rows containing non-finite values (stat_boxplot)."
_images/Notebooks_3.Evaluate_3.Evaluate_30_1.png

Stability

For the stability test we assess whether the events get more severe with leadtime, due to a potential ‘drift’ in the model. We need to use the consistent hindcast dataset for this.

[27]:
stability_test(
    ensemble = SEAS5_Siberia_events_zoomed_hindcast,
    lab = 'MAM Siberian temperature',
    var_name = 't2m'
)
Warning message:
"Removed 2 row(s) containing missing values (geom_path)."
_images/Notebooks_3.Evaluate_3.Evaluate_32_1.png
[8]:
stability_test(ensemble = SEAS5_UK, lab = 'UK February precipitation (mm/d)')
Warning message:
“Removed 4 row(s) containing missing values (geom_path).”
_images/Notebooks_3.Evaluate_3.Evaluate_33_1.png

Fidelity

[92]:
fidelity_test(
    obs = ERA5_Siberia_events_zoomed_hindcast$t2m,
    ensemble = SEAS5_Siberia_events_zoomed_hindcast$t2m,
    units = 'C',
    biascor = FALSE
)
_images/Notebooks_3.Evaluate_3.Evaluate_35_0.png

Lets apply a additive biascor

[90]:
#Lets apply a additive biascor
obs = ERA5_Siberia_events_zoomed_hindcast$t2m
ensemble = SEAS5_Siberia_events_zoomed_hindcast$t2m
ensemble_biascor = ensemble + (mean(obs) - mean(ensemble))

fidelity_test(
    obs = obs,
    ensemble = ensemble_biascor,
    units = 'C',
    biascor = FALSE
)
_images/Notebooks_3.Evaluate_3.Evaluate_37_0.png
[47]:
fidelity_test(obs = EOBS_UK_weighted_df_hindcast$rr, ensemble = SEAS5_UK_weighted_df$tprate)
_images/Notebooks_3.Evaluate_3.Evaluate_38_0.png

To include a mean-bias correction, set biascor = TRUE:

[46]:
fidelity_test(obs = EOBS_UK_weighted_df_hindcast$rr, ensemble = SEAS5_UK_weighted_df$tprate, biascor = TRUE)
_images/Notebooks_3.Evaluate_3.Evaluate_40_0.png
[16]:
?fidelity_test

Illustrate

Here we use extreme value theory (EVT) to fit extreme value distributions to the SEAS5 (UNSEEN) and ERA5 (observed) data.

To see example applications, have a look at the examples:

We define a function to plot the extreme value distributions:

[75]:
library(extRemes)
library(ggplot2)
library(ggpubr)

EVT_plot <- function(obs, ensemble, GEV_type, main, y_lab = "February average precipitation (mm/day)", ylim = NA) {
  ## We plot the GEV distribution for ERA5 and empirical data for SEAS5
  fit_obs <- fevd(
    x = obs, threshold = NULL, threshold.fun = ~1, location.fun = ~1,
    scale.fun = ~1, shape.fun = ~1, use.phi = FALSE,
    type = GEV_type, method = "MLE", initial = NULL, # type= c("GEV", "GP", "PP", "Gumbel", "Exponential"), method= c("MLE", "GMLE", "Bayesian", "Lmoments")
    span = NULL, units = NULL, time.units = "days", period.basis = "year", ## time and period only important for labelling and do not influence the calculation
    na.action = na.fail, optim.args = NULL, priorFun = NULL,
    priorParams = NULL, proposalFun = NULL, proposalParams = NULL,
    iter = 9999, weights = 1, blocks = NULL, verbose = FALSE
  )

  ## Now calculate the return levels and their confidence intervals for each return period within rperiods
  rperiods <- c(seq(from = 1.01, to = 1.5, by = 0.1), 1.7, 2, 3, 5, 10, 20, 50, 80, 100, 120, 200, 250, 300, 500, 800, 2000, 5000)
  rvs_obs <- ci.fevd(fit_obs, alpha = 0.05, type = "return.level", return.period = rperiods, method = "normal")
  colnames(rvs_obs) <- c("Obs_l", "Obs", "Obs_h") # Rename the col
  GEV_obs <- data.frame(cbind(rvs_obs, rperiods)) ## Make a datafram for ggplot

  ## Add the emipirical data
  rp_obs <- length(obs) / 1:length(obs) ## these are the (empirical) return periods for the sorted datapoints
  obs_sorted <- sort(obs, decreasing = T) ## For example, the highest extreme has a rp of 35 years, the second highest 17.5, third highest 11.7 etc.
  datapoints_obs <- data.frame(cbind(rp_obs, obs_sorted))


  rp_S5 <- length(ensemble) / 1:length(ensemble) # SEAS5 has return periods up to 3800 years
  ensemble_sorted <- sort(ensemble, decreasing = T)
  datapoints_S5 <- data.frame(cbind(rp_S5, ensemble_sorted))

  ## And plot
  cols <- c("UNSEEN" = "black", "OBS     " = "blue") ## for  the legend
  ggplot(data = datapoints_S5, aes(x = rp_S5)) +
    geom_point(aes(y = ensemble_sorted, col = "UNSEEN"), alpha = 0.5, size = 1) +
    geom_ribbon(data = GEV_obs, aes(ymin = Obs_l, ymax = Obs_h, x = rperiods, fill = "OBS     "), alpha = 0.1) +
    geom_point(data = datapoints_obs, aes(x = rp_obs, y = obs_sorted, col = "OBS     "), size = 1) +
    scale_x_continuous(trans = "log10") +
    scale_fill_manual(name = "Data", values = cols) +
    scale_colour_manual(name = NULL, values = cols) +
    theme_classic() +
    theme(
      legend.position = c(.95, .05),
      legend.justification = c("right", "bottom"),
      legend.box.just = "right",
      legend.title = element_blank(),
      text = element_text(size = 11),
      axis.text = element_text(size = 11)
    ) +
    labs(title = main, y = y_lab, x = "Return period (years)") +
    if (is.finite(ylim)) {
      coord_cartesian(ylim = c(NA, ylim))
    }
}

First, we fit a gumber and a GEV distribution (including shape parameter) to the observed extremes over Siberia. With a likelihood ratio test we show that the Gumbel distribution best describes the data.

[84]:
fit_obs_Gumbel <- fevd(x = ERA5_Siberia_events_zoomed_hindcast$t2m,
                    type = "Gumbel"
                   )
fit_obs_GEV <- fevd(x = ERA5_Siberia_events_zoomed_hindcast$t2m,
                    type = "GEV"
                   )
lr.test(fit_obs_Gumbel, fit_obs_GEV)

        Likelihood-ratio Test

data:  ERA5_Siberia_events_zoomed_hindcast$t2mERA5_Siberia_events_zoomed_hindcast$t2m
Likelihood-ratio = 0.21004, chi-square critical value = 3.8415, alpha =
0.0500, Degrees of Freedom = 1.0000, p-value = 0.6467
alternative hypothesis: greater

We show the gumbel plot for the observed (ERA5) and UNSEEN (SEAS5 hindcast data). This shows that the UNSEEN simulations are not within the uncertainty range of the observations. This has likely two reasons, illustrated in the evaluation section: there is some dependence between the events and there is too little variability within the UNSEEN ensemble.

[100]:
options(repr.plot.width = 12)
GEV_hindcast <- EVT_plot(ensemble = SEAS5_Siberia_events_zoomed_hindcast$t2m,
                         obs = ERA5_Siberia_events_zoomed_hindcast$t2m,
                         main = "Gumbel fit",
                         GEV_type = "Gumbel",
                         ylim = 3,
                         y_lab = 'MAM Siberian temperature (C)'
                        )
GEV_hindcast_corrected <- EVT_plot(ensemble = ensemble_biascor, #SEAS5_Siberia_events_zoomed_hindcast$t2m,
                                   obs = ERA5_Siberia_events_zoomed_hindcast$t2m,
                                   main = "Additive correction",
                                   GEV_type = "Gumbel",
                                   ylim = 3,
                                   y_lab = 'MAM Siberian temperature (C)'
                                  )

ggarrange(GEV_hindcast, GEV_hindcast_corrected,
  labels = c("a", "b"), # ,"c","d"),
  common.legend = T,
  font.label = list(size = 10, color = "black", face = "bold", family = NULL),
  ncol = 2, nrow = 1
)
# GEV_hindcast
# GEV_hindcast_corrected


_images/Notebooks_3.Evaluate_3.Evaluate_48_0.png

So what can we get out of it? What if we look at the operational forecast? Even if we cannot use the dataset as a whole to estimate the likelihood of occurrence, have events similar to the 2020 event occurred?

We select all archived SEAS5 (UNSEEN) events and all ERA5 (observed) events except for the 2020 event as reference.

[146]:
ERA5_Siberia_events_zoomed_min1 <- ERA5_Siberia_events_zoomed[1:length(ERA5_Siberia_events_zoomed$t2m)-1,]
ERA5_Siberia_events_zoomed_2020 <- ERA5_Siberia_events_zoomed[length(ERA5_Siberia_events_zoomed$t2m),]
# ERA5_Siberia_events_zoomed_min1
# ERA5_Siberia_events_zoomed_2020
[151]:
GEV_forecasts <- EVT_plot(ensemble = SEAS5_Siberia_events_zoomed_forecasts$t2m,
                          obs = ERA5_Siberia_events_zoomed$t2m,
                          main = "",
                          GEV_type = "Gumbel",
                          ylim = 3,
                          y_lab = 'MAM Siberian temperature (C)'
                         ) # %>%
GEV_forecasts + geom_hline(yintercept = ERA5_Siberia_events_zoomed_2020$t2m)#,
#     color = "black", linetype = "dashed", size = 1
_images/Notebooks_3.Evaluate_3.Evaluate_51_0.png

Plot the GEV distribution:

[63]:
GEV1 <- EVT_plot(ensemble = SEAS5_Siberia_events_zoomed_forecasts$t2m,
                 obs = ERA5_Siberia_events_zoomed$t2m,
                 main = "GEV",
                 GEV_type = "GEV",ylim = 3) # %>%
GEV1
_images/Notebooks_3.Evaluate_3.Evaluate_53_0.png
[57]:
Gumbel1 <- EVT_plot(ensemble = SEAS5_Siberia_events_zoomed_forecasts$t2m,
                    obs = ERA5_Siberia_events_zoomed_hindcast$t2m,
                    main = "Gumbel",
                    GEV_type = "Gumbel")

ggarrange(GEV1, Gumbel1,
  labels = c("a", "b"), # ,"c","d"),
  common.legend = T,
  font.label = list(size = 10, color = "black", face = "bold", family = NULL),
  ncol = 1, nrow = 2
) # %>%
# ggsave(filename = "graphs/Biascor.png",width =180,height = 180, units='mm',dpi=300)
_images/Notebooks_3.Evaluate_3.Evaluate_54_0.png

And for the UK:

[56]:
GEV1 <- EVT_plot(ensemble = SEAS5_UK_weighted_df$tprate, obs = EOBS_UK_weighted_df_hindcast$rr, main = "GEV", GEV_type = "GEV") # %>%
Gumbel1 <- EVT_plot(ensemble = SEAS5_UK_weighted_df$tprate, obs = EOBS_UK_weighted_df_hindcast$rr, main = "Gumbel", GEV_type = "Gumbel") # %>%

ggarrange(GEV1, Gumbel1,
  labels = c("a", "b"), # ,"c","d"),
  common.legend = T,
  font.label = list(size = 10, color = "black", face = "bold", family = NULL),
  ncol = 1, nrow = 2
) # %>%

_images/Notebooks_3.Evaluate_3.Evaluate_56_0.png

Global monthly temperature records in ERA5

Where have monthly average temperatures broken records across the world in 2020?

Global Temperature records 2020

In this first section, we load required packages and modules

[29]:
##This is so variables get printed within jupyter
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
[2]:
##import packages
import os
import xarray as xr
import numpy as np
import matplotlib.pyplot as plt
import cartopy
import cartopy.crs as ccrs
import matplotlib.ticker as mticker

#for rank calculation
import bottleneck
[3]:
## this is to load our own function to retrieve ERA5,
## which is located in ../src/CDSretrieve.py
import sys
sys.path.append('../')
[4]:
##And here we load the module
import src.CDSretrieve as retrieve
[5]:
##We want the working directory to be the UNSEEN-open directory
pwd = os.getcwd() ##current working directory is UNSEEN-open/Notebooks/1.Download
pwd #print the present working directory
os.chdir(pwd+'/../') # Change the working directory to UNSEEN-open
os.getcwd() #print the working directory
[5]:
'/lustre/soge1/projects/ls/personal/timo/UNSEEN-open/Notebooks'
[5]:
'/lustre/soge1/projects/ls/personal/timo/UNSEEN-open'

Download ERA5

This section describes the retrieval of ERA5. We retrieve netcdf files of global monthly 2m temperature and 2m dewpoint temperature for each year over 1979-2020.

[39]:
retrieve.retrieve_ERA5(variables = ['2m_temperature','2m_dewpoint_temperature'], folder = '../Siberia_example/')
;
[39]:
''

We load all files with xarray open_mfdataset. The latest 3 months in this dataset are made available through ERA5T, which might be slightly different to ERA5. In the downloaded file, an extra dimenions ‘expver’ indicates which data is ERA5 (expver = 1) and which is ERA5T (expver = 5). After retrieving and loading, I combine both ERA5 and ERA5T to create a dataset that runs until August 2020.

[10]:
ERA5 = xr.open_mfdataset('../Siberia_example/ERA5_????.nc',combine='by_coords') ## open the data
ERA5#
[10]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • expver: 2
    • latitude: 181
    • longitude: 360
    • time: 500
    • latitude
      (latitude)
      float32
      90.0 89.0 88.0 ... -89.0 -90.0
      units :
      degrees_north
      long_name :
      latitude
      array([ 90.,  89.,  88.,  87.,  86.,  85.,  84.,  83.,  82.,  81.,  80.,  79.,
              78.,  77.,  76.,  75.,  74.,  73.,  72.,  71.,  70.,  69.,  68.,  67.,
              66.,  65.,  64.,  63.,  62.,  61.,  60.,  59.,  58.,  57.,  56.,  55.,
              54.,  53.,  52.,  51.,  50.,  49.,  48.,  47.,  46.,  45.,  44.,  43.,
              42.,  41.,  40.,  39.,  38.,  37.,  36.,  35.,  34.,  33.,  32.,  31.,
              30.,  29.,  28.,  27.,  26.,  25.,  24.,  23.,  22.,  21.,  20.,  19.,
              18.,  17.,  16.,  15.,  14.,  13.,  12.,  11.,  10.,   9.,   8.,   7.,
               6.,   5.,   4.,   3.,   2.,   1.,   0.,  -1.,  -2.,  -3.,  -4.,  -5.,
              -6.,  -7.,  -8.,  -9., -10., -11., -12., -13., -14., -15., -16., -17.,
             -18., -19., -20., -21., -22., -23., -24., -25., -26., -27., -28., -29.,
             -30., -31., -32., -33., -34., -35., -36., -37., -38., -39., -40., -41.,
             -42., -43., -44., -45., -46., -47., -48., -49., -50., -51., -52., -53.,
             -54., -55., -56., -57., -58., -59., -60., -61., -62., -63., -64., -65.,
             -66., -67., -68., -69., -70., -71., -72., -73., -74., -75., -76., -77.,
             -78., -79., -80., -81., -82., -83., -84., -85., -86., -87., -88., -89.,
             -90.], dtype=float32)
    • longitude
      (longitude)
      float32
      -180.0 -179.0 ... 178.0 179.0
      units :
      degrees_east
      long_name :
      longitude
      array([-180., -179., -178., ...,  177.,  178.,  179.], dtype=float32)
    • expver
      (expver)
      int32
      1 5
      long_name :
      expver
      array([1, 5], dtype=int32)
    • time
      (time)
      datetime64[ns]
      1979-01-01 ... 2020-08-01
      long_name :
      time
      array(['1979-01-01T00:00:00.000000000', '1979-02-01T00:00:00.000000000',
             '1979-03-01T00:00:00.000000000', ..., '2020-06-01T00:00:00.000000000',
             '2020-07-01T00:00:00.000000000', '2020-08-01T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • t2m
      (time, latitude, longitude, expver)
      float32
      dask.array<chunksize=(12, 181, 360, 2), meta=np.ndarray>
      units :
      K
      long_name :
      2 metre temperature
      Array Chunk
      Bytes 260.64 MB 6.26 MB
      Shape (500, 181, 360, 2) (12, 181, 360, 2)
      Count 209 Tasks 42 Chunks
      Type float32 numpy.ndarray
      500 1 2 360 181
    • d2m
      (time, latitude, longitude, expver)
      float32
      dask.array<chunksize=(12, 181, 360, 2), meta=np.ndarray>
      units :
      K
      long_name :
      2 metre dewpoint temperature
      Array Chunk
      Bytes 260.64 MB 6.26 MB
      Shape (500, 181, 360, 2) (12, 181, 360, 2)
      Count 209 Tasks 42 Chunks
      Type float32 numpy.ndarray
      500 1 2 360 181
  • Conventions :
    CF-1.6
    history :
    2020-09-07 10:14:42 GMT by grib_to_netcdf-2.16.0: /opt/ecmwf/eccodes/bin/grib_to_netcdf -S param -o /cache/data3/adaptor.mars.internal-1599473651.1990857-24563-8-be8219b1-4396-4b61-90fe-4f688ea35d84.nc /cache/tmp/be8219b1-4396-4b61-90fe-4f688ea35d84-adaptor.mars.internal-1599473651.199597-24563-2-tmp.grib
[14]:
ERA5_combine =ERA5.sel(expver=1).combine_first(ERA5.sel(expver=5))
ERA5_combine.load()
[14]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 181
    • longitude: 360
    • time: 500
    • latitude
      (latitude)
      float32
      90.0 89.0 88.0 ... -89.0 -90.0
      units :
      degrees_north
      long_name :
      latitude
      array([ 90.,  89.,  88.,  87.,  86.,  85.,  84.,  83.,  82.,  81.,  80.,  79.,
              78.,  77.,  76.,  75.,  74.,  73.,  72.,  71.,  70.,  69.,  68.,  67.,
              66.,  65.,  64.,  63.,  62.,  61.,  60.,  59.,  58.,  57.,  56.,  55.,
              54.,  53.,  52.,  51.,  50.,  49.,  48.,  47.,  46.,  45.,  44.,  43.,
              42.,  41.,  40.,  39.,  38.,  37.,  36.,  35.,  34.,  33.,  32.,  31.,
              30.,  29.,  28.,  27.,  26.,  25.,  24.,  23.,  22.,  21.,  20.,  19.,
              18.,  17.,  16.,  15.,  14.,  13.,  12.,  11.,  10.,   9.,   8.,   7.,
               6.,   5.,   4.,   3.,   2.,   1.,   0.,  -1.,  -2.,  -3.,  -4.,  -5.,
              -6.,  -7.,  -8.,  -9., -10., -11., -12., -13., -14., -15., -16., -17.,
             -18., -19., -20., -21., -22., -23., -24., -25., -26., -27., -28., -29.,
             -30., -31., -32., -33., -34., -35., -36., -37., -38., -39., -40., -41.,
             -42., -43., -44., -45., -46., -47., -48., -49., -50., -51., -52., -53.,
             -54., -55., -56., -57., -58., -59., -60., -61., -62., -63., -64., -65.,
             -66., -67., -68., -69., -70., -71., -72., -73., -74., -75., -76., -77.,
             -78., -79., -80., -81., -82., -83., -84., -85., -86., -87., -88., -89.,
             -90.], dtype=float32)
    • longitude
      (longitude)
      float32
      -180.0 -179.0 ... 178.0 179.0
      units :
      degrees_east
      long_name :
      longitude
      array([-180., -179., -178., ...,  177.,  178.,  179.], dtype=float32)
    • time
      (time)
      datetime64[ns]
      1979-01-01 ... 2020-08-01
      long_name :
      time
      array(['1979-01-01T00:00:00.000000000', '1979-02-01T00:00:00.000000000',
             '1979-03-01T00:00:00.000000000', ..., '2020-06-01T00:00:00.000000000',
             '2020-07-01T00:00:00.000000000', '2020-08-01T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • t2m
      (time, latitude, longitude)
      float32
      244.7074 244.7074 ... 214.79857
      units :
      K
      long_name :
      2 metre temperature
      array([[[244.7074 , 244.7074 , 244.7074 , ..., 244.7074 , 244.7074 ,
               244.7074 ],
              [244.42686, 244.4086 , 244.39035, ..., 244.46837, 244.45508,
               244.44014],
              [244.88667, 244.88168, 244.87338, ..., 244.9431 , 244.9265 ,
               244.90659],
              ...,
              [242.26729, 242.337  , 242.40009, ..., 242.0764 , 242.12619,
               242.19757],
              [241.50372, 241.53027, 241.55518, ..., 241.41907, 241.44728,
               241.4755 ],
              [242.92795, 242.92795, 242.92795, ..., 242.92795, 242.92795,
               242.92795]],
      
             [[241.44562, 241.44562, 241.44562, ..., 241.44562, 241.44562,
               241.44562],
              [240.8331 , 240.81152, 240.78995, ..., 240.8663 , 240.85468,
               240.84473],
              [240.3484 , 240.33844, 240.32683, ..., 240.4231 , 240.39986,
               240.3733 ],
              ...,
              [235.54123, 235.63916, 235.73047, ..., 235.21754, 235.32378,
               235.435  ],
              [233.12436, 233.15092, 233.17914, ..., 232.97995, 233.02643,
               233.07457],
              [234.14522, 234.14522, 234.14522, ..., 234.14522, 234.14522,
               234.14522]],
      
             [[246.76073, 246.76073, 246.76073, ..., 246.76073, 246.76073,
               246.76073],
              [246.30093, 246.29596, 246.29263, ..., 246.29596, 246.29596,
               246.29927],
              [245.97392, 245.98056, 245.9872 , ..., 245.99384, 245.9872 ,
               245.98056],
              ...,
              [230.69754, 230.77556, 230.84859, ..., 230.49005, 230.54483,
               230.62119],
              [227.83083, 227.83913, 227.84743, ..., 227.77771, 227.79431,
               227.81256],
              [227.91382, 227.91382, 227.91382, ..., 227.91382, 227.91382,
               227.91382]],
      
             ...,
      
             [[273.7372 , 273.7372 , 273.7372 , ..., 273.7372 , 273.7372 ,
               273.7372 ],
              [273.6449 , 273.6449 , 273.64816, ..., 273.65787, 273.653  ,
               273.64978],
              [273.69995, 273.69833, 273.69672, ..., 273.68863, 273.68863,
               273.6951 ],
              ...,
              [227.0798 , 227.18506, 227.28543, ..., 226.75113, 226.83856,
               226.96161],
              [222.94612, 222.95422, 222.9607 , ..., 222.88783, 222.90726,
               222.9267 ],
              [223.5452 , 223.5452 , 223.5452 , ..., 223.5452 , 223.5452 ,
               223.5452 ]],
      
             [[274.1614 , 274.1614 , 274.1614 , ..., 274.1614 , 274.1614 ,
               274.1614 ],
              [274.12256, 274.12418, 274.1258 , ..., 274.13715, 274.13226,
               274.1258 ],
              [274.20676, 274.20514, 274.2019 , ..., 274.2019 , 274.19867,
               274.2019 ],
              ...,
              [222.21588, 222.3357 , 222.45065, ..., 221.86453, 221.95844,
               222.0896 ],
              [218.76709, 218.7687 , 218.7687 , ..., 218.64404, 218.68452,
               218.72662],
              [218.6489 , 218.6489 , 218.6489 , ..., 218.6489 , 218.6489 ,
               218.6489 ]],
      
             [[273.53482, 273.53482, 273.53482, ..., 273.53482, 273.53482,
               273.53482],
              [273.5267 , 273.52832, 273.52832, ..., 273.53644, 273.53156,
               273.52994],
              [273.57367, 273.57205, 273.56882, ..., 273.57367, 273.56882,
               273.57205],
              ...,
              [221.32373, 221.45003, 221.5747 , ..., 220.88657, 221.02419,
               221.17477],
              [215.54337, 215.53204, 215.5207 , ..., 215.51746, 215.52718,
               215.5369 ],
              [214.79857, 214.79857, 214.79857, ..., 214.79857, 214.79857,
               214.79857]]], dtype=float32)
    • d2m
      (time, latitude, longitude)
      float32
      241.76836 241.76836 ... 211.0198
      units :
      K
      long_name :
      2 metre dewpoint temperature
      array([[[241.76836, 241.76836, 241.76836, ..., 241.76836, 241.76836,
               241.76836],
              [241.52267, 241.50885, 241.49504, ..., 241.57181, 241.55339,
               241.53802],
              [242.01097, 242.0033 , 241.99255, ..., 242.07086, 242.04936,
               242.0294 ],
              ...,
              [238.93071, 238.99673, 239.06276, ..., 238.76488, 238.8094 ,
               238.8693 ],
              [238.2996 , 238.32265, 238.34721, ..., 238.22284, 238.24893,
               238.27504],
              [239.42055, 239.42055, 239.42055, ..., 239.42055, 239.42055,
               239.42055]],
      
             [[238.25815, 238.25815, 238.25815, ..., 238.25815, 238.25815,
               238.25815],
              [237.63933, 237.61937, 237.59941, ..., 237.68387, 237.6685 ,
               237.65161],
              [237.17253, 237.15257, 237.13107, ..., 237.26312, 237.23242,
               237.20325],
              ...,
              [232.30031, 232.4078 , 232.51529, ..., 232.0101 , 232.10684,
               232.20511],
              [229.7145 , 229.73752, 229.76208, ..., 229.5763 , 229.62082,
               229.66843],
              [230.39319, 230.39319, 230.39319, ..., 230.39319, 230.39319,
               230.39319]],
      
             [[243.83824, 243.83824, 243.83824, ..., 243.83824, 243.83824,
               243.83824],
              [243.37451, 243.36992, 243.36838, ..., 243.3822 , 243.38066,
               243.37605],
              [243.08891, 243.08891, 243.08737, ..., 243.12883, 243.11502,
               243.10274],
              ...,
              [226.94287, 227.02118, 227.09335, ..., 226.74171, 226.79391,
               226.8707 ],
              [224.07297, 224.08064, 224.08832, ..., 224.01923, 224.03766,
               224.05608],
              [224.08064, 224.08064, 224.08064, ..., 224.08064, 224.08064,
               224.08064]],
      
             ...,
      
             [[272.77475, 272.77475, 272.77475, ..., 272.77475, 272.77475,
               272.77475],
              [272.66974, 272.67123, 272.67123, ..., 272.6594 , 272.6609 ,
               272.6653 ],
              [272.76733, 272.76883, 272.7703 , ..., 272.74664, 272.75552,
               272.76144],
              ...,
              [223.10846, 223.21198, 223.31105, ..., 222.80237, 222.88666,
               222.99904],
              [219.37021, 219.37761, 219.38353, ..., 219.3081 , 219.32881,
               219.351  ],
              [219.93805, 219.93805, 219.93805, ..., 219.93805, 219.93805,
               219.93805]],
      
             [[273.8749 , 273.8749 , 273.8749 , ..., 273.8749 , 273.8749 ,
               273.8749 ],
              [273.85568, 273.85568, 273.85275, ..., 273.85864, 273.85718,
               273.85568],
              [273.89413, 273.89267, 273.8897 , ..., 273.89413, 273.89413,
               273.89413],
              ...,
              [218.273  , 218.3839 , 218.49185, ..., 217.9388 , 218.02753,
               218.15173],
              [215.0523 , 215.05379, 215.05823, ..., 214.92958, 214.97098,
               215.01091],
              [214.8586 , 214.8586 , 214.8586 , ..., 214.8586 , 214.8586 ,
               214.8586 ]],
      
             [[273.13556, 273.13556, 273.13556, ..., 273.13556, 273.13556,
               273.13556],
              [273.11188, 273.11188, 273.11188, ..., 273.11633, 273.11633,
               273.11484],
              [273.06015, 273.05423, 273.0483 , ..., 273.06754, 273.06604,
               273.0616 ],
              ...,
              [217.46117, 217.58687, 217.70663, ..., 217.04416, 217.17874,
               217.32364],
              [211.87007, 211.85973, 211.8479 , ..., 211.83458, 211.8464 ,
               211.85825],
              [211.0198 , 211.0198 , 211.0198 , ..., 211.0198 , 211.0198 ,
               211.0198 ]]], dtype=float32)
  • Conventions :
    CF-1.6
    history :
    2020-09-07 10:14:42 GMT by grib_to_netcdf-2.16.0: /opt/ecmwf/eccodes/bin/grib_to_netcdf -S param -o /cache/data3/adaptor.mars.internal-1599473651.1990857-24563-8-be8219b1-4396-4b61-90fe-4f688ea35d84.nc /cache/tmp/be8219b1-4396-4b61-90fe-4f688ea35d84-adaptor.mars.internal-1599473651.199597-24563-2-tmp.grib

Calculating the rank

We want to show for each month whether the recorded monthly average temperature for 2020 is the highest since 1979 (or second highest, etc.).

We first select only January months.

[15]:
ERA5_jan = ERA5_combine.sel(time=ERA5_combine['time.month'] == 1) ## Select only for the i month

Then we calculate the rank of January average temperatures over the years. We rename the variable ‘t2m’ into ‘Temperature rank’.

[16]:
ERA5_jan_rank = ERA5_jan['t2m'].rank(dim = 'time')
ERA5_jan_rank = ERA5_jan_rank.rename('Temperature rank')

We now have calculated the rank in increasing order, i.e. the highest values has the highest rank. However, we want to show the highest rank being number 1, the second highest being number 2. Therefore, we invert the ranks and then we select the inverted rank of January 2020 average temperature within the January average temperatures of the other years. If January 2020 average temperature would be highest on record, the inverted rank will be 1. Second highest will be 2.

[17]:
ERA5_jan_rank_inverted = (len(ERA5_jan_rank.time) - ERA5_jan_rank + 1).sel(time='2020')
ERA5_jan_rank_inverted
[17]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
'Temperature rank'
  • time: 1
  • latitude: 181
  • longitude: 360
  • 25.0 25.0 25.0 25.0 25.0 25.0 25.0 ... 24.0 24.0 24.0 24.0 24.0 24.0
    array([[[25., 25., 25., ..., 25., 25., 25.],
            [23., 23., 23., ..., 23., 23., 23.],
            [25., 25., 25., ..., 25., 25., 25.],
            ...,
            [23., 23., 23., ..., 23., 23., 23.],
            [24., 24., 24., ..., 24., 24., 24.],
            [24., 24., 24., ..., 24., 24., 24.]]])
    • latitude
      (latitude)
      float32
      90.0 89.0 88.0 ... -89.0 -90.0
      units :
      degrees_north
      long_name :
      latitude
      array([ 90.,  89.,  88.,  87.,  86.,  85.,  84.,  83.,  82.,  81.,  80.,  79.,
              78.,  77.,  76.,  75.,  74.,  73.,  72.,  71.,  70.,  69.,  68.,  67.,
              66.,  65.,  64.,  63.,  62.,  61.,  60.,  59.,  58.,  57.,  56.,  55.,
              54.,  53.,  52.,  51.,  50.,  49.,  48.,  47.,  46.,  45.,  44.,  43.,
              42.,  41.,  40.,  39.,  38.,  37.,  36.,  35.,  34.,  33.,  32.,  31.,
              30.,  29.,  28.,  27.,  26.,  25.,  24.,  23.,  22.,  21.,  20.,  19.,
              18.,  17.,  16.,  15.,  14.,  13.,  12.,  11.,  10.,   9.,   8.,   7.,
               6.,   5.,   4.,   3.,   2.,   1.,   0.,  -1.,  -2.,  -3.,  -4.,  -5.,
              -6.,  -7.,  -8.,  -9., -10., -11., -12., -13., -14., -15., -16., -17.,
             -18., -19., -20., -21., -22., -23., -24., -25., -26., -27., -28., -29.,
             -30., -31., -32., -33., -34., -35., -36., -37., -38., -39., -40., -41.,
             -42., -43., -44., -45., -46., -47., -48., -49., -50., -51., -52., -53.,
             -54., -55., -56., -57., -58., -59., -60., -61., -62., -63., -64., -65.,
             -66., -67., -68., -69., -70., -71., -72., -73., -74., -75., -76., -77.,
             -78., -79., -80., -81., -82., -83., -84., -85., -86., -87., -88., -89.,
             -90.], dtype=float32)
    • longitude
      (longitude)
      float32
      -180.0 -179.0 ... 178.0 179.0
      units :
      degrees_east
      long_name :
      longitude
      array([-180., -179., -178., ...,  177.,  178.,  179.], dtype=float32)
    • time
      (time)
      datetime64[ns]
      2020-01-01
      long_name :
      time
      array(['2020-01-01T00:00:00.000000000'], dtype='datetime64[ns]')

Plotting

We define a function to plot the data on a global map:

[18]:
def Global_plot(ERA5_i_rank_inverted):
    fig, ax = plt.subplots(figsize=(9, 4.5))
    ax = plt.axes(projection=ccrs.Robinson())
    ERA5_i_rank_inverted.plot(
        ax=ax,
        transform=ccrs.PlateCarree(),
        levels=[1, 2, 3, 4, 5],
        extend='both',
        colors=plt.cm.Reds_r)

    ax.add_feature(cartopy.feature.BORDERS, linestyle=':')
    ax.coastlines(
        resolution='110m')  #Currently can be one of “110m”, “50m”, and “10m”.
    gl = ax.gridlines(crs=ccrs.PlateCarree(),
                      draw_labels=True,
                      linewidth=1,
                      color='gray',
                      alpha=0.5,
                      linestyle='--')
#     gl.top_labels = False
#     gl.right_labels = False

And plot!

[19]:
Global_plot(ERA5_jan_rank_inverted)
_images/Notebooks_Global_monthly_temperature_records_ERA5_22_0.png

And zoom in for Siberia. We define a new plot:

[55]:
def Siberia_plot(ERA5_i_rank_inverted):
    fig, ax = plt.subplots(figsize=(9, 4.5))
    ax = plt.axes(projection=ccrs.PlateCarree(central_longitude=50.0))
    ERA5_i_rank_inverted.plot(
        ax=ax,
        transform=ccrs.PlateCarree(),
        levels=[1, 2, 3, 4, 5],
        extend='both',
        colors=plt.cm.Reds_r)

    ax.add_feature(cartopy.feature.BORDERS, linestyle=':')
    ax.coastlines(resolution='50m')
    gl = ax.gridlines(crs=ccrs.PlateCarree(),
                      draw_labels=True,
                      linewidth=1,
                      color='gray',
                      alpha=0.5,
                      linestyle='--')
    gl.top_labels = False
    gl.right_labels = False
[56]:
Siberia_plot(ERA5_jan_rank_inverted.sel(longitude = slice(-11,140), latitude = slice(80,40)))
_images/Notebooks_Global_monthly_temperature_records_ERA5_25_0.png

Loop over Jan-Aug

Create the gif

We use ImageMagick and run it from the command line. See this CMS notebook for more info on creating gifs.

[58]:
!convert -delay 60 ../Siberia_example/plots/Global*png graphs/Global_Animation_01.gif
[60]:
!convert -delay 60 ../Siberia_example/plots/Siberia*png graphs/Siberia_Animation_01.gif

And show the gif in jupyter notebook with

![Global Temperature records 2020](../graphs/Global_Animation_01.gif "Records2020")

Global Temperature records 2020

Same for the Siberian temperature records: ![Siberian Temperature records 2020](../graphs/Siberia_Animation_01.gif "Records2020")

Siberian Temperature records 2020

California august temperature anomaly

How anomalous was the August 2020 average temperature?

California Temperature August 2020

In this first section, we load required packages and modules

[1]:
##This is so variables get printed within jupyter
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
[2]:
##import packages
import os
import xarray as xr
import numpy as np
import matplotlib.pyplot as plt
import cartopy
import cartopy.crs as ccrs
import matplotlib.ticker as mticker

#for rank calculation
# import bottleneck
[3]:
os.chdir(os.path.abspath('../../'))

Load ERA5

We have retrieve netcdf files of global monthly 2m temperature and 2m dewpoint temperature for each year over 1979-2020.

We load all files with xarray open_mfdataset.

[4]:
ERA5 = xr.open_mfdataset('E:/PhD/California_example/ERA5/ERA5_????.nc',combine='by_coords') ## open the data
ERA5#
[4]:
<xarray.Dataset>
Dimensions:    (latitude: 51, longitude: 61, time: 42)
Coordinates:
  * longitude  (longitude) float32 -130.0 -129.0 -128.0 ... -72.0 -71.0 -70.0
  * latitude   (latitude) float32 70.0 69.0 68.0 67.0 ... 23.0 22.0 21.0 20.0
  * time       (time) datetime64[ns] 1979-08-01 1980-08-01 ... 2020-08-01
Data variables:
    t2m        (time, latitude, longitude) float32 dask.array<chunksize=(1, 51, 61), meta=np.ndarray>
    d2m        (time, latitude, longitude) float32 dask.array<chunksize=(1, 51, 61), meta=np.ndarray>
Attributes:
    Conventions:  CF-1.6
    history:      2020-10-01 23:23:34 GMT by grib_to_netcdf-2.16.0: /opt/ecmw...

Calculating the anomaly

We want to show how anomalous the recorded monthly average temperature for 2020 is compared to the 1979-2010 average.

[13]:
ERA5_anomaly = ERA5['t2m'] - ERA5['t2m'].sel(time=slice('1979','2010')).mean('time')
ERA5_anomaly.attrs = {
    'long_name': 'August temperature anomaly',
    'units': 'C'
}
ERA5_sd_anomaly = ERA5_anomaly / ERA5['t2m'].std('time')
ERA5_sd_anomaly.attrs = {
    'long_name': 'August temperature standardized anomaly',
    'units': '-'
}

Plotting

We define a function to plot the data on a global map:

[14]:
def plot_California(ERA5_input):

    extent = [-120, -80, 20, 50]
    central_lon = np.mean(extent[:2])
    central_lat = np.mean(extent[2:])

    plt.figure(figsize=(12, 6))
    ax = plt.axes(projection=ccrs.AlbersEqualArea(central_lon, central_lat))
    ax.set_extent(extent)

    ERA5_input.plot(
        ax=ax,
        transform=ccrs.PlateCarree(),
    #     levels=[1, 2, 3, 4, 5],
        extend='both')#,
    #     colors=plt.cm.Reds_r)

    ax.add_feature(cartopy.feature.BORDERS, linestyle=':')
    ax.coastlines(
        resolution='110m')  #Currently can be one of “110m”, “50m”, and “10m”.
    ax.set_title('')
    gl = ax.gridlines(crs=ccrs.PlateCarree(),
                      draw_labels=True,
                      linewidth=1,
                      color='gray',
                      alpha=0.5,
                      linestyle='--')
    gl.top_labels = False
    gl.right_labels = False

Temperature anomaly

[15]:
plot_California(ERA5_anomaly.sel(time = '2020'))
plt.savefig('graphs/California_anomaly.png')
_images/Notebooks_California_august_temperature_anomaly_13_0.png

Plot the standardized anomaly

[16]:
plot_California(ERA5_sd_anomaly.sel(time = '2020'))
plt.savefig('graphs/California_sd_anomaly.png')
_images/Notebooks_California_august_temperature_anomaly_15_0.png

Define mask as higher than 2 standard deviation anomaly

[17]:
ERA5_masked = (ERA5_sd_anomaly.
               sel(longitude = slice(-125,-100),
                  latitude = slice(45,20)).
               where(ERA5_sd_anomaly.sel(time = '2020').
                     squeeze('time')>2)
              )

# ERA5_masked
plot_California(ERA5_masked.sel(time = '2020'))
_images/Notebooks_California_august_temperature_anomaly_17_0.png
[21]:
ERA5_anomaly_timeseries = ERA5_anomaly.sel(longitude = slice(-119,-100)).where(ERA5_sd_anomaly.sel(time = '2020').squeeze('time')>2).mean(['longitude','latitude'])
ERA5_anomaly_timeseries.plot()
plt.ylabel('August temperature anomaly (C)')
plt.savefig('graphs/California_anomaly_timeseries.png')
[21]:
[<matplotlib.lines.Line2D at 0x241db54c790>]
[21]:
Text(0, 0.5, 'August temperature anomaly (C)')
_images/Notebooks_California_august_temperature_anomaly_18_2.png

February and April 2020 precipitation anomalies

In this notebook, we will analyze precipitation anomalies of February and April 2020, which seemed to be very contrasting in weather. We use the EOBS dataset.

Import packages

[1]:
##This is so variables get printed within jupyter
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
[2]:
##import packages
import os
import xarray as xr
import numpy as np
import matplotlib.pyplot as plt
import cartopy
import cartopy.crs as ccrs
import matplotlib.ticker as mticker

[3]:
##We want the working directory to be the UNSEEN-open directory
pwd = os.getcwd() ##current working directory is UNSEEN-open/Notebooks/1.Download
pwd #print the present working directory
os.chdir(pwd+'/../') # Change the working directory to UNSEEN-open
os.getcwd() #print the working directory
[3]:
'/lustre/soge1/projects/ls/personal/timo/UNSEEN-open/Notebooks/1.Download'
[3]:
'/lustre/soge1/projects/ls/personal/timo/UNSEEN-open'

Load EOBS

I downloaded EOBS (from 1950 - 2019) and the most recent EOBS data (2020) here. Note, you have to register as E-OBS user.

The data has a daily timestep. I resample the data into monthly average mm/day. I chose not to use the total monthly precipitation because of leap days.

[4]:
EOBS = xr.open_dataset('../UK_example/EOBS/rr_ens_mean_0.25deg_reg_v20.0e.nc') ## open the data
EOBS = EOBS.resample(time='1m').mean() ## Monthly averages
# EOBS = EOBS.sel(time=EOBS['time.month'] == 2) ## Select only February
EOBS
/soge-home/users/cenv0732/.conda/envs/UNSEEN-open/lib/python3.8/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis=axis, dtype=dtype)
[4]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 201
    • longitude: 464
    • time: 835
    • time
      (time)
      datetime64[ns]
      1950-01-31 ... 2019-07-31
      array(['1950-01-31T00:00:00.000000000', '1950-02-28T00:00:00.000000000',
             '1950-03-31T00:00:00.000000000', ..., '2019-05-31T00:00:00.000000000',
             '2019-06-30T00:00:00.000000000', '2019-07-31T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • latitude
      (latitude)
      float64
      25.38 25.62 25.88 ... 75.12 75.38
      units :
      degrees_north
      long_name :
      Latitude values
      axis :
      Y
      standard_name :
      latitude
      array([25.375, 25.625, 25.875, ..., 74.875, 75.125, 75.375])
    • longitude
      (longitude)
      float64
      -40.38 -40.12 ... 75.12 75.38
      units :
      degrees_east
      long_name :
      Longitude values
      axis :
      X
      standard_name :
      longitude
      array([-40.375, -40.125, -39.875, ...,  74.875,  75.125,  75.375])
    • rr
      (time, latitude, longitude)
      float32
      nan nan nan nan ... nan nan nan nan
      array([[[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             ...,
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]]], dtype=float32)

Here I define the attributes, that xarray uses when plotting

[5]:
EOBS['rr'].attrs = {'long_name': 'rainfall',  ##Define the name
 'units': 'mm/day', ## unit
 'standard_name': 'thickness_of_rainfall_amount'} ## original name, not used
EOBS['rr'].mean('time').plot() ## and show the 1950-2019 average February precipitation

[5]:
<matplotlib.collections.QuadMesh at 0x7f002a87ad90>
_images/Notebooks_2020_contrasting_weather_8_1.png

The 2020 data file is separate and needs the same preprocessing:

[6]:
EOBS2020 = xr.open_dataset('../UK_example/EOBS/rr_0.25deg_day_2020_grid_ensmean.nc.1') #open
EOBS2020 = EOBS2020.resample(time='1m').mean() #Monthly mean
EOBS2020['rr'].sel(time='2020-04').plot() #show map
EOBS2020 ## display dataset
/soge-home/users/cenv0732/.conda/envs/UNSEEN-open/lib/python3.8/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis=axis, dtype=dtype)
[6]:
<matplotlib.collections.QuadMesh at 0x7f002a76d8e0>
[6]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 201
    • longitude: 464
    • time: 12
    • time
      (time)
      datetime64[ns]
      2020-01-31 ... 2020-12-31
      array(['2020-01-31T00:00:00.000000000', '2020-02-29T00:00:00.000000000',
             '2020-03-31T00:00:00.000000000', '2020-04-30T00:00:00.000000000',
             '2020-05-31T00:00:00.000000000', '2020-06-30T00:00:00.000000000',
             '2020-07-31T00:00:00.000000000', '2020-08-31T00:00:00.000000000',
             '2020-09-30T00:00:00.000000000', '2020-10-31T00:00:00.000000000',
             '2020-11-30T00:00:00.000000000', '2020-12-31T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • latitude
      (latitude)
      float64
      25.38 25.62 25.88 ... 75.12 75.38
      standard_name :
      latitude
      long_name :
      Latitude values
      units :
      degrees_north
      axis :
      Y
      array([25.375, 25.625, 25.875, ..., 74.875, 75.125, 75.375])
    • longitude
      (longitude)
      float64
      -40.38 -40.12 ... 75.12 75.38
      standard_name :
      longitude
      long_name :
      Longitude values
      units :
      degrees_east
      axis :
      X
      array([-40.375, -40.125, -39.875, ...,  74.875,  75.125,  75.375])
    • rr
      (time, latitude, longitude)
      float32
      nan nan nan nan ... nan nan nan nan
      array([[[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             ...,
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]],
      
             [[nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              ...,
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan],
              [nan, nan, nan, ..., nan, nan, nan]]], dtype=float32)
_images/Notebooks_2020_contrasting_weather_10_3.png

Plot the 2020 event

I calculate the anomaly (deviation from the mean in mm/d) and divide this by the standard deviation to obtain the standardized anomalies.

[46]:
EOBS2020_anomaly = EOBS2020['rr'].groupby('time.month') - EOBS['rr'].groupby('time.month').mean('time')
EOBS2020_anomaly

EOBS2020_sd_anomaly = EOBS2020_anomaly.groupby('time.month') / EOBS['rr'].groupby('time.month').std('time')

EOBS2020_sd_anomaly.attrs = {
    'long_name': 'Monthly precipitation standardized anomaly',
    'units': '-'
}

EOBS2020_sd_anomaly
/soge-home/users/cenv0732/.conda/envs/UNSEEN-open/lib/python3.8/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis=axis, dtype=dtype)
[46]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
'rr'
  • time: 12
  • latitude: 201
  • longitude: 464
  • nan nan nan nan nan nan nan nan ... nan nan nan nan nan nan nan nan
    array([[[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           ...,
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]]], dtype=float32)
    • latitude
      (latitude)
      float64
      25.38 25.62 25.88 ... 75.12 75.38
      standard_name :
      latitude
      long_name :
      Latitude values
      units :
      degrees_north
      axis :
      Y
      array([25.375, 25.625, 25.875, ..., 74.875, 75.125, 75.375])
    • longitude
      (longitude)
      float64
      -40.38 -40.12 ... 75.12 75.38
      standard_name :
      longitude
      long_name :
      Longitude values
      units :
      degrees_east
      axis :
      X
      array([-40.375, -40.125, -39.875, ...,  74.875,  75.125,  75.375])
    • time
      (time)
      datetime64[ns]
      2020-01-31 ... 2020-12-31
      array(['2020-01-31T00:00:00.000000000', '2020-02-29T00:00:00.000000000',
             '2020-03-31T00:00:00.000000000', '2020-04-30T00:00:00.000000000',
             '2020-05-31T00:00:00.000000000', '2020-06-30T00:00:00.000000000',
             '2020-07-31T00:00:00.000000000', '2020-08-31T00:00:00.000000000',
             '2020-09-30T00:00:00.000000000', '2020-10-31T00:00:00.000000000',
             '2020-11-30T00:00:00.000000000', '2020-12-31T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • month
      (time)
      int64
      1 2 3 4 5 6 7 8 9 10 11 12
      array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12])
/soge-home/users/cenv0732/.conda/envs/UNSEEN-open/lib/python3.8/site-packages/numpy/lib/nanfunctions.py:1666: RuntimeWarning: Degrees of freedom <= 0 for slice.
  var = nanvar(a, axis=axis, dtype=dtype, out=out, ddof=ddof,
[46]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
'rr'
  • time: 12
  • latitude: 201
  • longitude: 464
  • nan nan nan nan nan nan nan nan ... nan nan nan nan nan nan nan nan
    array([[[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           ...,
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]]], dtype=float32)
    • latitude
      (latitude)
      float64
      25.38 25.62 25.88 ... 75.12 75.38
      standard_name :
      latitude
      long_name :
      Latitude values
      units :
      degrees_north
      axis :
      Y
      array([25.375, 25.625, 25.875, ..., 74.875, 75.125, 75.375])
    • longitude
      (longitude)
      float64
      -40.38 -40.12 ... 75.12 75.38
      standard_name :
      longitude
      long_name :
      Longitude values
      units :
      degrees_east
      axis :
      X
      array([-40.375, -40.125, -39.875, ...,  74.875,  75.125,  75.375])
    • time
      (time)
      datetime64[ns]
      2020-01-31 ... 2020-12-31
      array(['2020-01-31T00:00:00.000000000', '2020-02-29T00:00:00.000000000',
             '2020-03-31T00:00:00.000000000', '2020-04-30T00:00:00.000000000',
             '2020-05-31T00:00:00.000000000', '2020-06-30T00:00:00.000000000',
             '2020-07-31T00:00:00.000000000', '2020-08-31T00:00:00.000000000',
             '2020-09-30T00:00:00.000000000', '2020-10-31T00:00:00.000000000',
             '2020-11-30T00:00:00.000000000', '2020-12-31T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • month
      (time)
      int64
      1 2 3 4 5 6 7 8 9 10 11 12
      array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12])
  • long_name :
    Monthly precipitation standardized anomaly
    units :
    -

I select February and April (tips on how to select this are appreciated)

[38]:
EOBS2020_sd_anomaly
# EOBS2020_sd_anomaly.sel(time = ['2020-02','2020-04']) ## Dont know how to select this by label?
EOBS2020_sd_anomaly[[1,3],:,:] ## Dont know how to select this by label?

[38]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
'rr'
  • time: 12
  • latitude: 201
  • longitude: 464
  • nan nan nan nan nan nan nan nan ... nan nan nan nan nan nan nan nan
    array([[[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           ...,
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]]], dtype=float32)
    • latitude
      (latitude)
      float64
      25.38 25.62 25.88 ... 75.12 75.38
      standard_name :
      latitude
      long_name :
      Latitude values
      units :
      degrees_north
      axis :
      Y
      array([25.375, 25.625, 25.875, ..., 74.875, 75.125, 75.375])
    • longitude
      (longitude)
      float64
      -40.38 -40.12 ... 75.12 75.38
      standard_name :
      longitude
      long_name :
      Longitude values
      units :
      degrees_east
      axis :
      X
      array([-40.375, -40.125, -39.875, ...,  74.875,  75.125,  75.375])
    • time
      (time)
      datetime64[ns]
      2020-01-31 ... 2020-12-31
      array(['2020-01-31T00:00:00.000000000', '2020-02-29T00:00:00.000000000',
             '2020-03-31T00:00:00.000000000', '2020-04-30T00:00:00.000000000',
             '2020-05-31T00:00:00.000000000', '2020-06-30T00:00:00.000000000',
             '2020-07-31T00:00:00.000000000', '2020-08-31T00:00:00.000000000',
             '2020-09-30T00:00:00.000000000', '2020-10-31T00:00:00.000000000',
             '2020-11-30T00:00:00.000000000', '2020-12-31T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • month
      (time)
      int64
      1 2 3 4 5 6 7 8 9 10 11 12
      array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12])
  • long_name :
    Monthly precipitation standardized anomaly
    units :
    -
[38]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
'rr'
  • time: 2
  • latitude: 201
  • longitude: 464
  • nan nan nan nan nan nan nan nan ... nan nan nan nan nan nan nan nan
    array([[[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]],
    
           [[nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            ...,
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan],
            [nan, nan, nan, ..., nan, nan, nan]]], dtype=float32)
    • latitude
      (latitude)
      float64
      25.38 25.62 25.88 ... 75.12 75.38
      standard_name :
      latitude
      long_name :
      Latitude values
      units :
      degrees_north
      axis :
      Y
      array([25.375, 25.625, 25.875, ..., 74.875, 75.125, 75.375])
    • longitude
      (longitude)
      float64
      -40.38 -40.12 ... 75.12 75.38
      standard_name :
      longitude
      long_name :
      Longitude values
      units :
      degrees_east
      axis :
      X
      array([-40.375, -40.125, -39.875, ...,  74.875,  75.125,  75.375])
    • time
      (time)
      datetime64[ns]
      2020-02-29 2020-04-30
      array(['2020-02-29T00:00:00.000000000', '2020-04-30T00:00:00.000000000'],
            dtype='datetime64[ns]')
    • month
      (time)
      int64
      2 4
      array([2, 4])
  • long_name :
    Monthly precipitation standardized anomaly
    units :
    -

And plot using cartopy!

[58]:
EOBS_plots = EOBS2020_sd_anomaly[[1, 3], :, :].plot(
    transform=ccrs.PlateCarree(),
    robust=True,
    col='time',
    cmap=plt.cm.twilight_shifted_r,
    subplot_kws={'projection': ccrs.EuroPP()})

for ax in EOBS_plots.axes.flat:
    ax.add_feature(cartopy.feature.BORDERS, linestyle=':')
    ax.coastlines(resolution='50m')
    gl = ax.gridlines(crs=ccrs.PlateCarree(),
                      draw_labels=False,
                      linewidth=1,
                      color='gray',
                      alpha=0.5,
                      linestyle='--')

# plt.savefig('graphs/February_April_2020_precipAnomaly.png', dpi=300)
[58]:
<cartopy.mpl.feature_artist.FeatureArtist at 0x7efffc1af760>
[58]:
<cartopy.mpl.feature_artist.FeatureArtist at 0x7effcc6d4310>
[58]:
<cartopy.mpl.feature_artist.FeatureArtist at 0x7effb064a640>
[58]:
<cartopy.mpl.feature_artist.FeatureArtist at 0x7effb0603310>
_images/Notebooks_2020_contrasting_weather_16_4.png

Using EOBS + upscaling

Here we explore how to best extract areal averaged precipitation and test this for UK precipitation within SEAS5 and EOBS. The code is inspired on Matteo De Felice’s blog – credits to him!

We create a mask for all 241 countries within Regionmask, that has predefined countries from Natural Earth datasets (shapefiles). We use the mask to go from gridded precipitation to country-averaged timeseries. We regrid EOBS to the SEAS5 grid so we can select the same grid cells in calculating the UK average for both datasets. The country outline would not be perfect, but the masks would be the same so the comparison would be fair.

I use the xesmf package for upscaling, a good example can be found in this notebook.

Import packages

We need the packages regionmask for masking and xesmf for regridding. I cannot install xesmf into the UNSEEN-open environment without breaking my environment, so in this notebook I use a separate ‘upscale’ environment, as suggested by this issue. I use the packages esmpy=7.1.0 xesmf=0.2.1 regionmask cartopy matplotlib xarray numpy netcdf4.

[1]:
##This is so variables get printed within jupyter
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
[2]:
##import packages
import os
import xarray as xr
import numpy as np
import matplotlib.pyplot as plt
import cartopy
import cartopy.crs as ccrs
import matplotlib.ticker as mticker

import regionmask       # Masking
import xesmf as xe      # Regridding
[3]:
##We want the working directory to be the UNSEEN-open directory
pwd = os.getcwd() ##current working directory is UNSEEN-open/Notebooks/1.Download
pwd #print the present working directory
os.chdir(pwd+'/../../') # Change the working directory to UNSEEN-open
os.getcwd() #print the working directory
[3]:
'/lustre/soge1/projects/ls/personal/timo/UNSEEN-open/Notebooks/1.Download'
[3]:
'/lustre/soge1/projects/ls/personal/timo/UNSEEN-open'

Load SEAS5 and EOBS

From CDS, we retrieve SEAS5 and merge the retrieved files in preprocessing. We create a netcdf file containing the dimensions lat, lon, time (35 years), number (25 ensembles) and leadtime (5 initialization months).

[4]:
SEAS5 = xr.open_dataset('../UK_example/SEAS5/SEAS5.nc')
SEAS5
[4]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 11
    • leadtime: 5
    • longitude: 14
    • number: 25
    • time: 35
    • longitude
      (longitude)
      float32
      -11.0 -10.0 -9.0 ... 0.0 1.0 2.0
      units :
      degrees_east
      long_name :
      longitude
      array([-11., -10.,  -9.,  -8.,  -7.,  -6.,  -5.,  -4.,  -3.,  -2.,  -1.,   0.,
               1.,   2.], dtype=float32)
    • time
      (time)
      datetime64[ns]
      1982-02-01 ... 2016-02-01
      long_name :
      time
      array(['1982-02-01T00:00:00.000000000', '1983-02-01T00:00:00.000000000',
             '1984-02-01T00:00:00.000000000', '1985-02-01T00:00:00.000000000',
             '1986-02-01T00:00:00.000000000', '1987-02-01T00:00:00.000000000',
             '1988-02-01T00:00:00.000000000', '1989-02-01T00:00:00.000000000',
             '1990-02-01T00:00:00.000000000', '1991-02-01T00:00:00.000000000',
             '1992-02-01T00:00:00.000000000', '1993-02-01T00:00:00.000000000',
             '1994-02-01T00:00:00.000000000', '1995-02-01T00:00:00.000000000',
             '1996-02-01T00:00:00.000000000', '1997-02-01T00:00:00.000000000',
             '1998-02-01T00:00:00.000000000', '1999-02-01T00:00:00.000000000',
             '2000-02-01T00:00:00.000000000', '2001-02-01T00:00:00.000000000',
             '2002-02-01T00:00:00.000000000', '2003-02-01T00:00:00.000000000',
             '2004-02-01T00:00:00.000000000', '2005-02-01T00:00:00.000000000',
             '2006-02-01T00:00:00.000000000', '2007-02-01T00:00:00.000000000',
             '2008-02-01T00:00:00.000000000', '2009-02-01T00:00:00.000000000',
             '2010-02-01T00:00:00.000000000', '2011-02-01T00:00:00.000000000',
             '2012-02-01T00:00:00.000000000', '2013-02-01T00:00:00.000000000',
             '2014-02-01T00:00:00.000000000', '2015-02-01T00:00:00.000000000',
             '2016-02-01T00:00:00.000000000'], dtype='datetime64[ns]')
    • latitude
      (latitude)
      float32
      60.0 59.0 58.0 ... 52.0 51.0 50.0
      units :
      degrees_north
      long_name :
      latitude
      array([60., 59., 58., 57., 56., 55., 54., 53., 52., 51., 50.], dtype=float32)
    • number
      (number)
      int32
      0 1 2 3 4 5 6 ... 19 20 21 22 23 24
      long_name :
      ensemble_member
      array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,
             18, 19, 20, 21, 22, 23, 24], dtype=int32)
    • leadtime
      (leadtime)
      int64
      2 3 4 5 6
      array([2, 3, 4, 5, 6])
    • tprate
      (leadtime, time, number, latitude, longitude)
      float32
      ...
      long_name :
      rainfall
      units :
      mm/day
      standard_name :
      thickness_of_rainfall_amount
      [673750 values with dtype=float32]
  • Conventions :
    CF-1.6
    history :
    2020-05-13 14:49:43 GMT by grib_to_netcdf-2.16.0: /opt/ecmwf/eccodes/bin/grib_to_netcdf -S param -o /cache/data7/adaptor.mars.external-1589381366.1540039-11561-3-ad31a097-72e2-45ce-a565-55c62502f358.nc /cache/tmp/ad31a097-72e2-45ce-a565-55c62502f358-adaptor.mars.external-1589381366.1545565-11561-1-tmp.grib

And load EOBS netcdf with only February precipitation, resulting in 71 values, one for each year within 1950 - 2020 over the European domain (25N-75N x 40W-75E).

[5]:
EOBS = xr.open_dataset('../UK_example/EOBS/EOBS.nc')
EOBS
[5]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • latitude: 201
    • longitude: 464
    • time: 71
    • longitude
      (longitude)
      float64
      -40.38 -40.12 ... 75.12 75.38
      units :
      degrees_east
      long_name :
      Longitude values
      axis :
      X
      standard_name :
      longitude
      array([-40.375, -40.125, -39.875, ...,  74.875,  75.125,  75.375])
    • latitude
      (latitude)
      float64
      25.38 25.62 25.88 ... 75.12 75.38
      units :
      degrees_north
      long_name :
      Latitude values
      axis :
      Y
      standard_name :
      latitude
      array([25.375, 25.625, 25.875, ..., 74.875, 75.125, 75.375])
    • time
      (time)
      datetime64[ns]
      1950-02-28 ... 2020-02-29
      array(['1950-02-28T00:00:00.000000000', '1951-02-28T00:00:00.000000000',
             '1952-02-29T00:00:00.000000000', '1953-02-28T00:00:00.000000000',
             '1954-02-28T00:00:00.000000000', '1955-02-28T00:00:00.000000000',
             '1956-02-29T00:00:00.000000000', '1957-02-28T00:00:00.000000000',
             '1958-02-28T00:00:00.000000000', '1959-02-28T00:00:00.000000000',
             '1960-02-29T00:00:00.000000000', '1961-02-28T00:00:00.000000000',
             '1962-02-28T00:00:00.000000000', '1963-02-28T00:00:00.000000000',
             '1964-02-29T00:00:00.000000000', '1965-02-28T00:00:00.000000000',
             '1966-02-28T00:00:00.000000000', '1967-02-28T00:00:00.000000000',
             '1968-02-29T00:00:00.000000000', '1969-02-28T00:00:00.000000000',
             '1970-02-28T00:00:00.000000000', '1971-02-28T00:00:00.000000000',
             '1972-02-29T00:00:00.000000000', '1973-02-28T00:00:00.000000000',
             '1974-02-28T00:00:00.000000000', '1975-02-28T00:00:00.000000000',
             '1976-02-29T00:00:00.000000000', '1977-02-28T00:00:00.000000000',
             '1978-02-28T00:00:00.000000000', '1979-02-28T00:00:00.000000000',
             '1980-02-29T00:00:00.000000000', '1981-02-28T00:00:00.000000000',
             '1982-02-28T00:00:00.000000000', '1983-02-28T00:00:00.000000000',
             '1984-02-29T00:00:00.000000000', '1985-02-28T00:00:00.000000000',
             '1986-02-28T00:00:00.000000000', '1987-02-28T00:00:00.000000000',
             '1988-02-29T00:00:00.000000000', '1989-02-28T00:00:00.000000000',
             '1990-02-28T00:00:00.000000000', '1991-02-28T00:00:00.000000000',
             '1992-02-29T00:00:00.000000000', '1993-02-28T00:00:00.000000000',
             '1994-02-28T00:00:00.000000000', '1995-02-28T00:00:00.000000000',
             '1996-02-29T00:00:00.000000000', '1997-02-28T00:00:00.000000000',
             '1998-02-28T00:00:00.000000000', '1999-02-28T00:00:00.000000000',
             '2000-02-29T00:00:00.000000000', '2001-02-28T00:00:00.000000000',
             '2002-02-28T00:00:00.000000000', '2003-02-28T00:00:00.000000000',
             '2004-02-29T00:00:00.000000000', '2005-02-28T00:00:00.000000000',
             '2006-02-28T00:00:00.000000000', '2007-02-28T00:00:00.000000000',
             '2008-02-29T00:00:00.000000000', '2009-02-28T00:00:00.000000000',
             '2010-02-28T00:00:00.000000000', '2011-02-28T00:00:00.000000000',
             '2012-02-29T00:00:00.000000000', '2013-02-28T00:00:00.000000000',
             '2014-02-28T00:00:00.000000000', '2015-02-28T00:00:00.000000000',
             '2016-02-29T00:00:00.000000000', '2017-02-28T00:00:00.000000000',
             '2018-02-28T00:00:00.000000000', '2019-02-28T00:00:00.000000000',
             '2020-02-29T00:00:00.000000000'], dtype='datetime64[ns]')
    • rr
      (time, latitude, longitude)
      float32
      ...
      long_name :
      rainfall
      units :
      mm/day
      standard_name :
      thickness_of_rainfall_amount
      [6621744 values with dtype=float32]

Masking

Here we load the countries and create a mask for SEAS5 and for EOBS.

Regionmask has predefined countries from Natural Earth datasets (shapefiles).

[7]:
countries = regionmask.defined_regions.natural_earth.countries_50
countries
[7]:
241 'Natural Earth Countries: 50m' Regions (http://www.naturalearthdata.com)
ZW ZM YE VN VE V VU UZ UY FSM MH MP VI GU AS PR US GS IO SH PN AI FK KY BM VG TC MS JE GG IM GB AE UA UG TM TR TN TT TO TG TL TH TZ TJ TW SYR CH S SW SR SS SD LK E KR ZA SO SL SB SK SLO SG SL SC RS SN SA ST RSM WS VC LC KN RW RUS RO QA P PL PH PE PY PG PA PW PK OM N KP NG NE NI NZ NU CK NL AW CW NP NR NA MZ MA WS ME MN MD MC MX MU MR M ML MV MY MW MG MK L LT FL LY LR LS LB LV LA KG KW KO KI KE KZ J J J I IS PAL IRL IRQ IRN INDO IND IS HU HN HT GY GW GN GT GD GR GH D GE GM GA F PM WF MF BL PF NC TF AI FIN FJ ET EST ER GQ SV EG EC DO DM DJ GL FO DK CZ CN CY CU HR CI CR DRC CG KM CO CN MO HK CL TD CF CV CA CM KH MM BI BF BG BN BR BW BiH BO BT BJ BZ B BY BB BD BH BS AZ A AU IOT HM NF AU ARM AR AG AO AND DZ AL AF SG AQ SX

Now we create the mask for the SEAS5 grid. Only one timestep is needed to create the mask. This mask will lateron be used to mask all the timesteps.

[8]:
SEAS5_mask = countries.mask(SEAS5.sel(leadtime=2, number=0, time='1982'),
                            lon_name='longitude',
                            lat_name='latitude')

And create a plot to illustrate what the mask looks like. The mask just indicates for each gridcell what country the gridcell belongs to.

[9]:
SEAS5_mask
SEAS5_mask.plot()
[9]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
'region'
  • latitude: 11
  • longitude: 14
  • nan nan nan nan nan nan nan nan ... nan nan nan nan nan nan nan 160.0
    array([[ nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,
             nan,  nan,  nan],
           [ nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  31.,  nan,  nan,
             nan,  nan,  nan],
           [ nan,  nan,  nan,  nan,  31.,  nan,  31.,  31.,  nan,  nan,  nan,
             nan,  nan,  nan],
           [ nan,  nan,  nan,  nan,  nan,  nan,  31.,  31.,  31.,  nan,  nan,
             nan,  nan,  nan],
           [ nan,  nan,  nan,  nan,  nan,  nan,  nan,  31.,  nan,  nan,  nan,
             nan,  nan,  nan],
           [ nan,  nan,  nan, 140.,  31.,  31.,  31.,  31.,  31.,  31.,  nan,
             nan,  nan,  nan],
           [ nan, 140., 140., 140., 140.,  nan,  nan,  nan,  nan,  31.,  31.,
             nan,  nan,  nan],
           [ nan,  nan, 140., 140., 140.,  nan,  nan,  31.,  31.,  31.,  31.,
             31.,  nan,  nan],
           [ nan, 140., 140., 140.,  nan,  nan,  31.,  31.,  31.,  31.,  31.,
             31.,  31.,  nan],
           [ nan,  nan,  nan,  nan,  nan,  nan,  nan,  31.,  31.,  31.,  31.,
             31.,  31., 160.],
           [ nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,  nan,
             nan,  nan, 160.]])
    • latitude
      (latitude)
      float32
      60.0 59.0 58.0 ... 52.0 51.0 50.0
      array([60., 59., 58., 57., 56., 55., 54., 53., 52., 51., 50.], dtype=float32)
    • longitude
      (longitude)
      float32
      -11.0 -10.0 -9.0 ... 0.0 1.0 2.0
      array([-11., -10.,  -9.,  -8.,  -7.,  -6.,  -5.,  -4.,  -3.,  -2.,  -1.,   0.,
               1.,   2.], dtype=float32)
[9]:
<matplotlib.collections.QuadMesh at 0x7f877194e8d0>
_images/Notebooks_2.Preprocess_2.3Upscale_16_2.png

And now we can extract the UK averaged precipitation within SEAS5 by using the mask index of the UK: where(SEAS5_mask == UK_index). So we need to find the index of one of the 241 abbreviations. In this case for the UK use ‘GB’. Additionally, if you can’t find a country, use countries.regions to get the full names of the countries.

[10]:
countries.abbrevs.index('GB')
[10]:
31

To select the UK average, we select SEAS5 precipitation (tprate), select the gridcells that are within the UK and take the mean over those gridcells. This results in a dataset of February precipitation for 35 years (1981-2016), with 5 leadtimes and 25 ensemble members.

[11]:
SEAS5_UK = (SEAS5['tprate']
            .where(SEAS5_mask == 31)
            .mean(dim=['latitude', 'longitude']))
SEAS5_UK
[11]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
'tprate'
  • leadtime: 5
  • time: 35
  • number: 25
  • 1.7730116 1.9548205 3.7803986 ... 3.662669 1.6688719 1.9709551
    array([[[1.7730116 , 1.9548205 , 3.7803986 , ..., 2.9277864 ,
             1.8929143 , 2.446378  ],
            [3.040877  , 1.8855734 , 4.2009687 , ..., 2.8347836 ,
             4.1132317 , 2.4391398 ],
            [3.556001  , 3.6879914 , 3.184576  , ..., 5.116828  ,
             3.8872097 , 2.6074293 ],
            ...,
            [2.9086895 , 3.7759151 , 4.660708  , ..., 1.6525848 ,
             3.1059399 , 1.6731865 ],
            [2.8330274 , 3.6866314 , 2.634609  , ..., 3.3976977 ,
             4.993076  , 3.6399577 ],
            [2.2500532 , 2.510962  , 3.7602315 , ..., 3.8013346 ,
             1.2315732 , 3.6035924 ]],
    
           [[1.0868028 , 1.5332695 , 3.2461395 , ..., 1.5274822 ,
             2.7315547 , 1.0240313 ],
            [0.99898285, 2.9119303 , 2.1601522 , ..., 3.3752463 ,
             2.8715765 , 4.393921  ],
            [3.6581304 , 3.5088263 , 2.0143754 , ..., 3.9588785 ,
             3.795881  , 3.179954  ],
            ...,
            [2.5120296 , 3.568533  , 3.4690757 , ..., 2.6206532 ,
             3.953479  , 3.789593  ],
            [1.9866585 , 3.670435  , 2.7552466 , ..., 3.5482445 ,
             1.9896345 , 3.9373026 ],
            [1.9513754 , 2.0166924 , 2.9413762 , ..., 3.3549297 ,
             3.0631557 , 1.915903  ]],
    
           [[2.0119116 , 2.4435556 , 1.3927166 , ..., 1.8064059 ,
             1.8338976 , 2.4649143 ],
            [2.62523   , 3.6218376 , 3.003645  , ..., 3.3206403 ,
             2.5519    , 3.110555  ],
            [4.071685  , 2.6880858 , 3.8181992 , ..., 1.9033648 ,
             1.8840973 , 4.449085  ],
            ...,
            [2.8379328 , 2.6923704 , 1.82504   , ..., 2.8684394 ,
             3.1954165 , 3.445909  ],
            [2.072118  , 2.0628428 , 2.8790975 , ..., 2.697285  ,
             3.3291562 , 2.9145727 ],
            [3.535856  , 3.6515677 , 2.1052096 , ..., 3.2938933 ,
             3.1968002 , 2.2115657 ]],
    
           [[2.9105136 , 3.6938024 , 1.1343408 , ..., 1.1984391 ,
             2.9722617 , 2.1267796 ],
            [4.02007   , 1.8249133 , 3.099     , ..., 3.4654658 ,
             2.7237208 , 3.5907636 ],
            [3.1248841 , 2.219241  , 3.6903172 , ..., 0.8401702 ,
             4.017805  , 3.476175  ],
            ...,
            [2.8703861 , 5.5576715 , 1.7174771 , ..., 2.1288645 ,
             1.8581603 , 2.2952495 ],
            [4.179039  , 3.737323  , 2.880745  , ..., 1.9207952 ,
             0.6607291 , 2.8571692 ],
            [1.5515772 , 3.0461147 , 2.0624359 , ..., 2.5376263 ,
             4.744201  , 2.0716472 ]],
    
           [[3.1285267 , 3.269652  , 2.5995293 , ..., 4.347241  ,
             1.3022097 , 1.4634563 ],
            [2.262867  , 3.3503478 , 2.4287066 , ..., 2.593644  ,
             4.251352  , 3.1974325 ],
            [4.0569496 , 2.156282  , 1.781804  , ..., 4.4861846 ,
             1.8805121 , 4.268968  ],
            ...,
            [1.843329  , 3.1374288 , 2.516779  , ..., 1.3068637 ,
             2.4419744 , 2.2696178 ],
            [4.635685  , 4.429196  , 2.4575038 , ..., 4.441483  ,
             1.3038206 , 2.6521633 ],
            [3.1435733 , 2.614458  , 2.1784708 , ..., 3.662669  ,
             1.6688719 , 1.9709551 ]]], dtype=float32)
    • time
      (time)
      datetime64[ns]
      1982-02-01 ... 2016-02-01
      long_name :
      time
      array(['1982-02-01T00:00:00.000000000', '1983-02-01T00:00:00.000000000',
             '1984-02-01T00:00:00.000000000', '1985-02-01T00:00:00.000000000',
             '1986-02-01T00:00:00.000000000', '1987-02-01T00:00:00.000000000',
             '1988-02-01T00:00:00.000000000', '1989-02-01T00:00:00.000000000',
             '1990-02-01T00:00:00.000000000', '1991-02-01T00:00:00.000000000',
             '1992-02-01T00:00:00.000000000', '1993-02-01T00:00:00.000000000',
             '1994-02-01T00:00:00.000000000', '1995-02-01T00:00:00.000000000',
             '1996-02-01T00:00:00.000000000', '1997-02-01T00:00:00.000000000',
             '1998-02-01T00:00:00.000000000', '1999-02-01T00:00:00.000000000',
             '2000-02-01T00:00:00.000000000', '2001-02-01T00:00:00.000000000',
             '2002-02-01T00:00:00.000000000', '2003-02-01T00:00:00.000000000',
             '2004-02-01T00:00:00.000000000', '2005-02-01T00:00:00.000000000',
             '2006-02-01T00:00:00.000000000', '2007-02-01T00:00:00.000000000',
             '2008-02-01T00:00:00.000000000', '2009-02-01T00:00:00.000000000',
             '2010-02-01T00:00:00.000000000', '2011-02-01T00:00:00.000000000',
             '2012-02-01T00:00:00.000000000', '2013-02-01T00:00:00.000000000',
             '2014-02-01T00:00:00.000000000', '2015-02-01T00:00:00.000000000',
             '2016-02-01T00:00:00.000000000'], dtype='datetime64[ns]')
    • number
      (number)
      int32
      0 1 2 3 4 5 6 ... 19 20 21 22 23 24
      long_name :
      ensemble_member
      array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,
             18, 19, 20, 21, 22, 23, 24], dtype=int32)
    • leadtime
      (leadtime)
      int64
      2 3 4 5 6
      array([2, 3, 4, 5, 6])

However, xarray does not take into account the area of the gridcells in taking the average. Therefore, we have to calculate the area-weighted mean of the gridcells. To calculate the area of each gridcell, I use cdo cdo gridarea infile outfile. Here I load the generated file:

[12]:
Gridarea_SEAS5 = xr.open_dataset('../UK_example/Gridarea_SEAS5.nc')
Gridarea_SEAS5['cell_area'].plot()
[12]:
<matplotlib.collections.QuadMesh at 0x7f8771a14bd0>
_images/Notebooks_2.Preprocess_2.3Upscale_22_1.png
[13]:
SEAS5_UK_weighted = (SEAS5['tprate']
                  .where(SEAS5_mask == 31)
                  .weighted(Gridarea_SEAS5['cell_area'])
                  .mean(dim=['latitude', 'longitude'])
                 )
SEAS5_UK_weighted
[13]:
Show/Hide data repr Show/Hide attributes
xarray.DataArray
  • leadtime: 5
  • time: 35
  • number: 25
  • 1.747 1.916 3.742 2.909 4.562 3.113 ... 4.034 1.957 3.664 1.684 1.929
    array([[[1.74715784, 1.91625164, 3.74246331, ..., 2.9025497 ,
             1.87161458, 2.42337871],
            [3.01557164, 1.86355946, 4.23964218, ..., 2.82348107,
             4.08311346, 2.45320866],
            [3.45037457, 3.67373672, 3.19124952, ..., 5.10772697,
             3.83928173, 2.59254324],
            ...,
            [2.91576568, 3.76689869, 4.64815469, ..., 1.61583385,
             3.07634248, 1.633837  ],
            [2.8217756 , 3.61588493, 2.61442489, ..., 3.36894025,
             5.01010622, 3.58215465],
            [2.21954162, 2.46237273, 3.71758684, ..., 3.72850729,
             1.21044478, 3.5506569 ]],
    
           [[1.08925258, 1.502868  , 3.23383862, ..., 1.49745391,
             2.74434639, 0.98857514],
            [0.96385251, 2.9144073 , 2.14176199, ..., 3.39404417,
             2.837949  , 4.39105086],
            [3.64189637, 3.44186084, 1.96817031, ..., 3.90560029,
             3.78419096, 3.13070979],
            ...,
            [2.46681904, 3.55272741, 3.41184678, ..., 2.58295751,
             3.84194729, 3.71967185],
            [1.96088291, 3.64719353, 2.73561159, ..., 3.56311814,
             2.00379361, 3.89548019],
            [1.89263296, 1.99179138, 2.91457733, ..., 3.37011609,
             3.05092884, 1.89736692]],
    
           [[1.94362083, 2.4160058 , 1.36431312, ..., 1.78378666,
             1.82209387, 2.42526171],
            [2.57294707, 3.55756557, 2.96458594, ..., 3.26071746,
             2.60226357, 3.13573254],
            [4.13926899, 2.61380816, 3.76440713, ..., 1.87333769,
             1.82042494, 4.46818308],
            ...,
            [2.81221309, 2.69631474, 1.80062933, ..., 2.86429728,
             3.13303958, 3.44787769],
            [2.07369663, 2.03958281, 2.81885547, ..., 2.65322161,
             3.32297921, 2.83923239],
            [3.49884241, 3.63866711, 2.03510114, ..., 3.24500072,
             3.15147085, 2.16834782]],
    
           [[2.83876303, 3.61651907, 1.0950032 , ..., 1.17176117,
             2.91180608, 2.1047135 ],
            [3.95351432, 1.78778573, 3.08959013, ..., 3.43481603,
             2.72829325, 3.6158294 ],
            [3.13152664, 2.19419128, 3.64975772, ..., 0.83938823,
             4.01702257, 3.46619512],
            ...,
            [2.90135673, 5.59148292, 1.70016201, ..., 2.08532097,
             1.84797942, 2.23519466],
            [4.19777172, 3.74702108, 2.8748067 , ..., 1.88071816,
             0.62889528, 2.79973163],
            [1.51194718, 3.07317605, 2.05956574, ..., 2.53950207,
             4.70096128, 2.04542173]],
    
           [[3.15063505, 3.23490175, 2.60923731, ..., 4.27225421,
             1.29816875, 1.42799228],
            [2.21017692, 3.32458317, 2.3819878 , ..., 2.53619218,
             4.24655687, 3.21280586],
            [4.07655988, 2.07606666, 1.75961194, ..., 4.47653645,
             1.81676988, 4.21655002],
            ...,
            [1.82563235, 3.10218576, 2.46347745, ..., 1.28711195,
             2.36333743, 2.26540939],
            [4.63821163, 4.43540009, 2.37741808, ..., 4.44346938,
             1.27125796, 2.63467098],
            [3.12914205, 2.58186504, 2.11029128, ..., 3.6635387 ,
             1.68374372, 1.9288108 ]]])
    • time
      (time)
      datetime64[ns]
      1982-02-01 ... 2016-02-01
      long_name :
      time
      array(['1982-02-01T00:00:00.000000000', '1983-02-01T00:00:00.000000000',
             '1984-02-01T00:00:00.000000000', '1985-02-01T00:00:00.000000000',
             '1986-02-01T00:00:00.000000000', '1987-02-01T00:00:00.000000000',
             '1988-02-01T00:00:00.000000000', '1989-02-01T00:00:00.000000000',
             '1990-02-01T00:00:00.000000000', '1991-02-01T00:00:00.000000000',
             '1992-02-01T00:00:00.000000000', '1993-02-01T00:00:00.000000000',
             '1994-02-01T00:00:00.000000000', '1995-02-01T00:00:00.000000000',
             '1996-02-01T00:00:00.000000000', '1997-02-01T00:00:00.000000000',
             '1998-02-01T00:00:00.000000000', '1999-02-01T00:00:00.000000000',
             '2000-02-01T00:00:00.000000000', '2001-02-01T00:00:00.000000000',
             '2002-02-01T00:00:00.000000000', '2003-02-01T00:00:00.000000000',
             '2004-02-01T00:00:00.000000000', '2005-02-01T00:00:00.000000000',
             '2006-02-01T00:00:00.000000000', '2007-02-01T00:00:00.000000000',
             '2008-02-01T00:00:00.000000000', '2009-02-01T00:00:00.000000000',
             '2010-02-01T00:00:00.000000000', '2011-02-01T00:00:00.000000000',
             '2012-02-01T00:00:00.000000000', '2013-02-01T00:00:00.000000000',
             '2014-02-01T00:00:00.000000000', '2015-02-01T00:00:00.000000000',
             '2016-02-01T00:00:00.000000000'], dtype='datetime64[ns]')
    • number
      (number)
      int32
      0 1 2 3 4 5 6 ... 19 20 21 22 23 24
      long_name :
      ensemble_member
      array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,
             18, 19, 20, 21, 22, 23, 24], dtype=int32)
    • leadtime
      (leadtime)
      int64
      2 3 4 5 6
      array([2, 3, 4, 5, 6])

What is the difference between the weighted and non-weighted average?

I plot the UK average for ensemble member 0 and leadtime 2

[14]:
SEAS5_UK.sel(leadtime=2,number=0).plot()
SEAS5_UK_weighted.sel(leadtime=2,number=0).plot()

[14]:
[<matplotlib.lines.Line2D at 0x7f87718f8b50>]
[14]:
[<matplotlib.lines.Line2D at 0x7f87718e3ad0>]
_images/Notebooks_2.Preprocess_2.3Upscale_25_2.png

Upscale

For EOBS, we want to upscale the dataset to the SEAS5 grid. We use the function regridder(ds_in,ds_out,function), see the docs. We have to rename the lat lon dimensions so the function can read them.

We use bilinear interpolation first (i.e. function = ‘bilinear’), because of its ease in implementation. However, the use of conservative areal average (function = ‘conservative’) for upscaling is preferred (Kopparla, 2013).

[8]:
regridder = xe.Regridder(EOBS.rename({'longitude': 'lon', 'latitude': 'lat'}), SEAS5.rename({'longitude': 'lon', 'latitude': 'lat'}),'bilinear')
Overwrite existing file: bilinear_201x464_11x14.nc
 You can set reuse_weights=True to save computing time.

Now that we have the regridder, we can apply the regridder to our EOBS dataarray:

[27]:
EOBS_upscaled = regridder(EOBS)
EOBS_upscaled
using dimensions ('latitude', 'longitude') from data variable rr as the horizontal dimensions for this dataset.
[27]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • lat: 11
    • lon: 14
    • time: 71
    • time
      (time)
      datetime64[ns]
      1950-02-28 ... 2020-02-29
      array(['1950-02-28T00:00:00.000000000', '1951-02-28T00:00:00.000000000',
             '1952-02-29T00:00:00.000000000', '1953-02-28T00:00:00.000000000',
             '1954-02-28T00:00:00.000000000', '1955-02-28T00:00:00.000000000',
             '1956-02-29T00:00:00.000000000', '1957-02-28T00:00:00.000000000',
             '1958-02-28T00:00:00.000000000', '1959-02-28T00:00:00.000000000',
             '1960-02-29T00:00:00.000000000', '1961-02-28T00:00:00.000000000',
             '1962-02-28T00:00:00.000000000', '1963-02-28T00:00:00.000000000',
             '1964-02-29T00:00:00.000000000', '1965-02-28T00:00:00.000000000',
             '1966-02-28T00:00:00.000000000', '1967-02-28T00:00:00.000000000',
             '1968-02-29T00:00:00.000000000', '1969-02-28T00:00:00.000000000',
             '1970-02-28T00:00:00.000000000', '1971-02-28T00:00:00.000000000',
             '1972-02-29T00:00:00.000000000', '1973-02-28T00:00:00.000000000',
             '1974-02-28T00:00:00.000000000', '1975-02-28T00:00:00.000000000',
             '1976-02-29T00:00:00.000000000', '1977-02-28T00:00:00.000000000',
             '1978-02-28T00:00:00.000000000', '1979-02-28T00:00:00.000000000',
             '1980-02-29T00:00:00.000000000', '1981-02-28T00:00:00.000000000',
             '1982-02-28T00:00:00.000000000', '1983-02-28T00:00:00.000000000',
             '1984-02-29T00:00:00.000000000', '1985-02-28T00:00:00.000000000',
             '1986-02-28T00:00:00.000000000', '1987-02-28T00:00:00.000000000',
             '1988-02-29T00:00:00.000000000', '1989-02-28T00:00:00.000000000',
             '1990-02-28T00:00:00.000000000', '1991-02-28T00:00:00.000000000',
             '1992-02-29T00:00:00.000000000', '1993-02-28T00:00:00.000000000',
             '1994-02-28T00:00:00.000000000', '1995-02-28T00:00:00.000000000',
             '1996-02-29T00:00:00.000000000', '1997-02-28T00:00:00.000000000',
             '1998-02-28T00:00:00.000000000', '1999-02-28T00:00:00.000000000',
             '2000-02-29T00:00:00.000000000', '2001-02-28T00:00:00.000000000',
             '2002-02-28T00:00:00.000000000', '2003-02-28T00:00:00.000000000',
             '2004-02-29T00:00:00.000000000', '2005-02-28T00:00:00.000000000',
             '2006-02-28T00:00:00.000000000', '2007-02-28T00:00:00.000000000',
             '2008-02-29T00:00:00.000000000', '2009-02-28T00:00:00.000000000',
             '2010-02-28T00:00:00.000000000', '2011-02-28T00:00:00.000000000',
             '2012-02-29T00:00:00.000000000', '2013-02-28T00:00:00.000000000',
             '2014-02-28T00:00:00.000000000', '2015-02-28T00:00:00.000000000',
             '2016-02-29T00:00:00.000000000', '2017-02-28T00:00:00.000000000',
             '2018-02-28T00:00:00.000000000', '2019-02-28T00:00:00.000000000',
             '2020-02-29T00:00:00.000000000'], dtype='datetime64[ns]')
    • lon
      (lon)
      float32
      -11.0 -10.0 -9.0 ... 0.0 1.0 2.0
      array([-11., -10.,  -9.,  -8.,  -7.,  -6.,  -5.,  -4.,  -3.,  -2.,  -1.,   0.,
               1.,   2.], dtype=float32)
    • lat
      (lat)
      float32
      60.0 59.0 58.0 ... 52.0 51.0 50.0
      array([60., 59., 58., 57., 56., 55., 54., 53., 52., 51., 50.], dtype=float32)
    • rr
      (time, lat, lon)
      float64
      nan nan nan nan ... nan nan 4.243
      array([[[       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              ...,
              [       nan, 9.83356658, 8.21107723, ..., 3.16702519,
               2.5759045 ,        nan],
              [       nan,        nan,        nan, ..., 3.64821065,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan, 2.88222815]],
      
             [[       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              ...,
              [       nan, 6.84924265, 5.05712206, ..., 2.98497796,
               2.8831402 ,        nan],
              [       nan,        nan,        nan, ..., 4.582142  ,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan, 2.52327854]],
      
             [[       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              ...,
              [       nan, 1.43787911, 0.64045753, ..., 0.50001099,
               0.47414158,        nan],
              [       nan,        nan,        nan, ..., 0.91728464,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan, 1.65432386]],
      
             ...,
      
             [[       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              ...,
              [       nan, 6.07403735, 2.99021503, ..., 1.05803059,
               1.26427248,        nan],
              [       nan,        nan,        nan, ..., 1.05892861,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan, 1.13395446]],
      
             [[       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              ...,
              [       nan, 8.53733901, 4.27626159, ..., 1.10982856,
               0.72946197,        nan],
              [       nan,        nan,        nan, ..., 1.46519147,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan, 1.3330352 ]],
      
             [[       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan,        nan],
              ...,
              [       nan, 7.82318034, 7.0790547 , ..., 2.82500975,
               1.98278063,        nan],
              [       nan,        nan,        nan, ..., 3.50348602,
                      nan,        nan],
              [       nan,        nan,        nan, ...,        nan,
                      nan, 4.24307919]]])
  • regrid_method :
    bilinear

And set the latlon dimension names back to their long name. This is so both SEAS5 and EOBS have the same latlon dimension names which is necessary when using the same mask.

[28]:
EOBS_upscaled = EOBS_upscaled.rename({'lon' : 'longitude', 'lat' : 'latitude'})

Illustrate the SEAS5 and EOBS masks for the UK

Here I plot the masked mean SEAS5 and upscaled EOBS precipitation. This shows that upscaled EOBS does not contain data for all gridcells within the UK mask (the difference between SEAS5 gridcells and EOBS gridcells with data). We can apply an additional mask for SEAS5 that masks the grid cells that do not contain data in EOBS.

[30]:
fig, axs = plt.subplots(1, 2, subplot_kw={'projection': ccrs.OSGB()})

SEAS5['tprate'].where(SEAS5_mask == 31).mean(
    dim=['time', 'leadtime', 'number']).plot(
    transform=ccrs.PlateCarree(),
    vmin=0,
    vmax=8,
    cmap=plt.cm.Blues,
    ax=axs[0])

EOBS_upscaled['rr'].where(SEAS5_mask == 31).mean(dim='time').plot(
    transform=ccrs.PlateCarree(),
    vmin=0,
    vmax=8,
    cmap=plt.cm.Blues,
    ax=axs[1])

for ax in axs.flat:
    ax.coastlines(resolution='10m')

axs[0].set_title('SEAS5')
axs[1].set_title('EOBS')
/soge-home/users/cenv0732/.conda/envs/upscale/lib/python3.7/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis=axis, dtype=dtype)
[30]:
<matplotlib.collections.QuadMesh at 0x7fc1ea756c50>
/soge-home/users/cenv0732/.conda/envs/upscale/lib/python3.7/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis=axis, dtype=dtype)
[30]:
<matplotlib.collections.QuadMesh at 0x7fc1ea71e650>
[30]:
<cartopy.mpl.feature_artist.FeatureArtist at 0x7fc1ea6d8f10>
[30]:
<cartopy.mpl.feature_artist.FeatureArtist at 0x7fc1ea7b9590>
[30]:
Text(0.5, 1.0, 'SEAS5')
[30]:
Text(0.5, 1.0, 'EOBS')
_images/Notebooks_2.Preprocess_2.3Upscale_33_8.png

The additional mask of SEAS5 is where EOBS is not null:

[32]:
fig, axs = plt.subplots(1, 2, subplot_kw={'projection': ccrs.OSGB()})

(SEAS5['tprate']
 .where(SEAS5_mask == 31)
 .where(EOBS_upscaled['rr'].sel(time='1950').squeeze('time').notnull()) ## mask values that are nan in EOBS
 .mean(dim=['time', 'leadtime', 'number'])
 .plot(
    transform=ccrs.PlateCarree(),
    vmin=0,
    vmax=8,
    cmap=plt.cm.Blues,
    ax=axs[0])
)

EOBS_upscaled['rr'].where(SEAS5_mask == 31).mean(dim='time').plot(
    transform=ccrs.PlateCarree(),
    vmin=0,
    vmax=8,
    cmap=plt.cm.Blues,
    ax=axs[1])

for ax in axs.flat:
    ax.coastlines(resolution='10m')

axs[0].set_title('SEAS5')
axs[1].set_title('EOBS')
/soge-home/users/cenv0732/.conda/envs/upscale/lib/python3.7/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis=axis, dtype=dtype)
[32]:
<matplotlib.collections.QuadMesh at 0x7fc1ea579590>
/soge-home/users/cenv0732/.conda/envs/upscale/lib/python3.7/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice
  return np.nanmean(a, axis=axis, dtype=dtype)
[32]:
<matplotlib.collections.QuadMesh at 0x7fc1ea56f750>
[32]:
<cartopy.mpl.feature_artist.FeatureArtist at 0x7fc1ea4fe450>
[32]:
<cartopy.mpl.feature_artist.FeatureArtist at 0x7fc1ea56ffd0>
[32]:
Text(0.5, 1.0, 'SEAS5')
[32]:
Text(0.5, 1.0, 'EOBS')
_images/Notebooks_2.Preprocess_2.3Upscale_35_8.png

Extract the spatial average

To select the UK average, we select SEAS5 precipitation (tprate), select the gridcells that are within the UK and take the area-weighted mean over those gridcells. This results in a dataset of February precipitation for 35 years (1981-2016), with 5 leadtimes and 25 ensemble members.

[38]:
SEAS5_UK_weighted = (SEAS5
                  .where(SEAS5_mask == 31)
                  .where(EOBS_upscaled['rr'].sel(time='1950').squeeze('time').notnull())
                  .weighted(Gridarea_SEAS5['cell_area'])
                  .mean(dim=['latitude', 'longitude'])
                 )
SEAS5_UK_weighted
[38]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • leadtime: 5
    • number: 25
    • time: 35
    • time
      (time)
      datetime64[ns]
      1982-02-01 ... 2016-02-01
      long_name :
      time
      array(['1982-02-01T00:00:00.000000000', '1983-02-01T00:00:00.000000000',
             '1984-02-01T00:00:00.000000000', '1985-02-01T00:00:00.000000000',
             '1986-02-01T00:00:00.000000000', '1987-02-01T00:00:00.000000000',
             '1988-02-01T00:00:00.000000000', '1989-02-01T00:00:00.000000000',
             '1990-02-01T00:00:00.000000000', '1991-02-01T00:00:00.000000000',
             '1992-02-01T00:00:00.000000000', '1993-02-01T00:00:00.000000000',
             '1994-02-01T00:00:00.000000000', '1995-02-01T00:00:00.000000000',
             '1996-02-01T00:00:00.000000000', '1997-02-01T00:00:00.000000000',
             '1998-02-01T00:00:00.000000000', '1999-02-01T00:00:00.000000000',
             '2000-02-01T00:00:00.000000000', '2001-02-01T00:00:00.000000000',
             '2002-02-01T00:00:00.000000000', '2003-02-01T00:00:00.000000000',
             '2004-02-01T00:00:00.000000000', '2005-02-01T00:00:00.000000000',
             '2006-02-01T00:00:00.000000000', '2007-02-01T00:00:00.000000000',
             '2008-02-01T00:00:00.000000000', '2009-02-01T00:00:00.000000000',
             '2010-02-01T00:00:00.000000000', '2011-02-01T00:00:00.000000000',
             '2012-02-01T00:00:00.000000000', '2013-02-01T00:00:00.000000000',
             '2014-02-01T00:00:00.000000000', '2015-02-01T00:00:00.000000000',
             '2016-02-01T00:00:00.000000000'], dtype='datetime64[ns]')
    • number
      (number)
      int32
      0 1 2 3 4 5 6 ... 19 20 21 22 23 24
      long_name :
      ensemble_member
      array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,
             18, 19, 20, 21, 22, 23, 24], dtype=int32)
    • leadtime
      (leadtime)
      int64
      2 3 4 5 6
      array([2, 3, 4, 5, 6])
    • tprate
      (leadtime, time, number)
      float64
      1.62 1.803 3.715 ... 1.681 1.769
      array([[[1.61983929, 1.80270562, 3.71546987, ..., 2.88294029,
               1.739468  , 2.38352979],
              [2.92980026, 1.76955459, 4.32214303, ..., 2.82505383,
               4.08514105, 2.35270195],
              [3.27281587, 3.64590937, 3.30555726, ..., 5.14189287,
               3.80868977, 2.52809885],
              ...,
              [2.989394  , 3.77111344, 4.6468335 , ..., 1.54306509,
               2.88290349, 1.51127271],
              [2.77336544, 3.56587255, 2.67943505, ..., 3.31771558,
               5.10737252, 3.54107268],
              [2.1260184 , 2.32783242, 3.5086297 , ..., 3.58126581,
               1.10084914, 3.4377672 ]],
      
             [[1.09491934, 1.53100393, 3.26492016, ..., 1.38953026,
               2.79466853, 0.85712489],
              [0.82039565, 2.81008751, 2.15275396, ..., 3.3407505 ,
               2.78649799, 4.40346567],
              [3.66650518, 3.36296082, 1.86208923, ..., 3.88302357,
               3.73840395, 3.05970022],
              ...,
              [2.44442749, 3.57619699, 3.30370749, ..., 2.36393416,
               3.78797196, 3.61051521],
              [1.85189896, 3.64994576, 2.75797531, ..., 3.54899347,
               1.96163795, 3.92756756],
              [1.69035158, 1.90886006, 2.81342074, ..., 3.43975463,
               3.08070923, 1.71887629]],
      
             [[1.82732135, 2.35700255, 1.33907771, ..., 1.75420451,
               1.73882812, 2.28699077],
              [2.40939677, 3.5025749 , 2.91052599, ..., 3.20174607,
               2.67736291, 3.16030153],
              [4.27967074, 2.39810642, 3.68449437, ..., 1.75735736,
               1.74492558, 4.47295371],
              ...,
              [2.73664435, 2.66972478, 1.7240791 , ..., 2.90310921,
               3.05444721, 3.45214616],
              [2.05969104, 1.85866855, 2.63843   , ..., 2.55877674,
               3.28343286, 2.6359866 ],
              [3.36070822, 3.69223251, 1.79020433, ..., 3.07561624,
               3.00743179, 2.03883137]],
      
             [[2.77891452, 3.58542727, 1.01360512, ..., 1.12565481,
               2.77999248, 1.98110613],
              [3.83915299, 1.66513433, 3.15175385, ..., 3.43047301,
               2.81870343, 3.69259162],
              [3.09151276, 2.05154796, 3.72162802, ..., 0.82186029,
               3.91416119, 3.56813021],
              ...,
              [2.96839925, 5.80239685, 1.63705973, ..., 1.95204278,
               1.81608721, 2.1571341 ],
              [4.20770424, 3.65632397, 2.84265034, ..., 1.68172334,
               0.55870573, 2.63901647],
              [1.29483006, 3.08373202, 2.0073062 , ..., 2.43205439,
               4.68513471, 1.89181443]],
      
             [[3.10352949, 3.18728323, 2.56303604, ..., 4.17817963,
               1.23774859, 1.28303082],
              [1.98921652, 3.28544606, 2.2746998 , ..., 2.39227487,
               4.26844875, 3.25052759],
              [4.10408859, 1.99422737, 1.67128341, ..., 4.60826197,
               1.73396222, 4.24098449],
              ...,
              [1.74079919, 3.03078117, 2.43933043, ..., 1.16495896,
               2.24788933, 2.25296764],
              [4.72132559, 4.58284629, 2.2242827 , ..., 4.47087103,
               1.12834648, 2.50279851],
              [3.01664848, 2.44682909, 2.00389092, ..., 3.64223307,
               1.68083814, 1.76908221]]])
[40]:
EOBS_UK_weighted = (EOBS_upscaled
                  .where(SEAS5_mask == 31) ## EOBS is now on the SEAS5 grid, so use the SEAS5 mask and gridcell area
                  .weighted(Gridarea_SEAS5['cell_area'])
                  .mean(dim=['latitude', 'longitude'])
                 )
EOBS_UK_weighted
EOBS_UK_weighted['rr'].plot()
[40]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • time: 71
    • time
      (time)
      datetime64[ns]
      1950-02-28 ... 2020-02-29
      array(['1950-02-28T00:00:00.000000000', '1951-02-28T00:00:00.000000000',
             '1952-02-29T00:00:00.000000000', '1953-02-28T00:00:00.000000000',
             '1954-02-28T00:00:00.000000000', '1955-02-28T00:00:00.000000000',
             '1956-02-29T00:00:00.000000000', '1957-02-28T00:00:00.000000000',
             '1958-02-28T00:00:00.000000000', '1959-02-28T00:00:00.000000000',
             '1960-02-29T00:00:00.000000000', '1961-02-28T00:00:00.000000000',
             '1962-02-28T00:00:00.000000000', '1963-02-28T00:00:00.000000000',
             '1964-02-29T00:00:00.000000000', '1965-02-28T00:00:00.000000000',
             '1966-02-28T00:00:00.000000000', '1967-02-28T00:00:00.000000000',
             '1968-02-29T00:00:00.000000000', '1969-02-28T00:00:00.000000000',
             '1970-02-28T00:00:00.000000000', '1971-02-28T00:00:00.000000000',
             '1972-02-29T00:00:00.000000000', '1973-02-28T00:00:00.000000000',
             '1974-02-28T00:00:00.000000000', '1975-02-28T00:00:00.000000000',
             '1976-02-29T00:00:00.000000000', '1977-02-28T00:00:00.000000000',
             '1978-02-28T00:00:00.000000000', '1979-02-28T00:00:00.000000000',
             '1980-02-29T00:00:00.000000000', '1981-02-28T00:00:00.000000000',
             '1982-02-28T00:00:00.000000000', '1983-02-28T00:00:00.000000000',
             '1984-02-29T00:00:00.000000000', '1985-02-28T00:00:00.000000000',
             '1986-02-28T00:00:00.000000000', '1987-02-28T00:00:00.000000000',
             '1988-02-29T00:00:00.000000000', '1989-02-28T00:00:00.000000000',
             '1990-02-28T00:00:00.000000000', '1991-02-28T00:00:00.000000000',
             '1992-02-29T00:00:00.000000000', '1993-02-28T00:00:00.000000000',
             '1994-02-28T00:00:00.000000000', '1995-02-28T00:00:00.000000000',
             '1996-02-29T00:00:00.000000000', '1997-02-28T00:00:00.000000000',
             '1998-02-28T00:00:00.000000000', '1999-02-28T00:00:00.000000000',
             '2000-02-29T00:00:00.000000000', '2001-02-28T00:00:00.000000000',
             '2002-02-28T00:00:00.000000000', '2003-02-28T00:00:00.000000000',
             '2004-02-29T00:00:00.000000000', '2005-02-28T00:00:00.000000000',
             '2006-02-28T00:00:00.000000000', '2007-02-28T00:00:00.000000000',
             '2008-02-29T00:00:00.000000000', '2009-02-28T00:00:00.000000000',
             '2010-02-28T00:00:00.000000000', '2011-02-28T00:00:00.000000000',
             '2012-02-29T00:00:00.000000000', '2013-02-28T00:00:00.000000000',
             '2014-02-28T00:00:00.000000000', '2015-02-28T00:00:00.000000000',
             '2016-02-29T00:00:00.000000000', '2017-02-28T00:00:00.000000000',
             '2018-02-28T00:00:00.000000000', '2019-02-28T00:00:00.000000000',
             '2020-02-29T00:00:00.000000000'], dtype='datetime64[ns]')
    • rr
      (time)
      float64
      4.127 3.251 1.072 ... 1.782 4.92
      array([4.12725776, 3.25073545, 1.07154934, 1.59250362, 2.59011679,
             2.19460832, 0.86553777, 2.71508494, 3.63875078, 0.43748921,
             2.44475198, 2.85323568, 1.90375894, 0.93073633, 0.96014483,
             0.54936363, 3.93806659, 3.41126225, 1.52403826, 2.14680588,
             3.24367008, 1.61173947, 2.49205547, 1.86097057, 3.44753495,
             1.09562791, 1.72599619, 4.25387794, 2.67016706, 1.75307168,
             2.88443313, 2.00213592, 2.06658247, 1.35684105, 2.11976754,
             1.09154394, 0.42823908, 1.98726177, 2.62084822, 3.95611062,
             6.18364117, 2.09273353, 2.32127359, 0.71821086, 2.72255429,
             4.36020144, 2.92272651, 5.12799133, 1.95292637, 2.49697346,
             4.02321657, 3.13585905, 5.53924289, 1.39434155, 1.90494815,
             1.91951746, 1.85577634, 3.60145376, 2.21509453, 1.73046396,
             2.21306353, 3.38992427, 1.39408258, 1.73443926, 5.42245947,
             2.37410915, 3.24500002, 2.77368044, 1.49827506, 1.78169717,
             4.91976886])
[40]:
[<matplotlib.lines.Line2D at 0x7fc1ea2f4850>]
_images/Notebooks_2.Preprocess_2.3Upscale_39_2.png

Illustrate the SEAS5 and EOBS UK average

And the area-weighted average UK precipitation for SEAS5 and EOBS I plot here. For SEAS5 I plot the range, both min/max and the 2.5/97.5 % percentile of all ensemble members and leadtimes for each year.

[43]:
ax = plt.axes()

Quantiles = (SEAS5_UK_weighted['tprate']
             .quantile([0,2.5/100, 0.5, 97.5/100,1],
                       dim=['number','leadtime']
                      )
            )
ax.plot(Quantiles.time, Quantiles.sel(quantile=0.5),
        color='orange',
        label = 'SEAS5 median')
ax.fill_between(Quantiles.time.values, Quantiles.sel(quantile=0.025), Quantiles.sel(quantile=0.975),
                color='orange',
                alpha=0.2,
                label = '95% / min max')
ax.fill_between(Quantiles.time.values, Quantiles.sel(quantile=0), Quantiles.sel(quantile=1),
                color='orange',
                alpha=0.2)

EOBS_UK_weighted['rr'].plot(ax=ax,
                            x='time',
                            label = 'E-OBS')
plt.legend(loc = 'lower left',
           ncol=2 ) #loc = (0.1, 0) upper left
[43]:
[<matplotlib.lines.Line2D at 0x7fc1ea2cef10>]
[43]:
<matplotlib.collections.PolyCollection at 0x7fc1ea39f250>
[43]:
<matplotlib.collections.PolyCollection at 0x7fc1ea77fed0>
[43]:
[<matplotlib.lines.Line2D at 0x7fc1ea449310>]
[43]:
<matplotlib.legend.Legend at 0x7fc1ea56fc90>
_images/Notebooks_2.Preprocess_2.3Upscale_41_5.png

And save the UK weighted average datasets

[45]:
SEAS5_UK_weighted.to_netcdf('Data/SEAS5_UK_weighted_masked.nc')
SEAS5_UK_weighted.to_dataframe().to_csv('Data/SEAS5_UK_weighted_masked.csv')
EOBS_UK_weighted.to_netcdf('Data/EOBS_UK_weighted_upscaled.nc') ## save as netcdf
EOBS_UK_weighted.to_dataframe().to_csv('Data/EOBS_UK_weighted_upscaled.csv') ## and save as csv.
[46]:
SEAS5_UK_weighted.close()
EOBS_UK_weighted.close()

Other methods

There are many different sources and methods available for extracting areal-averages from shapefiles. Here I have used shapely / masking in xarray. Something that lacks with this method is the weighted extraction from a shapefile, that is more precise on the boundaries. In R, raster:extract can use the percentage of the area that falls within the country for each grid cell to use as weight in averaging. For more information on this method, see the EGU 2018 course. For SEAS5, with its coarse resolution, this might make a difference. However, for it’s speed and reproducibility, we have chosen to stick to xarray.

We have used xarray where you can apply weights yourself to a dataset and then calculate the weighted mean. Sources I have used: * xarray weighted reductions * Matteo’s blog * regionmask package * Arctic weighted average example * area weighted temperature example.

And this pretty awesome colab notebook on seasonal forecasting regrids seasonal forecasts and reanalysis on the same grid before calculating skill scores.

License

All code and example data are available under the open source MIT License.

Citation

When using the code or example data, please cite this project. If any questions may arise, please don’t hesitate to get in touch t.kelder@lboro.ac.uk.