Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
resampled_xray = xray.open_dataset(
'COLA_data/resampled_tas_Amon_CCSM4_piControl_r3i1p1_000101-012012.nc')
climatology = resampled_xray.groupby('time.month').mean('time')
anomalies = resampled_xray.groupby('time.month') - climatology
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shoyer
shoyer / faster.txt
Created November 18, 2015 18:37
xray pcolormesh profiling
4099953 function calls (4093947 primitive calls) in 14.571 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
89302 4.795 0.000 5.585 0.000 linref.py:14(__call__)
722 2.353 0.003 2.355 0.003 {cartopy.trace.project_linear}
89302 1.491 0.000 1.781 0.000 point.py:188(geos_point_from_py)
480 0.439 0.001 9.527 0.020 crs.py:329(_attach_lines_to_boundary)
288301 0.439 0.000 0.439 0.000 base.py:209(empty)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shoyer
shoyer / xarray-tutorial-cleared.ipynb
Last active November 25, 2023 03:59
Xarray tutorial for Rossbypalooza
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.