Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import argparse
import os
ap = argparse.ArgumentParser(os.path.basename(__file__),
description=__doc__,
formatter_class=argparse.
ArgumentDefaultsHelpFormatter)
ap.add_argument('path_to_files', type=str, help='Path to files')
ap.add_argument('-z', '--zeros', type=int, default=4,
import numpy as np
raob_station_list = 'http://www.raob.com/assets/downloads/raob.stn.txt'
raob_codes = np.genfromtxt(raob_station_list,
skip_header=9, dtype=None, delimiter=',', skip_footer=1, unpack=True)
nrow = len(raob_codes)
ncol = len(raob_codes[0])
raob_lat = np.zeros(nrow)
"""
I will find you and I will highlight you
"""
from colorama import init, Fore, Style, Back
import re
init() # comment out if in Jupyter Notebook
def find_and_highlight(text, str_list, back=Back.YELLOW, fore=''):
regex_str = r'|'.join([r'({})'.format(s) for s in str_list])
import iris
import gridfill
import numpy as np
from scipy import interpolate
def remask_cube(cube, new_mask, interp_method='nearest'):
ma_cube = cube.copy()
data = cube.data
if np.ma.is_masked(data):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dennissergeev
dennissergeev / Iris-Regrid-For-ASR.ipynb
Last active July 3, 2017 17:27
Iris-Regrid-For-ASR.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.
# -*- coding: utf-8 -*-
"""
Meteorological constants as iris cubes
Taken from metpy.constants submodule
"""
import iris
import metpy.constants as metconst
import metpy.units as metunits
#!/usr/bin/env python
"""
Synchronize an Overleaf LaTeX paper with a Github repository
"""
import argparse
import sys
import subprocess as sb
from path import Path # non-standard path.py package
@dennissergeev
dennissergeev / Tupper.ipynb
Last active September 24, 2017 08:43
Tupper's self-referencing function
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.