Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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):
"""
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 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)
#!/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,