the anomaly is calculated by subtracting the average of the whole 20 years of the baseline period. This results in a plot with a strong seasonal cycle. What we really want is the anomaly of the monthly mean from the 20 year period.
So after the line
iris.save(future_land, futureout)
we want to calculate the mean of each Jan, Feb etc for the baseline:
this gives us a cube with just 12 points in it – one for every month. We need some data with 240 points though as the future data has 20 years of data. Add the line of code below to repeat the 12 months 20 times.
In section 4.4 "Future time series"
the anomaly is calculated by subtracting the average of the whole 20 years of the baseline period. This results in a plot with a strong seasonal cycle. What we really want is the anomaly of the monthly mean from the 20 year period.
So after the line
iris.save(future_land, futureout)
we want to calculate the mean of each Jan, Feb etc for the baseline:
iris.coord_categorisation.add_month_number(baseline_land, 'time', name='month_number')
baseline_monthly_mean = baseline_land.aggregated_by(['month_number'], iris.analysis.MEAN)
as done in previous worksheet
this gives us a cube with just 12 points in it – one for every month. We need some data with 240 points though as the future data has 20 years of data. Add the line of code below to repeat the 12 months 20 times.
baseline_mm = np.tile(baseline_monthly_mean.data,20)
then change this line:
baseline_land.data.mean()
to:diff.data = future_land.data - baseline_mm
this also needs to be corrected in the solution for section h) Produce and plot a montly time series of temperature data