Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Make movie of 3D cloud fields | |
| """ | |
| import xarray as xr | |
| import matplotlib.pyplot as plt | |
| from mpl_toolkits.mplot3d import Axes3D | |
| from matplotlib.colors import LightSource | |
| from skimage import measure | |
| from scipy.interpolate import interp1d | |
| from scipy.ndimage import gaussian_filter |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| from matplotlib import pyplot as plt | |
| import numpy as np | |
| %matplotlib inline | |
| url = 'https://storage.googleapis.com/pangeo-cmip6/pangeo-cmip6-zarr-consolidated-stores.csv' | |
| df = pd.read_csv(url) | |
| run_count = df[df.activity_id == 'CMIP'].groupby(['experiment_id', 'source_id']).zstore.count() | |
| rcu = run_count.unstack(level=-1) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from itertools import product | |
| import numpy as np | |
| INV_SQRT_3 = 1.0 / np.sqrt(3.0) | |
| ASIN_INV_SQRT_3 = np.arcsin(INV_SQRT_3) | |
| def gaussian_bell(xs, ys, xc=0., yc=0., xsigma=1., ysigma=1.): | |
| """ Compute a 2D Gaussian with asymmetric standard deviations and |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import xarray as xr | |
| import numpy as np | |
| # create an example dataset | |
| da = xr.DataArray(np.random.rand(10,30,40), dims=['time', 'lat', 'lon']) | |
| # define a function to compute a linear trend of a timeseries | |
| def linear_trend(x): | |
| pf = np.polyfit(x.time, x, 1) | |
| # we need to return a dataarray or else xarray's groupby won't be happy |
NewerOlder