This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer