Skip to content
Snippets Groups Projects
Commit ea7a633f authored by Aiko Voigt's avatar Aiko Voigt
Browse files

Adds plot of time-mean zonal-mean climatology of CRH

parent dcfe1245
Branches
No related tags found
No related merge requests found
%% Cell type:markdown id:eb6a3095-fd76-401c-92f2-ed5c3473ccea tags:
# Plot zonal-mean time-mean cloud-radiative heating
%% Cell type:code id:9ead3a66-83ff-44bb-a8e0-4ae0de8d489d tags:
``` python
import xarray as xr
import matplotlib.pyplot as plt
import numpy as np
import warnings
warnings.filterwarnings("ignore")
```
%% Cell type:code id:bc390f59-7338-4e56-8982-baa95ad74a16 tags:
``` python
ds=xr.open_dataset("/jetfs/scratch/avoigt/CLOUDSAT/2B-FLXHR-LIDAR.P2_R05.heatingrates_binned.2006-2017.nc")
```
%% Cell type:markdown id:4e65bec4-04a2-4087-b088-5f839107ffd6 tags:
Group by years. Average over years 2007-2016 as well as longitude. Do not use years 2006 and 2017 as these might not be complete.
%% Cell type:code id:6645d248-4adb-4a1e-aad8-026d2fcfa2ac tags:
``` python
ds_mean=ds.groupby(ds.time.dt.year).mean("time").sel(year=slice(2007,2016)).mean(["year","lon"])
```
%% Cell type:markdown id:f1ebaa8b-cb41-4fca-b4e7-37bbe1325aa9 tags:
Plotting.
%% Cell type:code id:31f754fd-b6df-4e64-a667-14ff91548e10 tags:
``` python
plt.contourf(ds_mean.lat, ds_mean.height/1000, ds_mean["HR_allsky_sw"]+ds_mean["HR_allsky_lw"]
-(ds_mean["HR_clrsky_sw"]+ds_mean["HR_clrsky_lw"]), cmap="RdBu_r", levels=np.linspace(-1,1,21), extend="both")
plt.colorbar()
plt.xlabel("latitude")
plt.ylabel("height / km")
plt.title("2B-FLXHR-LIDAR.P2_R05 CRH 2007-2016")
plt.ylim(0,20)
```
%% Output
(0.0, 20.0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment