Smooth Mean Daily Annual Cycle

Smooth Mean Daily Annual Cycle#

Calculates a smooth mean daily annual cycle.

Before proceeding with all the steps, first import some necessary libraries and packages

import xarray as xr
import easyclimate as ecl
import matplotlib.pyplot as plt

Preprocessed data

lats, latn = -20, 20

olr_data = xr.open_dataset('olr-daily_v01r02_19800101_20231231.nc', chunks='auto').sel(lat=slice(lats,latn)).olr
olr_data_daily_annual_cycle_mean = ecl.calc_daily_annual_cycle_mean(olr_data).thin(lat = 2, lon = 5).compute()

olr_data_daily_annual_cycle_mean = ecl.utility.get_compress_xarraydata(olr_data_daily_annual_cycle_mean)
olr_data_daily_annual_cycle_mean.to_netcdf("olr_daily_annual_cycle_mean.nc")

Here, we directly load the data of mean daily annual cycle for outgoing longwave radiation (OLR).

<xarray.DataArray 'olr' (dayofyear: 366, lat: 20, lon: 72)> Size: 2MB
[527040 values with dtype=float32]
Coordinates:
  * lon        (lon) float32 288B 0.5 5.5 10.5 15.5 ... 340.5 345.5 350.5 355.5
  * lat        (lat) float32 80B -19.5 -17.5 -15.5 -13.5 ... 12.5 14.5 16.5 18.5
  * dayofyear  (dayofyear) int64 3kB 1 2 3 4 5 6 7 ... 361 362 363 364 365 366
Attributes:
    standard_name:  toa_outgoing_longwave_flux
    long_name:      NOAA Climate Data Record of Daily Mean Upward Longwave Fl...
    units:          W m-2
    cell_methods:   time: mean area: mean


Simply do a regional average for the tropics

plot smooth daily cycle
[<matplotlib.lines.Line2D object at 0x7fd6464a22c0>]

By removing excess noise in the mean daily annual cycle through the way of easyclimate.smooth_daily_annual_cycle, we can plot the following:

olr_data_ave_smoothed = ecl.smooth_daily_annual_cycle(olr_data_daily_annual_cycle_mean).mean(dim = ("lon", "lat"))

olr_data_ave.plot(label = "Daily annual cycle mean")
olr_data_ave_smoothed.plot(label = "Smoothed daily annual cycle mean")
plt.legend()
plot smooth daily cycle
<matplotlib.legend.Legend object at 0x7fd6462f1390>

Total running time of the script: (0 minutes 4.114 seconds)