Skip to content

Instantly share code, notes, and snippets.

View jwise77's full-sized avatar

John Wise jwise77

View GitHub Profile
@jwise77
jwise77 / bin.py
Created April 15, 2019 14:40
yt Cartesian to Spherical mapping
nbins = 33
sp = ds.sphere(center, radius)
nz_center = sp['spherical_r'].nonzero()
dr_min = sp['spherical_r'][nz_center].min()
extrema = dict(x=(0.99*dr_min, outer_factor * radii[_cid]),
y=(-0.001*np.pi, 1.001*np.pi),
z=(-1.001*np.pi, 1.001*np.pi))
p3d = yt.Profile3D(sp, 'spherical_r', nbins, extrema['x'][0], extrema['x'][1], True,
'spherical_theta', nbins, extrema['y'][0], extrema['y'][1], False,
'spherical_phi', nbins, extrema['z'][0], extrema['z'][1],False,
# improve colors
set -g default-terminal "screen-256color"
# soften status bar color from harsh green to light gray
set -g status-bg '#666666'
set -g status-fg '#aaaaaa'
unbind C-b
set -g prefix C-a
bind-key C-a last-window
@jwise77
jwise77 / astroph.py
Created July 9, 2019 20:16
arXiv downloader
#import xmlrpclib
import xmlrpc.client as xmlrpclib
import os
import urllib.request
papers_dir = "/dir/to/papers"
user = 'username'
passwd = 'password'
server = xmlrpclib.ServerProxy('http://your.url/xmlrpc.php')
@jwise77
jwise77 / durham-notes.md
Last active August 4, 2019 11:41
Small Galaxies, Cosmic Questions Conference Notes
@jwise77
jwise77 / geneva-notes.md
Last active September 12, 2019 15:04
Notes from 2019 Geneva CEMP star conference

CEMP Stars as Probes of First Star Nucleosynthesis, the IMF, and Galactic Assembly

Geneva: 9-13 September 2019

Conference page

Slides (not available yet; 11 Sept)

Table of contents

  1. Monday
  2. Tuesday
@jwise77
jwise77 / sesto2020-notes.md
Last active February 14, 2020 09:14
Sesto 2020 Workshops
@jwise77
jwise77 / fs6-notes.md
Last active March 10, 2020 13:14
First Stars VI
def uniq(seq):
set = {}
map(set.__setitem__, seq, [])
return set.keys()
#------------------------------------------------------------------------
from string import join
datfile = 'rawbib.dat'
@jwise77
jwise77 / movie.sh
Created November 28, 2021 23:06
bash function to create mp4 from an image sequence
function movie() {
if [ $# -lt 3 ]; then
echo "usage: movie output_movie FPS files"
kill -INT $$
fi
tmpdir=`mktemp -d`
output=$1
fps=$2
shift 2
files="$@"
@jwise77
jwise77 / fs2g2.md
Last active June 24, 2022 12:04
From Stars to Galaxies II