Skip to content

Instantly share code, notes, and snippets.

@jklymak
jklymak / distance_along_line.py
Last active March 30, 2022 13:19
Distance along a line
"""
Use https://github.com/jklymak/waypoint_distance instead!
"""
def get_xy(ds, lat0, lon0):
x = (ds.longitude - lon0) * np.cos(np.deg2rad(lat0)) * 60 * 1.852
y = (ds.latitude - lat0) * 60 * 1.852
ds['x'] = x
ds.x.attrs['units'] = f'km east of {lon0}'
ds['y'] = y
[preamble]
id: 2
numerator: 25400000
denominator: 473628672
magnification: 1000
comment: ' TeX output 2020.06.30:2115'
[postamble]
maxv: 5088.900009pt
maxh: 5058.900009pt
@jklymak
jklymak / TimeSeriesNotes.ipynb
Last active September 17, 2021 14:16
TimeSeriesNotes.ipynb
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.
@jklymak
jklymak / BottomDrag.ipynb
Created November 7, 2019 00:33
Bottom drag calc
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jklymak
jklymak / tcalc.ipynb
Created March 17, 2019 23:00
Temp budget calc
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jklymak
jklymak / Notes5k.ipynb
Last active May 21, 2018 17:20
Notes 5k runs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jklymak
jklymak / bachelor.py
Created May 9, 2018 16:25
bachelor mil example
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.cbook import get_sample_data
fname = get_sample_data('percent_bachelors_degrees_women_usa.csv',
asfileobj=False)
gender_degree_data = np.genfromtxt(fname, delimiter=',', names=True)
# These are the colors that will be used in the plot
@jklymak
jklymak / # hdf5 - 2018-05-03_14-04-12.txt
Created May 3, 2018 23:30
hdf5 on macOS 10.13.4 - Homebrew build logs
Homebrew build logs for hdf5 on macOS 10.13.4
Build date: 2018-05-03 14:04:12
@jklymak
jklymak / # netcdf - 2017-07-10_15-49-19.txt
Created May 3, 2018 23:28
netcdf on macOS 10.13.4 - Homebrew build logs
Homebrew build logs for netcdf on macOS 10.13.4
Build date: 2017-07-10 15:49:19