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
from wrf import getvar | |
from netCDF4 import Dataset | |
import xarray as xr | |
import pyproj | |
# Extract the variables of interest at time index 17 | |
ds = Dataset('../wrfout_d02_2015-07-12_1200.nc') | |
variables = [getvar(ds, var, 17) for var in ('z', 'dbz', 'pressure', 'ter', 'ua', | |
'va', 'wa', 'temp', 'rh')] | |
data = xr.merge(variables) |
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
# https://stackoverflow.com/questions/35042255/how-to-plot-multiple-seaborn-jointplot-in-subplot | |
import matplotlib.pyplot as plt | |
import matplotlib.gridspec as gridspec | |
import seaborn as sns | |
import numpy as np | |
class SeabornFig2Grid(): |
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 argparse | |
import os | |
import sys | |
import re | |
def printBold(msg): | |
HEADER = '\033[95m' | |
BOLD = '\033[1m' | |
print(HEADER + BOLD + msg + '\x1b[0m') |
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 | |
EPSILON = 1e-10 | |
def _error(actual: np.ndarray, predicted: np.ndarray): | |
""" Simple error """ | |
return actual - predicted |
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
__author__ = "[email protected]" | |
__copyright__ = "Copyright 2020, 2018, https://gist.github.com/ruxi/ff0e9255d74a3c187667627214e1f5fa" | |
__license__ = "MIT" | |
__version__ = "0.0.2" | |
# update: June 13, 2020 | |
# created: Feb 19, 2018 | |
# desc: seaborn jointplot with 'hue' | |
# prepared for issue: https://github.com/mwaskom/seaborn/issues/365 | |
# resolved (22 Aug 2020): https://github.com/mwaskom/seaborn/pull/2210 |
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
# Based on the code by Nick Higham | |
# https://gist.github.com/higham/6f2ce1cdde0aae83697bca8577d22a6e | |
# Compares relative error formulations using single precision and compared to double precision | |
N = 501 # Note: Use 501 instead of 500 to avoid the zero value | |
d = numpy.finfo(numpy.float32).eps * 1e4 | |
a = 3.0 | |
x = a * numpy.ones(N, dtype=numpy.float32) | |
y = [x[i] + numpy.multiply((i - numpy.divide(N, 2.0, dtype=numpy.float32)), d, dtype=numpy.float32) for i in range(N)] |
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
#!/bin/bash | |
yum -y install texlive texlive-latex texlive-xetex | |
yum -y install texlive-collection-latex | |
yum -y install texlive-collection-latexrecommended | |
yum -y install texlive-xetex-def | |
yum -y install texlive-collection-xetex | |
#Optional | |
#yum -y install texlive-collection-latexextra | |
yum -y install texlive-xltxtra |
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.
NewerOlder