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 hidden or 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): |
This file contains hidden or 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 hidden or 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 hidden or 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, |
NewerOlder