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
# https://github.com/blaylockbk/Carpenter_Workshop/blob/main/paint/simple_colors.py | |
# https://github.com/blaylockbk/Carpenter_Workshop/blob/main/notebooks/demo_simple_distinct_colors.ipynb | |
""" | |
========================== | |
20 Simple, Distinct Colors | |
========================== | |
Cycle Sasha Trubetskoy's 20 simple colors in your Matplotlib plots | |
https://sashamaps.net/docs/resources/20-colors/ |
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 COPIED THIS EXAMPLE FROM THIS FINE BOOK | |
# ---------------------------------------------------------------------------- | |
# Title: Scientific Visualisation - Python & Matplotlib | |
# Author: Nicolas P. Rougier | |
# License: BSD | |
# ---------------------------------------------------------------------------- | |
# Contour with drop shadows | |
# ---------------------------------------------------------------------------- | |
import scipy | |
import numpy as np |
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
# See full function at: https://github.com/blaylockbk/Carpenter_Workshop/blob/main/toolbox/cartopy_tools.py | |
from toolbox.cartopy_tools import common_features | |
ax = common_features('50m', dpi=200).BORDERS().BATHYMETRY().TERRAIN().ax |
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
""" | |
Brian Blaylock | |
Most recent function is located here: | |
https://github.com/blaylockbk/Herbie/blob/master/herbie/tools.py | |
This function is much faster than my old `pluck_points` function found here: | |
https://github.com/blaylockbk/Carpenter_Workshop/blob/main/toolbox/gridded_data.py | |
""" |
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
''' | |
Brian Blaylock | |
Most recent function is located here: | |
https://github.com/blaylockbk/Carpenter_Workshop/blob/main/toolbox/gridded_data.py | |
But you should consider using the nearest_points() function instead, found here: | |
https://github.com/blaylockbk/Herbie/blob/master/herbie/tools.py | |
''' |
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 matplotlib.pyplot as plt | |
import matplotlib as mpl | |
fig = plt.figure() | |
ax = fig.add_axes([0.05, 0.80, 0.9, 0.1]) | |
cb = mpl.colorbar.ColorbarBase(ax, orientation='horizontal', | |
cmap='gist_ncar', | |
norm=mpl.colors.Normalize(0, 10), # vmax and vmin | |
extend='both', |
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
# Brian Blaylock | |
# August 7, 2021 | |
""" | |
It is often necessary to fully expand a pathlib.Path object when the | |
path is given a ~ or environment variables. This custom method | |
attachs to Path a method that fully expands these to the full path. | |
For example, Path('${HOME}/this/dir).expand() becomes | |
PosixPath('/user/name/this/dir'). | |
""" |
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
## Brian Blaylock | |
## August 7, 2021 | |
# borrowed from Herbie package. | |
# use in __init__.py to create/read config.toml for package. | |
import toml | |
import os | |
from pathlib import Path |
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 | |
#======================================================================= | |
# Specify the "start" and "end" time. | |
#======================================================================= | |
# Use format "HH:MM YYYY-MM-DD" | |
start="00:00 2021-04-01" | |
end="00:00 2021-04-02" | |
increment="+1 hours" | |
#======================================================================= |
NewerOlder