Skip to content

Instantly share code, notes, and snippets.

@kuchaale
kuchaale / save_hvplot.ipynb
Created October 24, 2019 12:41
save_hvplot.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kuchaale
kuchaale / save_area_plot.ipynb
Created November 8, 2019 11:30
save_area_plot.ipynb
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.
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.
@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)
@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 / 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 / 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 / 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.