Skip to content

Instantly share code, notes, and snippets.

View eteq's full-sized avatar

Erik Tollerud eteq

View GitHub Profile
@eteq
eteq / Yoda-OO-Session2.ipynb
Last active August 29, 2015 13:57
Object-Oriented Programming intro for Astronomers (For Yale Overarching Discussion of Astro/YODA)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Freezing version number to astropy/version.py
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-2.7
creating build/lib.macosx-10.9-x86_64-2.7/astropy
copying astropy/__init__.py -> build/lib.macosx-10.9-x86_64-2.7/astropy
copying astropy/conftest.py -> build/lib.macosx-10.9-x86_64-2.7/astropy
copying astropy/logger.py -> build/lib.macosx-10.9-x86_64-2.7/astropy
copying astropy/setup_helpers.py -> build/lib.macosx-10.9-x86_64-2.7/astropy
@eteq
eteq / mockimg.py
Created September 23, 2014 22:45
Mock astronomy image generation code
from __future__ import division, print_function
import abc
import numpy as np
from matplotlib import pyplot as plt
from astropy import units as u
from astropy.modeling import Fittable2DModel, Parameter, fitting
from astropy.modeling import format_input as _format_input
@eteq
eteq / galacto_plots.ipynb
Last active August 29, 2015 14:08
Code to show galactocentric stuff
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eteq
eteq / old-style class property weirdness.ipynb
Created December 3, 2014 00:32
IPython notebook demonstrating how properties are different in new-style and old-style py 2.x classes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eteq
eteq / adsjson_to_orcid.py
Last active August 29, 2015 14:11
A script to grab ADS private libraries and send them to ORCID
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
@eteq
eteq / dolphot_runner.py
Created June 26, 2015 14:42
Scripts to make doing things with ACS and DOLPHOT easier from python
from __future__ import division
import os
import sys
import pty
import select
import subprocess
def find_dolphot(dirstocheck=None):
@eteq
eteq / astroplan_realtime_update.ipynb
Last active September 15, 2015 23:32
Demo of astroplan for real-time observatory updates
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eteq
eteq / invocation.py
Last active December 18, 2015 20:54
Hypothetical example for how parameter file schema might be defined. Annoyingly, it appears gists automatically re-order to alphabetical... But best to read this from the bottom file up to understand what's going on.
import schema_example # this schema gets created *on import* here
import astropfile
astropfile.engage('parfile_example') # runs all the tasks in the file
parset = astropfile.edit_params('parfile_example') # pops up a GUI/Web page that can edit the file
parset.engage() # actually runs the thing
parset = astropfile.edit_params(schema_example.fit_gaussian_to_echelle1) # same as above, but creates a GUI with the defaults