Skip to content

Instantly share code, notes, and snippets.

View barronh's full-sized avatar

Barron H. Henderson barronh

View GitHub Profile
@barronh
barronh / add_kernel.sh
Created September 13, 2023 17:32
Add a Kernel in a Jupyter Environment
#!/bin/bash
def_yes=n
while getopts ":hy" opt; do
case ${opt} in
h ) # process option h
PRINT_HELP=y
;;
y ) # process option y
def_yes=y
;;
@barronh
barronh / aqicmap.py
Last active August 31, 2023 13:51
Matplotlib EPA AQI cmap
import matplotlib.pyplot as plt
import matplotlib.colors as mc
import numpy as np
pmedges = np.asarray([0.0, 12.1, 35.5, 55.5, 150.5, 250.5, 500.5])
o8edges = np.asarray([0.0, 55, 71, 86, 106, 201, 500.])
o1edges = np.asarray([0.0, 60, 125,165,205, 405, 604.])
aqicolors = ['#00e400', '#ffff00', '#ff7e00', '#ff0000', '#8f3f97', '#7e0023']
colors = ['grey'] + aqicolors + ['k']
@barronh
barronh / ussa.py
Last active July 14, 2023 15:54
United States Standard Atmosphere
__all__ = ['usstdatmdf', 'usstdatmds', 'M0', 'R', 'Rs', 'g', '__version__']
__version__ = '0.1.0'
__doc__ = """
This GIST implements the US Standard Atmosphere for Temperature, Pressure,
and Density. The constants and equations are implemented according to the U.S.
Standard Atmosphere (1976) and are only implemented through 84km. The results
can be presented as a Pandas DataFrame or an xarray Dataset.
Requirements
@barronh
barronh / tempo_asdc_direct.ipynb
Created May 4, 2023 19:32
TEMPO_ASDC_Direct.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@barronh
barronh / tempo_pyrsig.ipynb
Last active February 26, 2024 13:38
tempo_pyrsig.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@barronh
barronh / xr_modis.py
Last active March 22, 2023 17:12
xarray wrapper for MODIS
__all__ = ['open_modis']
__version__ = '0.1.0'
def parse_hdfeos_metadata(string):
"""
Borrowed from ARSET training materials
"""
out = dict()
lines = [i.replace('\t','') for i in string.split('\n')]
@barronh
barronh / urscred.py
Last active April 26, 2023 17:32
URS Credential Manager
__all__ = ['URSSession', 'asdc_downloader']
class URSSession:
"""
Class to store URS credentials:
* for use with requests
* for use with netrc and dodsrc
"""
@barronh
barronh / README.md
Last active June 30, 2023 16:28
Nearest Neighbor Averaging with Voronoi Support

Nearest Neighbor Methods

Nearest Neighbor methods used for 2-dimensional interpolation. These methods include two methods of neighbor selection and two methods of weighting. To access any of the functionality, use the Nearest Neighbor Averaging (NNA) class.

Methodology

@barronh
barronh / tempo_syntheticearlyadopters2.ipynb
Created November 10, 2021 15:37
tempo_syntheticearlyadopters2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@barronh
barronh / plotaqdomains.ipynb
Created August 26, 2021 13:09
PlotAQDomains.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.