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
% affils.sty -- automatically number affiliations | |
% Copyright 2016 Peter Williams <[email protected]> | |
% Licensed under the MIT License. | |
% | |
% To use: | |
% | |
% 1. Save this file next to your .tex file and add \usepackage{affils} at its top. | |
% | |
% 2. Before your author list, write: | |
% |
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've been working with javascript for a bit, and I miss my | |
Python-style namespaces and class inheritance. Here's a little | |
pattern I came up with that allows me to do things (kind of) | |
the way I wish I could within javascript. I'd be curious if any | |
experienced JS users have comments or critiques. Thanks! | |
Edit - also see the second version (which I think is more clean) | |
below. | |
**********************************************************************/ |
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/env python | |
# Re-projects a 2D FITS image so that it is aligned pixel-for-pixel with | |
# another reference FITS image. | |
# Usage: | |
# wcsalign.py <infile> <reffile> <outfile> | |
# | |
# <infile> = Input fits file | |
# <reffile> = Reference fits file |
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
# Script by Andrea Zonca, http://zonca.github.io | |
import matplotlib | |
matplotlib.use("agg") | |
import healpy as hp | |
import matplotlib.pyplot as plt | |
use_planck_cmap = True | |
# Colormap available from https://github.com/zonca/paperplots/raw/master/data/Planck_Parchment_RGB.txt | |
# Maps available at: http://irsa.ipac.caltech.edu/data/Planck/release_1/all-sky-maps/ |
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
#!/usr/bin/env python | |
"""strip outputs from an IPython Notebook | |
Opens a notebook, strips its output, and writes the outputless version to the original file. | |
Useful mainly as a git filter or pre-commit hook for users who don't want to track output in VCS. | |
This does mostly the same thing as the `Clear All Output` command in the notebook UI. | |
LICENSE: Public Domain |
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 jdcal | |
from jdcal import ipart, fpart, is_leap, gcal2jd, jd2gcal | |
CJ = 36525.0 | |
def days_in_year(year, c="g"): | |
"""Number of days in a calendar year (Gregorian/Julian).""" | |
if c.lower() == "g": | |
return 366 if is_leap(year) else 365 |
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
on isOptionKeyPressed() | |
return (do shell script "/usr/bin/python -c 'import Cocoa; print Cocoa.NSEvent.modifierFlags() & Cocoa.NSAlternateKeyMask > 1'") is "True" | |
end isOptionKeyPressed |
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 pymc as pm | |
import numpy as np | |
# FIXME: Need to store duplicates too, when jumps are rejected. That means some mechanism | |
# for making sure the history is full-rank needs to be employed. | |
class HistoryCovarianceStepper(pm.StepMethod): | |
_state = ['n_points','history','tally','verbose'] | |
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 __future__ import division | |
from numpy.fft import rfft | |
from numpy import argmax, mean, diff, log, nonzero | |
from scipy.signal import blackmanharris, correlate | |
from time import time | |
import sys | |
try: | |
import soundfile as sf | |
except ImportError: | |
from scikits.audiolab import flacread |