Skip to content

Instantly share code, notes, and snippets.

@kuchaale
kuchaale / Recover_data_with_known_colourmap.ipynb
Created September 14, 2022 14:39 — forked from kwinkunks/Recover_data_with_known_colourmap.ipynb
Demo of recovering data from an image with a known colourmap. Thank you to David Johnstone (Manchester) for the data example.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuchaale
kuchaale / geoapps_vs_xcontour.ipynb
Created April 13, 2022 14:27
Notebook documenting differences between GeoApps and xcontour calculation of effective diffusivity
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuchaale
kuchaale / pyvortex_bug.ipynb
Created November 25, 2021 20:46
Correction of functions to calculate the equivalent latitude and edge of a polar vortex using Nash criteria
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuchaale
kuchaale / style.css
Created October 13, 2021 23:19 — forked from rougier/style.css
Jupyter stylesheet
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400&family=Source+Code+Pro:wght@300;400&display=swap');
.rendered_html h1,
.rendered_html h2,
.rendered_html h3,
.rendered_html h4 {
color: #000099;
font-weight: 400;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuchaale
kuchaale / SSW_detection_ERA5.ipynb
Created June 25, 2021 11:07
Split and discplament detection in ERA5
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuchaale
kuchaale / sherman.py
Created January 4, 2021 16:07 — forked from 0x0L/sherman.py
Fast moving window regressions
import numba
import numpy as np
@numba.jit(nopython=True, fastmath=True)
def move_regress(X, Y, w, fit_intercept=True):
"""Moving window multi-regressions
Solves the least-squares problems `Y[t-w+1:t+1] = X[t-w+1:t+1] @ B[t] + A[t]`
for `B` and `A` for all `t` in `[w-1, len(Y)-1]`.
@kuchaale
kuchaale / globaltemp.R
Created December 11, 2020 14:23 — forked from jrnold/globaltemp.R
Kalman filter in Stan
library(KFAS)
library(rstan)
data(GlobalTemp)
model_dlm1a <- stan_model("../stan/dlm1a.stan")
y <- as.matrix(GlobalTemp)
data <-
within(list(),
{
@kuchaale
kuchaale / bootstrap_threshold_parallel.ipynb
Created October 15, 2020 14:38 — forked from aaronspring/bootstrap_threshold_parallel.ipynb
bootstrap threshold in parallel with dask
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuchaale
kuchaale / wrf_python_extraction.py
Created October 15, 2020 10:51 — forked from jthielen/wrf_python_extraction.py
Use wrf-python, xarray, and pyproj to post-process WRF output
from wrf import getvar
from netCDF4 import Dataset
import xarray as xr
import pyproj
# Extract the variables of interest at time index 17
ds = Dataset('../wrfout_d02_2015-07-12_1200.nc')
variables = [getvar(ds, var, 17) for var in ('z', 'dbz', 'pressure', 'ter', 'ua',
'va', 'wa', 'temp', 'rh')]
data = xr.merge(variables)