Skip to content

Instantly share code, notes, and snippets.

@eteq
eteq / galacto_plots.ipynb
Last active August 29, 2015 14:08
Code to show galactocentric stuff
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eteq
eteq / local_build.py
Last active July 3, 2018 14:49
Authorea script to build locally with LaTeX NOTE: updates at https://github.com/eteq/authorea-scripts
#!/usr/bin/env python
from __future__ import division, print_function
"""
This script generates a file to use for building authorea papers, and then runs
latex on them.
Requires python >= 2.6 (3.x should work, too)
The key assumptions are:
@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 / gh_issuereport.py
Created July 5, 2014 17:00
A script to query github and find out how many PRs and issues a project has
from __future__ import print_function
"""
This script will use PyPI to identify a release of a package, and then search
through github to get a count of all of the issues and PRs closed/merged since
that release.
Usage:
python gh_issuereport.py astropy/astropy astropy/0.3
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eteq
eteq / rc3.py
Created February 5, 2014 19:04
RC3 (Third Reference Catalog of Bright Galaxies, de Vacouleurs+ 91) loader
# coding: utf-8
from __future__ import print_function, division
"""
A python function to grab the RC3 catalog from vizier and parse it.
Requires `astropy <http://www.astropy.org>`_ version >= 0.3
This does not include the actual rc3 data file. The python `load_rc3` function
will get the data file automatically from
@eteq
eteq / apj_short_prop.bst
Created March 1, 2013 20:12
A modified version of the apj latex/bibtex bst file for funding/observing proposals where there is very little space.
%%This is often best used in a latex file in two-column mode. To do that, do:
%%
%%\usepackage{multicol} % before \begin{document}
%% ... document ...
%%\begin{multicols}{2}
%%\bibliography{filename}{}
%%\bibliographystyle{apj_short_prop}
%%\end{multicols}
@eteq
eteq / xkeckhelio.py
Created February 21, 2013 00:02
Heliocentric correction code for Keck observatory, based on an idl procedure from XIDL
#This is a mostly literal port of x_keckhelio.pro from XIDL (http://www.ucolick.org/~xavier/IDL/)
from __future__ import division
from math import pi
from numpy import cos, sin
import numpy as np
def x_keckhelio(ra, dec, epoch=2000.0, jd=None, tai=None,
longitude=None, latitude=None, altitude=None, obs='keck'):
"""