Skip to content

Instantly share code, notes, and snippets.

@kuchaale
kuchaale / 1Dline_plot_allowing_vertical_orientation.py
Last active November 1, 2017 17:21
1D line plot allowing vertical orientation
def line(darray, orient_horizontal = True, *args, **kwargs):
"""
Line plot of 1 dimensional DataArray index against values
Wraps matplotlib.pyplot.plot
Parameters
----------
darray : DataArray
Must be 1 dimensional
figsize : tuple, optional
A tuple (width, height) of the figure in inches.
@kuchaale
kuchaale / pydap_client_test.ipynb
Last active November 21, 2017 06:01
pydap_client_test.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 / pydap_merra2.ipynb
Last active December 11, 2017 13:36
pydap_merra2.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 / LWA_equivalentlatitude_calculation_xarray.ipynb
Created March 1, 2018 18:23
LWA_equivalentlatitude_calculation_xarray.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 / eblow.py
Created March 16, 2018 09:53 — forked from calippo/eblow.py
[scikit-learn/sklearn, pandas] Plot percent of variance explained for KMeans (Elbow Method)
import pandas as pd
import matplotlib.pyplot as plt
import seaborn
from sklearn.cluster import KMeans
import numpy as np
from scipy.spatial.distance import cdist, pdist
def eblow(df, n):
kMeansVar = [KMeans(n_clusters=k).fit(df.values) for k in range(1, n)]
centroids = [X.cluster_centers_ for X in kMeansVar]
@kuchaale
kuchaale / hide_code_pdf.md
Created March 16, 2018 11:32 — forked from macoj/hide_code_pdf.md
Hiding code when exporting jupyter notebook to pdf
@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.
@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 / 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 / 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.