Skip to content

Instantly share code, notes, and snippets.

@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)
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 / 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.
@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 / stratopause_estimation_and_verification.ipynb
Last active May 29, 2019 13:33
stratopause_estimation_and_verification.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 / nexrad_composites.py
Created September 25, 2018 05:59 — forked from tristanwietsma/nexrad_composites.py
Downloader for NEXRAD GeoTIFF composites
from sys import exit, argv
import datetime, zipfile
import requests
def dlhook(r, *args, **kwargs):
print('GET %s'%str(r.url))
base_url = "http://mesonet.agron.iastate.edu/request/gis/n0r2gtiff.php?dstr=%s"
def fetch(tme):
@kuchaale
kuchaale / trends4petr_script.py
Last active April 24, 2019 12:50
Calculates trends across variables
import xarray as xr
import dask.array as da
from dask.delayed import delayed
import numpy as np
from scipy import stats
# regression function defition
def regression(y):
"""apply linear regression function along time axis"""
axis_num = y.get_axis_num('time')
@kuchaale
kuchaale / metamodelling.ipynb
Created June 4, 2018 06:26 — forked from JiaweiZhuang/metamodelling.ipynb
Performance of different ML algorithms for fitting functions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.