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 | |
# encoding: utf-8 | |
""" | |
writer.py | |
Makes LaTeX files available to Writer on the iPad, and retrieves | |
the changed documents later. Could be modified to work with Elements, | |
etc. on the iPad. The idea is to copy the latex files to the | |
~/Dropbox/Writer directory, and retain its project membership | |
by appending the host directory name to the original file name. |
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 | |
# encoding: utf-8 | |
""" | |
Download MILES spectra and associate metadata. | |
2012-05-25 - Created by Jonathan Sick | |
""" | |
import os | |
from StringIO import StringIO |
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/bash | |
# From http://emptysquare.net/blog/syntax-highlighting-with-pycharm-pygments-and-keynote/ | |
/usr/local/bin/pygmentize -f rtf -O "style=friendly,fontface=Courier Bold" "$1" | pbcopy |
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 subprocess | |
import os | |
import time | |
from watchdog.observers import Observer | |
from watchdog.events import FileSystemEventHandler | |
class ChangeHandler(FileSystemEventHandler): | |
"""React to modified .tex files.""" |
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 | |
import numpy as np | |
import emcee | |
class ProbWrapper(object): | |
def __init__(self, f): | |
super(ProbWrapper, self).__init__() | |
self._f = f |
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
# Say the target fits image is image1.fits, you want to align image2.fits to its pixel frame | |
ln -s image1.fits image2_reg.head | |
swarp image2.fits -IMAGEOUT_NAME image2_reg.fits -COMBINE N -RESAMPLE Y | |
# the resampled+aligned image2 will be image2_reg.resample.fits | |
# May be other flags that need to be set; I've pipelined this so I forget how to do a barebones case! |
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 | |
# encoding: utf-8 | |
""" | |
File I/O using CANFAR's VOSpace. | |
2013-05-24 - Created by Jonathan Sick | |
""" | |
import os | |
import time |
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 astropy.coordinates import ICRS, Distance, Angle | |
from astropy import units as u | |
import numpy as np | |
def correct_rgc(coord, glx_ctr=ICRS('00h42m44.33s +41d16m07.5s'), | |
glx_PA=Angle('37d42m54s'), | |
glx_incl=Angle('77.5d'), | |
glx_dist=Distance(783, unit=u.kpc)): | |
"""Computes deprojected galactocentric distance. |
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
np.sqrt(header['CD1_1'] ** 2. + header['CD1_2'] ** 2.) * 3600. |
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
# Scons "makefile" for imfit and related programs | |
# | |
# To use this, type the following on the command line: | |
# $ scons <target-name> | |
# where <target-name> is, e.g., "imft", "imfit_db", etc. | |
# "scons" by itself will build *all* targets | |
# | |
# To clean up files associated with a given target: | |
# $ scons -c <target-name> | |
# To clean up all targets (including programs): |
OlderNewer