#!/usr/local/other/python/GEOSpyD/2019.03_py3.7/2019-04-22/bin/python
import matplotlib.pyplot as plt
import cartopy.crs as ccrs  # cartopy must be >=0.19
import xarray as xr

ds = xr.open_dataset('/discover/nobackup/projects/gmao/geos_cf_dev/psturm/CFv2_c90/holding_justcube/gcc_cube/CFv2_ctrl_c90.gcc_cube.20180930_2130z.nc4')  # see note below for download instructions

plt.figure()
ax = plt.axes(projection=ccrs.EqualEarth())
ax.coastlines()
ax.set_global()

norm = plt.Normalize(1e-8, 7e-8)

for face in range(6):
    x = ds.corner_lons.isel(nf=face)
    y = ds.corner_lats.isel(nf=face)
    v = ds.KppTotSteps.isel(time=0, lev=23, nf=face)
    ax.pcolormesh(x, y, v, norm=norm, transform=ccrs.PlateCarree())

plt.savefig("sunrise_cube.png")
