Skip to content

Instantly share code, notes, and snippets.

View augustfly's full-sized avatar

August Muench augustfly

View GitHub Profile
@augustfly
augustfly / bolognese_citeprocCSL.json
Created April 26, 2017 13:16
bolognese produces citeproc CSL with nonstandard types
{
"type": "computer_program",
"id": "https://doi.org/10.5281/zenodo.557087",
"categories": [
"python",
"library",
"mice",
"behaviour",
"analysis",
"intellicage"
@augustfly
augustfly / bokeherr.py
Created June 22, 2016 16:11
bokeh x,y error snippet
# xerr
xerrx = [(i, j) for i, j in zip(x - xerr, x + xerr)]
xerry = [(i, i) for i in y]
bp.multi_line(xerrx, xerry, alpha=0.5)
# yerr
yerrx = [(i, i) for i in x]
yerry = [(i, j) for i, j in zip(y - yerr, y + yerr)]
bp.multi_line(yerrx, yerry, alpha=0.5)
@augustfly
augustfly / mrt2csv.py
Created December 8, 2015 22:17
Convert an AAS Journal MRT file to a CSV, fixing sexidecimal column madness as you go.
# brought to you by [email protected]
# version 0.1; 2015-12-08T17:17:00-0500
from astropy.table import Table
from astropy.coordinates import Angle, SkyCoord
import astropy.units as u
# parse some ApJ/AJ MRT file. it's really that easy.
data = Table.read("datafile4.txt", format="ascii.cds")
@augustfly
augustfly / qlfits ql zip
Created March 13, 2015 13:05
Why is QLFits3 QuickLook grabbing gnu-zip archives?
bash-3.2$ qlmanage -m | grep zip
org.7-zip.arj-archive -> /Library/QuickLook/BetterZipQL.qlgenerator (1.6)
public.bzip2-archive -> /Library/QuickLook/BetterZipQL.qlgenerator (1.6)
public.archive.bzip2 -> /Library/QuickLook/BetterZipQL.qlgenerator (1.6)
public.zip-archive -> /Library/QuickLook/BetterZipQL.qlgenerator (1.6)
org.7-zip.7-zip-archive -> /Library/QuickLook/BetterZipQL.qlgenerator (1.6)
org.gnu.gnu-zip-tar-archive -> /Library/QuickLook/BetterZipQL.qlgenerator (1.6)
org.7-zip.lha-archive -> /Library/QuickLook/BetterZipQL.qlgenerator (1.6)
org.bzip.bzip2-tar-archive -> /Library/QuickLook/BetterZipQL.qlgenerator (1.6)
org.gnu.gnu-zip-archive -> /Library/QuickLook/QLFits3.qlgenerator (3.0.3)
from __future__ import division, print_function
"""
This script takes in the URL to the JSON version of an ADS private library, and outputs a bibtex file suitable for importing into ORCiD
"""
import json
import urllib2
@augustfly
augustfly / example.txt
Created March 18, 2014 13:27
example header file (output from header.totextfile("/tmp/example.txt"))
SIMPLE = T / Standard FITS file
BITPIX = 8 / ASCII or bytes array
NAXIS = 0 / Minimal header
EXTEND = T / There may be FITS ext
WCSAXES = 2 / no comment
CTYPE1 = 'RA---TAN-SIP' / TAN (gnomic) projection + SIP distortions
CTYPE2 = 'DEC--TAN-SIP' / TAN (gnomic) projection + SIP distortions
EQUINOX = 2000.0 / Equatorial coordinates definition (yr)
LONPOLE = 180.0 / no comment
LATPOLE = 0.0 / no comment
@augustfly
augustfly / astropy_xcode5_stderr.txt
Created October 4, 2013 17:45
errors produced building astropy on Xcode 5
(test_astropy)<01:43:39> aamn@lynds:astropy-0.2.4 > python setup.py build > /dev/null
wcsbth.c:19947:16: warning: function 'input' is not needed and will not be emitted
[-Wunneeded-internal-declaration]
static int input (void)
^
1 warning generated.
wcspih.c:10041:16: warning: function 'input' is not needed and will not be emitted
[-Wunneeded-internal-declaration]
static int input (void)
^
healpy-1.6.2 > python setup.py --verbose build
pkg-config is not installed, falling back to pykg-config
running build
running build_py
not copying healpy/__init__.py (output up-to-date)
not copying healpy/pixelfunc.py (output up-to-date)
not copying healpy/sphtfunc.py (output up-to-date)
not copying healpy/visufunc.py (output up-to-date)
not copying healpy/fitsfunc.py (output up-to-date)
not copying healpy/projector.py (output up-to-date)
@augustfly
augustfly / vao_intercom_script.py
Created April 8, 2011 17:21
notes as script on using ds9 private SAMP and public samp mtypes
# '/Users/aamn/Projects/VO_Projects/Python/Test_vaods9'
import os
import vao_intercom
ds9c = vao_intercom.ds9Com()
# find out where ds9 thinks it is
ds9c.get('cd')
@augustfly
augustfly / vao_intercom.py
Created April 8, 2011 17:17 — forked from lupalberto/vaods9.py
Gus's play on Omar's sampy code
# src: https://gist.github.com/906716/82e170c4952a75fde3fdc1e5c5f008979e1a8364
import sampy
import urlparse
mtype_lu = {}
mtype_lu['votable'] = {'mtype':'table.load.votable',
'params':['name','url','table-id']}
mtype_lu['fits_table'] = {'mtype':'table.fits.votable' ,
'params':['name','url','table-id']}